An open-source news project for India. The deployed site is a landing page with
static sample stories, Google sign-in, a public /stories list of ingested
stories and a privacy page.
- FastAPI endpoints ingest, list and serve English stories, each with one citation link.
- Google sign-in (next-auth) creates or reuses the User shared with Rajniti,
then asks only what that shared row is missing (name, state, Saransh topics)
before landing on
/stories. - Optional PostHog captures pageviews, clicks and the sign-in funnel under one ID per person (anonymous, then the User id). No session replay.
- Docker runs the API, frontend and PostgreSQL locally. Deployment uses Cloud Run and Vercel.
The reader app, sign-in, review pipeline and word-limit enforcement are not built.
The temporary ingest routine prompt publishes directly to
the API without human review and may use publisher images. /stories renders the
latest 50 of them, refreshed every minute.
Install Docker with Compose v2 and start its daemon. From the repository root:
make upThis copies missing environment templates, starts PostgreSQL, initializes or migrates the database, then starts the API and frontend. Existing environment files and database data are preserved. The first run builds images and installs dependencies.
Frontend: http://localhost:3001. API docs: http://localhost:8001/docs.
Health: http://localhost:8001/api/v1/health. Host PostgreSQL port: 5433.
| Command | Purpose |
|---|---|
make up |
Migrate and start the local stack |
make stop |
Stop the stack, preserving database data |
make migrate |
Start local PostgreSQL and apply all schema work in one run |
make migrate-prod |
Migrate the production database from .env.production |
make migrate-prod reads DATABASE_URL from .env.production (falling back to an
exported DATABASE_URL) and needs installed backend Python requirements. It refuses
local hosts, so it never touches the local Docker database.
The runner initializes empty tables, adopts a matching unversioned schema and
upgrades tracked revisions. It refuses partial or mismatched unversioned tables
rather than guessing their migration baseline.
Local connections use postgres:5432 inside Docker and 127.0.0.1:5433 on the
host. Default local user, password and database are rajniti; Compose overrides
are in .env.example. Local migrations are pinned to Compose's
database, not a remote URL from your environment.
- Contributing: host-only setup, tests, review and code rules.
- Frontend: frontend environment and analytics configuration.
- Deployment: production migrations, deployment and rollback.
- Domain and decisions: product terminology, planned scope and ADRs.
Backend settings: .env.example.
Frontend settings: frontend/.env.example.
Keep secrets out of commits. Ingest requires X-API-Key; story reads are public;
User endpoints accept only the Next.js server's internal key. See the API docs for
request and response schemas.
Production shares PostgreSQL with Rajniti.
Saransh owns only stories and its migration version table; its migrations must not
touch Rajniti's tables. Everything Saransh knows about a User lives on the shared
users row (onboarded_from and the saransh_* columns), whose schema Rajniti's
migrations own.
Report bugs and attribution errors through GitHub Issues. MIT License. Product and documentation: Pratyusha Trivedi.