Add FastAPI web/API layer and static site
- queries.py: shared read-only query helpers (feed, brief, category counts) returning plain dicts, used by the API and available to the CLI. - api.py: FastAPI service with Pydantic response models (the companion-app contract), CORS, and endpoints for categories, feed, brief, and health; mounts a static site at /. - static/index.html: minimal dependency-free site rendering the daily five and topic/flavor category browsing. - 'goodnews serve' command launches uvicorn (lazy import; core CLI stays pure-stdlib). Web deps live behind the optional [web] extra. - Dockerfile + .dockerignore + build-system metadata so the service installs and deploys cleanly, with the DB mounted as a shared volume. - README: web/API and deployment docs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,28 @@
|
||||
[build-system]
|
||||
requires = ["setuptools>=68"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "goodnews"
|
||||
version = "0.1.0"
|
||||
description = "Local-first constructive news ingestion and filtering prototype."
|
||||
requires-python = ">=3.11"
|
||||
# The ingestion CLI is intentionally pure-stdlib. The optional `web` extra adds
|
||||
# the API/site layer so the two halves can be deployed and upgraded independently.
|
||||
dependencies = []
|
||||
|
||||
[project.optional-dependencies]
|
||||
web = [
|
||||
"fastapi>=0.110",
|
||||
"uvicorn[standard]>=0.29",
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
goodnews = "goodnews.cli:main"
|
||||
|
||||
[tool.setuptools]
|
||||
packages = ["goodnews"]
|
||||
|
||||
[tool.setuptools.package-data]
|
||||
goodnews = ["static/*"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user