AI-powered data analysis platform using Claude and Modal sandboxes.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Next.js │────▶│ FastAPI │────▶│ Modal │
│ Frontend │ │ Backend │ │ Sandbox │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Claude API │ │ Modal Volume │
└─────────────────┘ │ (Shared) │
└─────────────────┘
- Python 3.11+
- Node.js 18+
- Modal account (https://modal.com)
- Anthropic API key
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windows
# Install dependencies
pip install -r requirements.txt
# Set environment variables
export ANTHROPIC_API_KEY=your-api-key
export MODAL_TOKEN_ID=your-modal-token-id
export MODAL_TOKEN_SECRET=your-modal-token-secret
# Deploy Modal app (first time only)
modal deploy modal_sandbox.py
# Start the backend
uvicorn main:app --reloadcd frontend
# Install dependencies
npm install
# Start development server
npm run dev- Open http://localhost:3000
- Upload a CSV file using the drag-drop zone
- Ask questions about your data:
- "What's in this file?"
- "Show me summary statistics"
- "Create a histogram of [column]"
- "What correlations exist between columns?"
- Secure Execution: Code runs in Modal sandboxes with no network access
- Data Analysis: pandas, numpy, matplotlib, seaborn pre-installed
- Streaming Responses: Real-time streaming from Claude
- Visualization: Matplotlib plots displayed inline
- 60-second execution timeout
- Network disabled in sandboxes
- Path validation prevents directory traversal
- 10MB file upload limit
- CSV, JSON, TXT files only
- 24-hour session expiry
POST /api/sessions- Create new sessionPOST /api/sessions/{id}/upload- Upload filePOST /api/sessions/{id}/chat- Chat with Claude (SSE)GET /api/sessions/{id}/files- List filesGET /api/sessions/{id}/files/{name}- Download file