Query your data in natural language. Get instant tables, graphs, and insights — no SQL required.
Qurate transforms how you interact with your databases. Ask questions in plain English, Hindi, Telugu, Punjabi, or any of 12+ languages — and get instant responses as formatted text, sortable tables, or beautiful charts.
Getting Started · Features · Architecture · API Reference · Contributing
Qurate is a full-stack AI platform that bridges the gap between natural language and SQL. Built for analysts, developers, and non-technical users alike, it provides:
- Conversational Database Queries — Ask questions like "Show me top 10 customers by revenue" and get structured results
- Multi-Modal Responses — Every answer is rendered as the best-fit format: text, interactive tables, or auto-generated charts
- Cross-Language Voice Input — Speak your queries in English, Hindi, Telugu, Punjabi, Tamil, Bengali, and more
- Sandboxed Execution — Each user gets an isolated PostgreSQL database, ensuring data security and privacy
- Excel-to-Database — Upload
.xlsx/.csvfiles to instantly create queryable database tables
|
|
|
|
┌─────────────────────────────────────────────────────────────────┐
│ FRONTEND │
│ React 19 · Vite 8 · TailwindCSS 4 · Redux Toolkit · Recharts │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │
│ │ Landing │ │ Auth │ │ Pricing │ │ Dashboard │ │
│ │ Page │ │Login/Sign│ │ Page │ │ Chat + Voice │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────────┘ │
│ │ native fetch │
└──────────────────────────┼──────────────────────────────────────┘
│
┌──────▼──────┐
│ FastAPI │
│ Port 1008 │
└──────┬──────┘
│
┌─────────────────────┼──────────────────────┐
│ │ │ │
┌────▼─────┐ ┌───▼────────┐ ┌─────▼──────┐ ┌─────▼──────┐
│ Redis │ │ MongoDB │ │ PostgreSQL │ │ Gemini AI │
│ Cache │ │ Atlas │ │ Sandboxes │ │ 3.1 Pro │
│ │ │ │ │ │ │ │
│ • Tokens │ │ • Users │ │ • Per-user │ │ • SQL Gen │
│ • User │ │ • Chat Hist│ │ isolated │ │ • Security │
│ cache │ │ • Accounts │ │ databases│ │ • Formatter│
└──────────┘ └────────────┘ └────────────┘ └────────────┘
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | React 19, Vite 8, TypeScript 5.8 | SPA with component architecture |
| Styling | TailwindCSS 4, Shadcn UI | Utility-first CSS with premium components |
| Animations | Framer Motion (motion/react) | Page transitions, micro-interactions |
| Charts | Recharts | Interactive data visualization |
| State | Redux Toolkit | Auth, chat, and UI state management |
| API | Native fetch wrapper |
Auto token refresh, typed endpoints |
| Backend | Python 3.12, FastAPI | Async REST API |
| AI | Google Gemini 3.1 Pro | SQL generation, security audit, formatting |
| Auth DB | MongoDB Atlas | User accounts, chat history, sessions |
| Cache | Redis 7 | Refresh token store, user session caching |
| User DB | PostgreSQL 16 | Per-user sandboxed databases |
| Packages | pnpm (frontend), uv (backend) | Fast, disk-efficient package managers |
- Node.js ≥ 20 and pnpm (
npm i -g pnpm) - Python ≥ 3.12 and uv (
pip install uv) - PostgreSQL 16+ running locally
- Redis 7+ running locally (
redis-server) - MongoDB connection (Atlas or local)
- Google Gemini API Key
git clone https://github.com/your-username/Qurate.git
cd Quratecd backend-py
# Create virtual environment and install dependencies
uv venv
uv pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env with your actual credentials:
# MONGO_URI, GEMINI_API_KEY, POSTGRES_USER, POSTGRES_PASSWORD, etc.
# Start the server
uvicorn src.main:server --port 1008 --reloadcd frontend
# Install dependencies
pnpm install
# Start dev server
pnpm devNavigate to http://localhost:5173 — sign up, and you'll be redirected to the AI dashboard.
Qurate/
├── frontend/ # React SPA
│ ├── public/
│ │ └── favicon.svg # Brand logo (purple lightning bolt)
│ ├── src/
│ │ ├── components/
│ │ │ ├── dashboard/ # Chat, Sidebar, Voice, Excel Upload
│ │ │ ├── landing/ # Hero, MacbookScroll, Features, Stats
│ │ │ ├── ui/ # GlassCard, GradientButton, ThemeToggle
│ │ │ ├── Navbar.tsx # Responsive glassmorphic nav
│ │ │ └── ProtectedRoute.tsx
│ │ ├── lib/
│ │ │ ├── api.ts # Native fetch wrapper with auto-refresh
│ │ │ └── utils.ts # cn() helper
│ │ ├── pages/
│ │ │ ├── Landing.tsx # Hero + scroll + features + stats + CTA
│ │ │ ├── Login.tsx # Glassmorphic login form
│ │ │ ├── SignUp.tsx # Full registration form
│ │ │ ├── Pricing.tsx # 3-tier pricing cards
│ │ │ └── Dashboard.tsx # AI chat interface
│ │ ├── store/
│ │ │ ├── store.ts # Redux store config
│ │ │ ├── authSlice.ts # Login/signup/logout
│ │ │ ├── chatSlice.ts # Messages, prompt, history
│ │ │ └── uiSlice.ts # Theme, sidebar, voice language
│ │ ├── types/
│ │ │ └── speech.d.ts # Web Speech API declarations
│ │ ├── App.tsx # Routes
│ │ ├── main.tsx # Entry point + Provider
│ │ └── index.css # Design system + theme variables
│ ├── package.json
│ ├── vite.config.ts
│ └── tsconfig.app.json
│
├── backend-py/ # FastAPI server
│ ├── src/
│ │ └── main.py # Routes: login, signup, prompt, upload-excel
│ ├── agents/
│ │ └── agent.py # AI pipeline: SQL gen → audit → execute → format
│ ├── decorators/
│ │ └── auth.py # JWT authentication decorator
│ ├── models/ # Pydantic models & response helpers
│ ├── mongodb/ # MongoDB client (users, chat history)
│ ├── redisdb/ # Redis client (token store, session cache)
│ ├── postgresdb/ # PostgreSQL client (sandboxed DBs)
│ ├── utils/ # JWT, password hashing
│ ├── requirements.txt
│ └── .env
│
└── README.md
| Method | Endpoint | Description |
|---|---|---|
POST |
/sign-up |
Register a new user (creates sandbox DB) |
POST |
/login |
Authenticate and receive JWT tokens |
POST |
/refresh |
Exchange refresh token for new access token |
All require
accesstokenheader
| Method | Endpoint | Description |
|---|---|---|
POST |
/prompt2query |
Send natural language → get text/table/graph |
GET |
/chat-history |
Retrieve conversation history |
DELETE |
/chat-history |
Clear conversation history |
POST |
/upload-excel |
Upload .xlsx/.csv to create a DB table |
Every /prompt2query response includes a data field with one of three types:
// Text response
{ "type": "text", "response": "Your database has 3 tables." }
// Table response
{
"type": "table",
"response": {
"columns": ["name", "age", "city"],
"rows": [["Alice", 30, "NYC"], ["Bob", 25, "SF"]]
}
}
// Graph response
{
"type": "graph",
"response": {
"x": ["Jan", "Feb", "Mar"],
"y": [100, 150, 200],
"x_label": "Month",
"y_label": "Revenue"
}
}| Token | Value | Usage |
|---|---|---|
--q-purple |
#863bff |
Primary brand, CTAs, gradients |
--q-purple-deep |
#7e14ff |
Hover states, accents |
--q-cyan |
#47bfff |
Secondary brand, chart accents |
- Glassmorphism —
.glassand.glass-strongutility classes - Glow Effects —
.glow-purpleand.glow-cyanfor hover states - Text Gradient —
.text-gradientfor the brand purple→cyan gradient - Mesh Background —
.bg-gradient-meshfor ambient radial gradients - Shimmer Loading —
.shimmerfor skeleton loading states
The app supports dark and light modes:
- Persisted in
localStorageasqurate_theme - Toggled via the sun/moon icon in the navbar or sidebar
- CSS variables swap automatically via the
.darkclass on<html>
Qurate supports cross-language voice queries via the Web Speech API:
| Language | Code | Language | Code |
|---|---|---|---|
| English | en-US |
Hindi | hi-IN |
| Punjabi | pa-IN |
Telugu | te-IN |
| Tamil | ta-IN |
Bengali | bn-IN |
| Marathi | mr-IN |
Gujarati | gu-IN |
| Kannada | kn-IN |
Malayalam | ml-IN |
| Urdu | ur-IN |
French | fr-FR |
The language picker is accessible via the 🌐 button next to the microphone in the chat input.
- JWT Authentication — Short-lived access tokens (60 min) + long-lived refresh tokens (7 days)
- Redis Token Store — Refresh tokens are stored in Redis hashes (
refresh:{email}) with 7-day TTL; tokens can be individually invalidated without affecting other sessions - User Session Cache — Authenticated user details are cached in Redis (
user:{email}) for 30 minutes, reducing MongoDB reads on every request - Sandboxed Databases — Each user gets an isolated PostgreSQL database; cross-DB queries are impossible
- AI Security Audit — Every generated SQL query passes through a dedicated security agent before execution
- No Raw SQL Exposure — Users never see or write SQL; the AI generates and the auditor validates
The dashboard renders three distinct response types inline:
Plain conversational responses, clarifications, and status messages. Includes a 🔊 speaker button for text-to-speech playback.
Sortable, scrollable data tables with alternating row colors. Click column headers to sort ascending/descending.
Auto-generated bar charts using Recharts with brand gradient fills. The AI automatically selects the best chart type based on the data shape.
pnpm dev # Start Vite dev server (HMR)
pnpm build # TypeScript check + production build
pnpm preview # Preview production build locallyuvicorn src.main:server --port 1008 --reload # Dev with hot reload
python start.py # Production startCreate a .env file in backend-py/:
MONGO_URI="mongodb+srv://..."
GEMINI_API_KEY="your-gemini-api-key"
ACCESS_TOKEN_SECRET_KEY="your-secret"
REFRESH_TOKNE_SECRET_KEY="your-refresh-secret"
ACCESS_TOKEN_DURATION="60"
REFRESH_TOKEN_DURATION="7"
POSTGRES_PASSWORD="postgres"
POSTGRES_HOST="localhost"
POSTGRES_USER="postgres"
PORT=1008Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License — see the LICENSE file for details.
Built with 💜 by Akshit Jain
Powered by Gemini AI · React · FastAPI · PostgreSQL · MongoDB