Skip to content

About

AI-powered enterprise data intelligence dashboard — natural language queries are translated to SQL by a server-proxied Gemini 2.0 Flash agent with function calling, executed against a SQLite warehouse, and rendered as interactive Recharts visualizations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DataIntel ⚡

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.

TypeScript React Gemini SQLite


Features

  • 📊 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 SELECT statements are permitted; write operations are blocked at the server
  • ✨ Smooth UI — animated page transitions via motion/react, monochrome editorial design

How the AI Agent Works

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

Tech Stack

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

Getting Started

Prerequisites

Installation

git clone https://github.com/your-username/dataintel.git
cd dataintel
npm install

Configure

cp .env.example .env
# Add your Gemini API key to .env

Run

npm run dev

Open http://localhost:3000.


Notes

  • 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 in server.ts.
  • The /api/query endpoint enforces SELECT-only queries — INSERT, UPDATE, DELETE, DROP and other write operations are rejected.

Project Structure

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

About

AI-powered enterprise data intelligence dashboard — natural language queries are translated to SQL by a server-proxied Gemini 2.0 Flash agent with function calling, executed against a SQLite warehouse, and rendered as interactive Recharts visualizations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages