An AI-powered enterprise data intelligence dashboard built with React, Express, and Google Gemini. Ask questions about your data in plain English — the AI agent writes and executes the SQL, then interprets the results for you.
- 📊 Live dashboard — real-time charts for department budgets, workforce distribution, and sales pipeline powered by Recharts
- 🤖 AI data agent — ask questions in natural language; Gemini uses function-calling to write and run SQL, then explains the results
- 🔒 API key server-side only — Gemini calls are proxied through Express, never exposed to the browser
- 🛡️ SQL guard — only
SELECTstatements are permitted; write operations are blocked at the server - ✨ Smooth UI — animated page transitions via
motion/react, monochrome editorial design
User types a question in chat
↓
POST /api/chat → Express server
↓
Gemini decides if it needs data → calls query_database tool
↓
Server executes SELECT query against SQLite (validated)
↓
Tool results sent back to Gemini
↓
Gemini interprets results and responds in Markdown
↓
Response streamed back to the chat UI
| Layer | Technology |
|---|---|
| Frontend | React 19, TypeScript, Tailwind CSS v4 |
| Charts | Recharts |
| Animations | motion/react |
| Backend | Express 4, Node.js |
| Database | better-sqlite3 (in-memory) |
| AI | Google Gemini 2.0 Flash with function calling |
| Build | Vite 6 |
- Node.js 18+
- A Google Gemini API key
git clone https://github.com/your-username/dataintel.git
cd dataintel
npm installcp .env.example .env
# Add your Gemini API key to .envnpm run devOpen http://localhost:3000.
- The SQLite database is in-memory — it is seeded with demo data on startup and resets on every server restart. To use persistent data, swap
":memory:"for a file path inserver.ts. - The
/api/queryendpoint enforces SELECT-only queries — INSERT, UPDATE, DELETE, DROP and other write operations are rejected.
dataintel/
├── server.ts # Express server, SQLite, Gemini agent (all server-side)
├── src/
│ ├── App.tsx # Root component, tab routing
│ ├── lib/
│ │ └── gemini.ts # Thin fetch wrapper for /api/chat
│ ├── components/
│ │ ├── DataDashboard.tsx # Charts and sales table
│ │ ├── ChatInterface.tsx # AI agent chat UI
│ │ └── Sidebar.tsx # Navigation + security status
│ ├── types.ts # Shared TypeScript interfaces
│ └── index.css # Tailwind base styles
├── vite.config.ts
└── package.json