A modern web application for AI-powered data analysis using CSV files and natural language queries.
- CSV Upload & Analysis: Upload CSV files and ask questions in natural language
- AI-Powered Insights: Uses Google Gemini API for SQL generation and data insights
- Modern UI: Built with React, TypeScript, and Tailwind CSS
- Real-time Processing: Fast in-memory data processing with SQLite
- Node.js (v16 or higher)
- Python (v3.8 or higher)
- npm or yarn
-
Clone the repository
git clone <YOUR_GIT_URL> cd polaris-data-whisperer-main
-
Install frontend dependencies
npm install
-
Install Python backend dependencies
pip install -r requirements.txt
npm run dev:pythonBackend (Python FastAPI)
# Using npm script
npm run backend
# Or directly
python app.py
# Or using the provided scripts
./run-backend.bat # Windows
./run-backend.ps1 # PowerShellFrontend (React/Vite)
npm run dev- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- Upload a CSV file by dragging and dropping or clicking the upload area
- Ask a question about your data in natural language (e.g., "What is the average sales by region?")
- View results including:
- AI-generated insights
- Generated SQL query
- Query results in a table format
- React 18
- TypeScript
- Vite
- Tailwind CSS
- shadcn/ui components
- React Router
- FastAPI (Python)
- Pandas for data processing
- SQLite for in-memory database
- Google Gemini API for AI analysis
POST /analyze- Upload CSV and analyze with a question- Parameters:
file(CSV file),question(string) - Returns: Analysis results with insights, SQL query, and data
- Parameters:
src/
├── components/ # React components
├── pages/ # Page components
├── lib/ # API services and utilities
└── ui/ # shadcn/ui components
npm run dev- Start frontend development servernpm run backend- Start Python FastAPI backendnpm run dev:python- Start both frontend and backendnpm run build- Build for productionnpm run lint- Run ESLint
The backend uses a Google Gemini API key. Make sure to set up your API key in the app.py file or use environment variables for production.
The frontend can be deployed to any static hosting service (Vercel, Netlify, etc.)
The FastAPI backend can be deployed to:
- Heroku
- Railway
- DigitalOcean App Platform
- AWS/GCP/Azure
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.