Lokale Entwicklung
Anleitung zum lokalen Einrichten von Vartovii.
📋 Voraussetzungen
- Python 3.13+
- Node.js 18+
- PostgreSQL 17+
- Google Cloud SDK
- Redis (optional, für Caching)
🚀 Schnellstart
Backend
cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Server starten
uvicorn main:app --reload --port 8000
Frontend
cd dashboard_app
npm install
npm run dev
Scraping-Dienst
cd backend
source venv/bin/activate
python scraping_service.py
🔧 Umgebungseinrichtung
Erstellen Sie die Datei .env in /backend:
# Datenbank
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
# KI
AI_LOCATION=europe-west4
AGENT_API_KEY=your-api-key
# Forensic Agent (BigQuery)
BIGQUERY_PROJECT=bigquery-public-data
BIGQUERY_DATASET=crypto_ethereum
🔐 Google Cloud Authentifizierung
Für die lokale Entwicklung verwenden Sie Application Default Credentials (ADC):
# Melden Sie sich mit Ihrem Google-Konto an
gcloud auth application-default login
Empfohlener Ansatz ADC ist die empfohlene Authentifizierungsmethode. Das
Backend verwendet diese Anmeldeinformationen automatisch, wenn
GOOGLE_APPLICATION_CREDENTIALS nicht gesetzt ist. :::
Authentifizierungspriorität:
GOOGLE_APPLICATION_CREDENTIALSUmgebungsvariable (Dienstkontoschlüssel)- Application Default Credentials (von
gcloud auth)
Wenn Sie Probleme mit einem Dienstkontoschlüssel (401-Fehler) haben,
kommentieren Sie einfach GOOGLE_APPLICATION_CREDENTIALS in Ihrer .env-Datei
aus und verlassen Sie sich auf ADC.
📊 Datenbank
Neuinstallation
cd backend
alembic upgrade head
Seed-Daten
python scripts/seed_data.py
🌐 URLs
| Dienst | URL |
|---|---|
| Backend-API | http://localhost:8000 |
| API-Dokumentation | http://localhost:8000/docs |
| Frontend | http://localhost:5173 |
| Wissensdatenbank | http://localhost:3000 |
🛠️ Nützliche Befehle
# Tests ausführen
pytest tests/
# Code formatieren
black .
# Lint
flake8 .
# Typenprüfung
mypy .
Verwenden Sie scripts/startup.sh für den automatisierten Start.