Skip to content

Latest commit

 

History

History
249 lines (176 loc) · 8.04 KB

File metadata and controls

249 lines (176 loc) · 8.04 KB
AnalystGPT

AnalystGPT Enterprise 🤖

AI-Powered Data Analysis SaaS — Upload. Ask. Visualize. Predict. Export.

Next.js FastAPI Python TypeScript Streamlit License

Stars Last Commit Repo Size

View Demo · Report Bug · Request Feature


📌 What is AnalystGPT?

AnalystGPT Enterprise is a production-ready, full-stack AI SaaS platform that turns raw tabular data into actionable insights — no SQL, no code required.

Upload any dataset → ask questions in plain English (or by voice) → get charts, predictions, cleaning reports, and PDF exports instantly.

Built with a Next.js frontend + FastAPI backend, with a lightweight Streamlit demo also included.


✨ Features

Feature Description
🎙️ Voice-to-Query Ask questions about your data using your voice via Web Speech API
📊 Smart Charts Auto-generates histograms, boxplots, bar charts, heatmaps from prompts
🤖 AI Q&A Natural language answers powered by OpenAI-compatible endpoints
🧹 Dataset Cleaning Remove duplicates, fill/drop missing values, export cleaned CSV
🔮 ML Predictions Baseline ML model predictions on uploaded datasets
📋 Dataset Comparison Side-by-side comparison of two datasets
📄 PDF Export Download full analysis reports as PDF
📌 Pinned Dashboard Save and revisit your favourite charts and insights
🔐 Full Auth System Google OAuth + GitHub + Email login via NextAuth + JWT sessions
🌗 Dark / Light Theme Persistent theme engine with smooth toggle

🖼️ Screenshots

Login Screen

AnalystGPT Login

FastAPI Backend Docs

FastAPI Backend

💡 More screenshots coming soon — dashboard, chart generation, voice input


🏗️ Architecture

AnalystGPT/
├── streamlit_app.py          # Streamlit demo entrypoint (quick cloud deploy)
├── requirements.txt          # Streamlit Cloud requirements
├── backend/
│   ├── app/
│   │   ├── main.py           # FastAPI routes & API endpoints
│   │   ├── analysis.py       # File parsing, profiling, charts, ML helpers
│   │   ├── config.py         # Environment-driven production config
│   │   └── reports.py        # PDF report generation
│   └── tests/                # Backend test suite
└── frontend/
    ├── app/                  # Next.js App Router pages
    └── app/components/       # UI components (charts, dashboard, auth)

🛠️ Tech Stack

Layer Technologies
Frontend Next.js 16, React 19, TypeScript, Tailwind CSS, NextAuth
Backend FastAPI, SQLAlchemy, Pandas, Scikit-learn, Matplotlib, Seaborn
Auth NextAuth (Google OAuth + GitHub + Email), JWT sessions
AI / Voice OpenAI-compatible API, Web Speech API
Reports jsPDF, ReportLab
Demo App Streamlit
Storage SQLite (default) · configurable via DATABASE_URL

🚀 Local Setup

1. Clone the repo

git clone https://github.com/Shrishti1701/AnalystGPT.git
cd AnalystGPT

2. Backend (FastAPI)

cd backend
cp .env.example .env        # Fill in your environment variables
pip install -r requirements.txt
uvicorn app.main:app --reload

Backend runs at → http://127.0.0.1:8000 API docs at → http://127.0.0.1:8000/docs

3. Frontend (Next.js)

cd frontend
cp .env.local.example .env.local    # Fill in your environment variables
npm install
npm run dev

Frontend runs at → http://localhost:3000

4. Streamlit Demo (Quick Start)

pip install -r requirements.txt
streamlit run streamlit_app.py

⚙️ Environment Variables

Backend .env

Variable Purpose
DATABASE_URL Database connection string
FRONTEND_ORIGINS Comma-separated allowed frontend origins
PUBLIC_API_BASE_URL Public backend URL for generated assets
UPLOAD_DIR Uploaded dataset folder
CHART_DIR Generated chart folder
REPORT_DIR Generated report folder
MAX_SIZE_MB Upload size limit
JWT_SECRET Backend auth secret
OPENAI_API_KEY / OPENROUTER_API_KEY Optional — AI-powered Q&A
ANALYSTGPT_MODEL Model name for dataset Q&A

Frontend .env.local

Variable Purpose
NEXT_PUBLIC_API_BASE_URL Browser-visible backend URL
NEXTAUTH_URL Frontend URL
NEXTAUTH_SECRET NextAuth secret
GOOGLE_CLIENT_ID / GITHUB_ID etc. OAuth provider credentials

☁️ Deployment

Streamlit Cloud (Quick Demo)

  1. Go to streamlit.io/cloud → New app
  2. Set these:
    • Repository: Shrishti1701/AnalystGPT
    • Branch: main
    • Main file path: streamlit_app.py
  3. Deploy ✅

Full-Stack (Production)

Part Recommended Hosts
Frontend (/frontend) Vercel, Netlify
Backend (/backend) Render, Railway, Fly.io
Database PostgreSQL (Supabase / Neon)

Set NEXT_PUBLIC_API_BASE_URL, PUBLIC_API_BASE_URL, and FRONTEND_ORIGINS to your deployed URLs.


✅ Production Checklist

  • Use strong JWT_SECRET and NEXTAUTH_SECRET
  • Set FRONTEND_ORIGINS to exact deployed frontend URL
  • Use managed Postgres for multi-user production
  • Keep .env, uploaded files, charts, reports out of Git
  • Run npm run build and pytest before deploying

🧪 Running Tests

# Backend tests
cd backend
pytest

# Frontend lint + build check
cd frontend
npm run lint
npm run build

📊 Supported File Formats

CSV · TSV · Excel (.xlsx) · JSON · JSONL · Parquet


🗺️ Roadmap

  • Deploy live demo on Streamlit Cloud
  • Add LangChain / RAG for deeper dataset Q&A
  • Multi-user workspace support
  • Real-time collaboration on dashboards
  • Export to Google Sheets

👩‍💻 Author

Shrishti Banshiar AI Tools Developer · GSoC 2025 Contributor @ IIT Madras

LinkedIn GitHub Gmail


If you find this project useful, please star the repo — it helps a lot!

Built with ❤️ by Shrishti Banshiar