How kvgai-tech/kvgai-tech-starter-template works
This repository is a full-stack starter template: a browser-facing Next.js app, a private FastAPI service, and an ARQ background worker, with Redis and Supabase Postgres as shared infrastructure. The primary domain workflow is record creation: the API persists a record, enqueues processing through Redis, and the worker updates its status in Postgres. The web app also has login/session routes and dashboard, records, settings, and status pages; their detailed wiring is not shown in the excerpts. README documents the web-to-API proxy and deployment topology; unsampled UI and infrastructure relationships are not inferred.
Main entry points: db.py Database engine · app Next.js app · main.py FastAPI app · records.py Record endpoints
Components 21
Web application
- Next.js app
web/src/app - API proxy
web/src/app/api/v1/[...path]/route.ts - Login and session
web/src/app/api/auth - Product pages
web/src/app
API and records
- FastAPI app
api/app/main.py - Health and info routes
api/app/api/routes - Record endpoints
api/app/api/routes/records.py - Record operations
api/app/services/record.py - Record schemas
api/app/schemas/record.py - API DB session
api/app/db/session.py - API settings
api/app/core/config.py
Background processing
- ARQ worker
worker/app/worker.py - Record processing job
worker/app/jobs/process_record.py - Worker settings
worker/app/config.py
Shared infrastructure
- ARQ Redis pool
api/app/core/redis.py - Database engine
api/app/shared/db.py - Database URL handling
api/app/shared/database_url.py - Record model
api/app/shared/models/record.py - Supabase Postgres
- Redis
Other components
- Browser user
Connections 24
- Browser user → Next.js app: uses
- Next.js app → API proxy: routes API requests
- Next.js app → Login and session: provides auth routes
- Next.js app → Product pages: renders pages
- API proxy → FastAPI app: proxies requests
- FastAPI app → Health and info routes: registers routes
api/app/main.py - FastAPI app → Record endpoints: registers routes
api/app/main.py - FastAPI app → ARQ Redis pool: starts and closes
api/app/main.py - Record endpoints → Record operations: calls
api/app/api/routes/records.py - Record endpoints → API DB session: requests session
api/app/api/routes/records.py - Record endpoints → Record schemas: uses schemas
api/app/api/routes/records.py - Record operations → Record model: queries and writes
api/app/services/record.py - Record operations → ARQ Redis pool: enqueues job
api/app/services/record.py - API DB session → Database engine: creates session factory
api/app/db/session.py - Database engine → Database URL handling: normalizes connection
api/app/shared/db.py - Database engine → Supabase Postgres: connects
- Record model → Database engine: uses Base
api/app/shared/models/record.py - ARQ Redis pool → Redis: connects
- ARQ worker → Record processing job: registers job
worker/app/worker.py - ARQ worker → Worker settings: loads settings
worker/app/worker.py - ARQ worker → Redis: consumes queued jobs
- Record processing job → Record model: loads shared model
worker/app/jobs/process_record.py - Record processing job → Database engine: reads and updates
worker/app/jobs/process_record.py - Record processing job → Supabase Postgres: updates record status