DBTalkie is a futuristic Text-to-SQL assistant with a cyberpunk-inspired UI. Users connect SQL databases, ask questions in natural language, and receive results as streamed AI responses plus rich widgets (tables, charts, KPIs, and schema views).
This repository is a full-stack monorepo:
client/: React 19 + Vite + TypeScript frontendserver/: FastAPI + Python 3.12 backendscripts/: SQL scripts for local/demo data bootstrapdocker-compose.yml: local orchestration (frontend, backend, postgres, demo postgres)
- Natural language to SQL flow (mock-backed at this stage)
- Real-time assistant responses via SSE streaming
- Rich result widgets:
- Text explanation
- Table
- Bar chart
- Line chart
- KPI card
- Schema diagram
- Multi-database workspace with conversations scoped by database
- React 19
- TypeScript (strict)
- Vite
- TanStack Query
- Framer Motion
- ReactFlow
- ApexCharts
- Python 3.12+
- FastAPI
- Uvicorn
- pydantic-settings
- sse-starlette
- uv (package/dependency manager)
Create a .env file in the repository root.
Use this template and replace placeholder values with your own:
# PostgreSQL (main app DB)
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_NAME=your_db_name
DB_PORT=5432
DB_HOST=postgres
# Backend app
APP_NAME=DBTalkie API
DEBUG=True
OPENAI_API_KEY=your_openai_api_key
DATABASE_URL=postgresql+asyncpg://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}
# Demo database (used by postgres-demo service)
DEMO_DB_HOST=postgres-demo
DEMO_DB_USER=your_demo_db_user
DEMO_DB_PASSWORD=your_demo_db_password
DEMO_DB_NAME=your_demo_db_name
DEMO_DB_PORT=5433Notes:
- Do not commit real credentials or API keys.
- The backend loads variables from the root
.envfile. DB_HOST=postgresandDEMO_DB_HOST=postgres-demoare intended for Docker network usage.
From the repository root:
docker compose up --buildServices:
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- Health check: http://localhost:8000/health
- PostgreSQL: mapped from
${DB_PORT}to container5432 - Demo PostgreSQL: mapped from
${DEMO_DB_PORT}to container5432
Stop all services:
docker compose downcd server
uv sync
uv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadIn a new terminal:
cd client
npm install
npm run devFrontend runs on http://localhost:5173 by default.
GET /health: health checkGET /databases: list databasesPOST /databases: create databaseGET /databases/{id}: get databasePATCH /databases/{id}: update databaseDELETE /databases/{id}: delete databaseGET /chat/messages?databaseId=<id>: get message historyPOST /chat/stream: stream assistant response (SSE)
Add a product screenshot here:
(You can create a docs/ folder in the root and store images there.)
- Keep frontend network calls inside
client/src/services/. - Keep backend business logic in service/controller layers.
- Keep SSE event contract aligned between frontend and backend.