InsightOS is an AI-powered analytics platform that lets users:
- Sign in before accessing protected workflows.
- Upload SQL schemas and initialize temporary SQLite databases.
- Enforce strict per-user ownership over uploaded databases.
- Ask questions in natural language and generate SQL.
- Run safe read-only queries.
- Generate CFO-style financial summaries.
- Run long-running upload and CFO tasks as background jobs with polling status.
- Draft a warehouse schema from business context.
The project is split into:
frontend/: Next.js app (UI, charts, flows).backend/: FastAPI service (auth session flow, NL to SQL, query execution, CFO and warehouse engines).
insight-os/
backend/
main.py
requirements.txt
services/
frontend/
app/
components/
convex/
docs/
run-project.md
testing-and-ci.md
deploy-vercel-single-instance.md
- Install backend dependencies.
- Install frontend dependencies.
- Optionally configure frontend environment variables.
- Start backend on port
8000. - Start frontend on port
3000. - Open the sign-in page, create a local session, then upload the sample SQL file from
http://localhost:3000/sample_ecommerce.sql.
Detailed instructions are in:
docs/run-project.mddocs/testing-and-ci.md
For deploying both frontend and backend under a single Vercel project/domain, see:
docs/deploy-vercel-single-instance.md
GET /healthGET /auth/mePOST /auth/sign-inGET /jobsGET /jobs/{job_id}POST /preview-sqlPOST /upload-sqlPOST /jobs/upload-sqlPOST /generate-sqlPOST /queryPOST /query-planPOST /cfo-reportPOST /jobs/cfo-reportPOST /create-warehouse
- Backend persists auth sessions and background job metadata to local JSON files for single-instance deployments.
- Uploaded SQL dumps are converted into temporary SQLite databases stored under
backend/temp_dbs. - Database ownership is enforced per signed-in user via backend ownership metadata.
- Background jobs are suitable for local development, demos, and single-instance deployments, but not durable enough for distributed workers or serverless scale-out.
- Backend currently uses mocked AI logic for NL to SQL, CFO insights, and warehouse design.
- Frontend defaults to
http://localhost:8000in development and same-origin/apiin production, while auth state and API base override are stored in browser localStorage. - Frontend Convex integration is optional; the provider is enabled only when
NEXT_PUBLIC_CONVEX_URLis configured. - For production on a single Vercel domain, use same-origin API calls and rewrites as described in the deployment guide, but review the serverless caveats before relying on local-disk sessions, jobs, or temporary database files.