Zum Hauptinhalt springen

Lokale Entwicklung

Anleitung zur lokalen Einrichtung von Sentry Analytics.

📋 Voraussetzungen

  • Python 3.11+
  • Node.js 18+
  • PostgreSQL 14+
  • Google Cloud SDK

🚀 Schnellstart

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-Dienst

cd backend
source venv/bin/activate
python scraping_service.py

🔧 Umgebungseinrichtung

Erstellen Sie die .env-Datei 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-Authentifizierung

Für die lokale Entwicklung:

gcloud auth application-default login

📊 Datenbank

Neuinstallation

cd backend
alembic upgrade head

Initialdaten

python scripts/seed_data.py

🌐 URLs

DienstURL
Backend APIhttp://localhost:8000
API Docshttp://localhost:8000/docs
Frontendhttp://localhost:5173
Wissensdatenbankhttp://localhost:3000

🛠️ Nützliche Befehle

# Tests ausführen
pytest tests/

# Code formatieren
black .

# Linting
flake8 .

# Typenprüfung
mypy .

Verwenden Sie scripts/startup.sh für den automatisierten Start.