Local Development
Guide for setting up Sentry Analytics locally.
📋 Prerequisites
- Python 3.11+
- Node.js 18+
- PostgreSQL 14+
- Google Cloud SDK
🚀 Quick Start
Backend
cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Start server
uvicorn main:app --reload --port 8000
Frontend
cd dashboard_app
npm install
npm run dev
Scraping Service
cd backend
source venv/bin/activate
python scraping_service.py
🔧 Environment Setup
Create .env file in /backend:
# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/vartovii
# Google Cloud
GOOGLE_CLOUD_PROJECT=sentry-analytics-prod
GOOGLE_APPLICATION_CREDENTIALS=./keys/service-account.json
# AI
AI_LOCATION=europe-west4
AGENT_API_KEY=your-api-key
🔐 Google Cloud Auth
For local development:
gcloud auth application-default login
📊 Database
Fresh Setup
cd backend
alembic upgrade head
Seed Data
python scripts/seed_data.py
🌐 URLs
| Service | URL |
|---|---|
| Backend API | http://localhost:8000 |
| API Docs | http://localhost:8000/docs |
| Frontend | http://localhost:5173 |
| Knowledge Base | http://localhost:3000 |
🛠️ Useful Commands
# Run tests
pytest tests/
# Format code
black .
# Lint
flake8 .
# Type check
mypy .
Use scripts/startup.sh for automated startup.