Commit Graph

29 Commits

Author SHA1 Message Date
kennethreitz 1376ce136a Remove photography static mount — conflicts with app routes for index pages
Keep /static served by Granian natively, photography goes through app.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 11:46:24 -04:00
kennethreitz 42b3c0e19c Drop nginx, use Granian native static file serving
Per gi0baro's benchmarks, nginx halves dynamic throughput (1120 vs 2300 req/s)
while only marginally improving static serving. Granian's --static-path-route
serves photography and static files directly with 7-day cache headers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 11:45:04 -04:00
kennethreitz 7bbd58e85a Add nginx in front of Granian for static file serving and request buffering
Nginx serves photography images and static assets directly from disk,
proxies everything else to Granian with response caching. Adds gzip
compression and request buffering.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 18:35:59 -04:00
kennethreitz 28a276261f Bump to 4 Granian workers in production
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 03:55:11 -04:00
kennethreitz 3de8f9b558 Switch from uvicorn to Granian — Rust-based ASGI server
2.7-6.2x faster across all routes. Essays 7,928 req/s (was 2,747),
Archive 8,449 req/s (was 1,354). Everything sub-1.3ms.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 03:44:54 -04:00
kennethreitz ddf80edf03 Scale back to shared CPU with 2 workers
Performance CPUs require 4GB minimum — shared-cpu-2x with 2 workers
is more cost-effective for this workload.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:47:37 -04:00
kennethreitz 4c1a8bb5eb Scale to 4 uvicorn workers on 2 performance CPUs
PDF generation and OG image rendering block a worker — multiple
workers keep the site responsive during heavy operations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:41:03 -04:00
kennethreitz 5cd48abb90 Port site to Responder (#8)
* Initial Responder port — core content serving working

Homepage, markdown pages, directory listings, image galleries
all rendering. Flask template compatibility via RequestWrapper
and FakeConfig shims.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Complete Responder port — all routes working

Ported all routes from Flask blueprints: archive, search, OG images,
RSS, sitemap, robots.txt, API endpoints, directory browser.
All 25+ routes returning 200.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Update Dockerfile for Responder, warm caches on import

CMD now runs engine_responder:api via uvicorn.
Cache warming happens on module import for production.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Rename engine_responder.py to engine.py

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Update colophon for Responder

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix essay pages, OG images, and PDF export

- Fix find_related_posts and find_adjacent_posts call signatures
- Fix OG image route to use path:path for nested paths
- Add PDF export route with WeasyPrint
- All test plan items passing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 14:03:05 -04:00
kennethreitz f50dad4574 Switch to uvicorn, fix breadcrumbs for all content pages
- Replace gunicorn/gevent with uvicorn for ASGI support
- Add asgiref to wrap Flask WSGI app for uvicorn compatibility
- Enable auto-reload in docker-compose for development
- Add current_path to all content render_template calls
- Simplify breadcrumb template to exclude current page
- Only show breadcrumbs for nested paths (> 1 segment)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 16:58:17 -05:00
kennethreitz 6aef3808c1 Update site to Python 3.14
Update Dockerfile base image, pyproject.toml requirements, and .python-version to use Python 3.14. This includes updating the uv.lock file with the new Python version constraint.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 10:57:21 -04:00
kennethreitz 71d4db055e Add PDF generation support and improve documentation
- Add WeasyPrint dependencies to Dockerfile for server-side PDF generation
- Update README with Quick Start guide for Docker and local development
- Add PDF template for article rendering
- Add error template for better error handling
- Reorganize photography into top-12 subdirectory
- Update pyproject.toml with PDF generation dependencies
- Enhance content.py with PDF rendering capabilities
- Improve directory template with gallery features

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-01 15:17:43 -04:00
kennethreitz a04f2ea95f Fix Dockerfile to copy tuftecms package before install
Copy tuftecms directory before install step since pyproject.toml force-includes templates and static directories.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-29 14:14:55 -04:00
kennethreitz 64194a020c Add hidden /games easter egg and fix Dockerfile
Add /games route with three inline JavaScript games (Snake, Pong, Breakout). Fix Dockerfile to copy README.md before install step since pyproject.toml references it.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-29 14:11:14 -04:00
kennethreitz 6700306bf0 Refactor Dockerfile and docker-compose.yml to remove 'uv' command prefix from gunicorn execution 2025-09-17 07:49:28 -04:00
kennethreitz 3d6dfae01b Refactor cache generation and improve metadata handling
- Updated docker-compose.yml to mount data directory for improved file access.
- Implemented a unified cache generation function in engine.py to streamline cache creation for blog posts, sidenotes, outlines, quotes, connections, and terms.
- Replaced individual cache extraction functions with a single MetadataCache class for cleaner access to cached data.
- Modified prebuild_cache.py to utilize the new unified cache function, ensuring all cache files are generated in a single sweep.
- Enhanced outlines.html template to simplify anchor URL generation for headings.
2025-09-16 19:37:23 -04:00
kennethreitz 6ac99803bf Upgrade to astral/uv image and fix docker-compose cache preservation
Updated Dockerfile to use official astral/uv:python3.13-bookworm base image instead of copying uv from separate image, simplifying build process. Fixed docker-compose.yml to preserve pre-built cache directory when mounting local files, ensuring instant startup works in both production and local development environments.

Changes:
- Use astral/uv:python3.13-bookworm as base image
- Remove multi-stage copy of uv binary
- Add cache volume preservation in docker-compose
- Maintain instant startup with pre-built caches in all environments

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 16:34:33 -04:00
kennethreitz e1245511d6 Implement Docker build-time cache pre-generation for instant startup
Added prebuild_cache.py script that generates all site caches (blog posts, sidenotes, outlines, quotes, connections, terms) as JSON files during Docker build. Modified engine.py to load pre-built caches on startup, eliminating the 30-40 second cache preload delay and making the site instantly responsive.

Key improvements:
- Zero startup delay with pre-built caches
- Proper datetime serialization/deserialization
- Graceful fallback to runtime caching if pre-built files missing
- Technology serving human consciousness - mechanical work during build, instant experience for users

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 10:29:51 -04:00
kennethreitz e5f1926112 test 2025-09-16 01:12:07 -04:00
kennethreitz b7d3fa9c5d test 2025-09-15 22:36:14 -04:00
kennethreitz d975d7b937 test 2025-09-15 20:59:35 -04:00
kennethreitz 9cbd1d4d06 test 2025-09-14 10:41:34 -04:00
kennethreitz 6f67808233 Refactor code structure for improved readability and maintainability 2025-09-01 12:51:00 -04:00
kennethreitz 277c7a9cb8 Update Dockerfile to use Gunicorn for running the application and add Gunicorn as a dependency in pyproject.toml 2025-09-01 12:40:55 -04:00
kennethreitz 09af53d6cb Enhance UI and functionality of directory and mindmap templates
- Updated styles in directory.html for improved readability and aesthetics, including color adjustments and hover effects.
- Enhanced directory item display with better spacing and tracking for text elements.
- Improved loading animations and transitions for a smoother user experience.
- Refactored mindmap.html to implement an Obsidian-style theme with new CSS variables for consistent styling.
- Added control and search panels to the mindmap for better user interaction.
- Implemented a class-based structure for mindmap functionality, improving code organization and maintainability.
- Enhanced node and link rendering in the mindmap with dynamic styling based on node types.
- Added tooltip functionality for nodes in the mindmap to provide contextual information.
- Improved responsiveness and accessibility of both templates.
2025-05-23 11:05:25 -04:00
kennethreitz a706563036 Refactor code structure for improved readability and maintainability 2025-05-23 10:01:30 -04:00
kennethreitz 9b0df60ad5 Replace requirements.txt with pyproject.toml
templates/base.html: Add custom.css stylesheet

AI:

Replace requirements.txt with pyproject.toml and add custom.css
2025-04-22 13:48:17 -04:00
kennethreitz e92f072db6 improvements 2025-03-26 15:11:28 -04:00
kennethreitz e9e12050dc dockerfile 2024-08-15 18:30:42 -04:00
kennethreitz 6cf9c372ab initial 2024-08-15 18:24:40 -04:00