Files
kjvstudy.org/pyproject.toml
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

55 lines
1.1 KiB
TOML

[project]
name = "kjvstudy-org"
version = "0.1.0"
description = "Study the King James Bible with AI-powered commentary and insights"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"fastapi[standard]>=0.115.12",
"ged4py>=0.5.2",
"gunicorn>=24.1.1",
"mistune>=3.0.2",
"parse>=1.20.2",
"python-gedcom>=1.0.0",
"requests>=2.32.3",
"weasyprint>=66.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8.3.5",
"pytest-cov>=6.0.0",
"pytest-xdist>=3.5.0",
]
[project.scripts]
kjvstudy-org = "kjvstudy_org.main:main"
[build-system]
requires = ["setuptools>=45", "wheel"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
where = ["."]
include = ["kjvstudy_org*"]
[tool.setuptools.package-data]
kjvstudy_org = ["static/*", "templates/*"]
[tool.uv]
package = true
[dependency-groups]
dev = [
"pytest>=8.3.5",
"pytest-cov>=7.0.0",
"pytest-xdist>=3.5.0",
]
[tool.pytest.ini_options]
addopts = "-n 8"
filterwarnings = [
"ignore::DeprecationWarning:pydantic.*",
"ignore:.*example.* has been deprecated.*:DeprecationWarning",
]