Skip to main content

Local Development

Guide for setting up Vartovii locally.

📋 Prerequisites

  • Python 3.13+
  • Node.js 18+
  • PostgreSQL 17+
  • Google Cloud SDK
  • Redis (optional, for caching)

🚀 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

# Redis (optional)
REDIS_URL=redis://localhost:6379

# 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

# Forensic Agent (BigQuery)
BIGQUERY_PROJECT=bigquery-public-data
BIGQUERY_DATASET=crypto_ethereum

🔐 Google Cloud Auth

For local development, use Application Default Credentials (ADC):

# Login with your Google account
gcloud auth application-default login
Recommended Approach

ADC is the recommended authentication method. The backend will automatically use these credentials if GOOGLE_APPLICATION_CREDENTIALS is not set.

Authentication Priority:

  1. GOOGLE_APPLICATION_CREDENTIALS environment variable (Service Account key)
  2. Application Default Credentials (from gcloud auth)

If you have issues with a Service Account key (401 errors), simply comment out GOOGLE_APPLICATION_CREDENTIALS in your .env file and rely on ADC.

📊 Database

Fresh Setup

cd backend
alembic upgrade head

Seed Data

python scripts/seed_data.py

🌐 URLs

ServiceURL
Backend APIhttp://localhost:8000
API Docshttp://localhost:8000/docs
Frontendhttp://localhost:5173
Knowledge Basehttp://localhost:3000

🛠️ Useful Commands

# Run tests
pytest tests/

# Format code
black .

# Lint
flake8 .

# Type check
mypy .

Use scripts/startup.sh for automated startup.