Deterministic Insights API - FastAPI for customers, interactions, AI insights & dashboard.
95
Customer Success Insights · FastAPI image for Deterministic Insights.
Provides JWT auth, customer/interaction APIs, AI insight generation (Redis lock), and dashboard aggregates. Requires PostgreSQL and Redis.
Use this image for: the FastAPI API process (:8000). Pair it with Postgres, Redis, and the frontend UI image (or Vercel).
Frontend image: https://hub.docker.com/r/prayags007/deterministic-insights-frontend
Endpoints: Swagger /api/v1/docs · Health /health
docker run)Postgres and Redis must be reachable (Compose, cloud, or local). Replace the placeholders below with your own values.
docker pull prayags007/deterministic-insights-backend:latest
docker run -d --name csip-backend -p 8000:8000 \
-e APP_ENV=production \
-e DATABASE_URL=postgresql+asyncpg://USER:PASSWORD@HOST:5432/DB_NAME \
-e REDIS_URL=redis://HOST:6379/0 \
-e JWT_SECRET_KEY=YOUR_LONG_RANDOM_SECRET \
-e CORS_ORIGINS=https://your-frontend.example \
-e AI_MOCK_MODE=true \
-e [email protected] \
-e ADMIN_PASSWORD=YOUR_ADMIN_PASSWORD \
-e ADMIN_NAME="System Admin" \
prayags007/deterministic-insights-backend:latest
Then migrate and seed (one-off):
docker exec -it csip-backend python -m alembic upgrade head
docker exec -it csip-backend python -m app.db.seed
Open: http://localhost:8000/api/v1/docs
| Variable | Required | Notes |
|---|---|---|
DATABASE_URL | Yes | postgresql+asyncpg://… |
REDIS_URL | Yes | e.g. redis://host:6379/0 |
JWT_SECRET_KEY | Yes | Strong random secret in production |
CORS_ORIGINS | Yes | Comma-separated frontend origins |
ADMIN_EMAIL / ADMIN_PASSWORD / ADMIN_NAME | For seed | Bootstrap admin (seed does not update password if user exists) |
AI_MOCK_MODE | No | true = mock insights (default for demos); false needs GROQ_API_KEY |
GROQ_API_KEY | If live AI | Required when AI_MOCK_MODE=false |
APP_ENV=production
DATABASE_URL=postgresql+asyncpg://USER:PASSWORD@db-host:5432/deterministic_insights
REDIS_URL=redis://redis-host:6379/0
JWT_SECRET_KEY=replace-with-long-random-secret
CORS_ORIGINS=https://deterministic-insights-frontend.vercel.app,http://localhost:3000
AI_MOCK_MODE=true
[email protected]
ADMIN_PASSWORD=replace-me
ADMIN_NAME=System Admin
Prefer Docker Compose for local stacks (Postgres + Redis + this image). Example env templates live in the GitHub repo (.env.example).
Setup, architecture, RBAC, Redis locks, testing, and troubleshooting:
https://github.com/Prayag-Sheth/deterministic_insights_backend/blob/main/README.md
Companion UI (GitHub): https://github.com/Prayag-Sheth/deterministic_insights_frontend
Frontend image: https://hub.docker.com/r/prayags007/deterministic-insights-frontend
Live API docs: https://deterministicinsightsbackend-production.up.railway.app/api/v1/docs
Content type
Image
Digest
sha256:8248f4d3e…
Size
102.2 MB
Last updated
2 months ago
docker pull prayags007/deterministic-insights-backend