Commit Graph

2 Commits

Author SHA1 Message Date
kennethreitz 1199b7f972 Pre-render resources, stories, topics, and study guides as static pages
Expand static site generation from ~1,277 to ~1,902 pages by adding:
- 40 resource category pages (biblical-angels, parables, etc.)
- 25 resource detail pages (apostles, prophets, women, etc.)
- 29 Bible stories + 26 kids versions
- 36 topic pages
- 12 reading plan pages
- 36 study guide pages

Also skip 404s gracefully (56 resource slugs lack backing data)
and exempt localhost/testclient from rate limiting so the generator
doesn't throttle itself.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 15:10:58 -05:00
kennethreitz 2ab3dfa142 Add static site generation with nginx + hardened FastAPI sidecar
Pre-render ~1,277 high-traffic HTML pages (homepage, books, chapters)
at build time and serve them directly via nginx. All other routes
(verses, search, API, PDFs, Strong's) fall through to a FastAPI
sidecar. If the sidecar crashes, nginx continues serving static
pages and health checks.

Also harden the FastAPI app against the memory/crash issues:
- Switch from bare uvicorn to gunicorn with uvicorn workers
- Add --max-requests worker recycling to prevent memory leaks
- Add --timeout to kill hung workers
- Add per-IP rate limiting middleware (10 req/s, burst of 50)
- Add request timeout middleware (30s max per request)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 21:59:34 -05:00