85 lines
2.6 KiB
Markdown
85 lines
2.6 KiB
Markdown
<!-- status: canonical -->
|
|
<!-- lastReviewed: 2026-04-05 -->
|
|
|
|
# Dev-Setup
|
|
|
|
## Voraussetzungen
|
|
|
|
- **Python 3.11** (CI-Standard; Minimum 3.10)
|
|
- **Node.js** (aktuelles LTS empfohlen)
|
|
- **PostgreSQL** mit **pgvector**-Extension
|
|
- **Conda** oder **venv** fuer Python-Umgebung
|
|
|
|
## Gateway starten
|
|
|
|
```bash
|
|
cd gateway/
|
|
# Python-Umgebung aktivieren (Conda oder venv)
|
|
conda activate <env>
|
|
# oder: python -m venv .venv && .\.venv\Scripts\Activate.ps1
|
|
|
|
pip install -r requirements.txt
|
|
|
|
# Config vorbereiten:
|
|
# 1. config.ini muss im gateway/ Verzeichnis liegen (statische Settings)
|
|
# 2. .env Datei aus env_dev.env kopieren/symlinken:
|
|
# copy env_dev.env .env
|
|
# 3. APP_KEY_SYSVAR in config.ini zeigt auf Master-Key (OS-Variable oder Dateipfad)
|
|
|
|
uvicorn app:app --host 0.0.0.0 --port 8000
|
|
```
|
|
|
|
### Konfigurationsdateien
|
|
|
|
| Datei | Zweck |
|
|
|-------|-------|
|
|
| `gateway/config.ini` | Statische Settings (Auth-Defaults, Upload-Limits, Operator-Text) |
|
|
| `gateway/.env` | Runtime-Env (DB, API-Keys, Secrets) -- wird aus `env_dev.env` kopiert |
|
|
| `gateway/env_dev.env` | Dev-Umgebung Template (verschluesselte Secrets mit `DEV_ENC:` Prefix) |
|
|
| `gateway/env_int.env` | Integration-Umgebung |
|
|
| `gateway/env_prod.env` | Produktion |
|
|
|
|
### Wichtige Env-Variablen (Auszug)
|
|
|
|
| Variable | Beschreibung |
|
|
|----------|-------------|
|
|
| `DB_HOST`, `DB_USER`, `DB_PASSWORD_SECRET` | PostgreSQL-Verbindung |
|
|
| `APP_KEY_SYSVAR` | Master-Key fuer Secrets-Entschluesselung |
|
|
| `APP_API_URL` | API-URL (bestimmt Cookie-Secure-Flag) |
|
|
| `APP_ALLOWED_ORIGINS` | CORS Origins (inkl. `http://localhost:5176`) |
|
|
| `Service_GOOGLE_AUTH_*` | Google OAuth Auth-App |
|
|
| `Service_GOOGLE_DATA_*` | Google OAuth Data-App |
|
|
|
|
## Frontend Nyla starten
|
|
|
|
```bash
|
|
cd frontend_nyla/
|
|
npm install
|
|
npm run dev
|
|
# oder: npx vite --port 5176 --mode dev
|
|
```
|
|
|
|
Frontend laeuft auf **http://localhost:5176** und erwartet Gateway auf **http://localhost:8000**.
|
|
|
|
### Frontend-Konfiguration
|
|
|
|
| Datei | Zweck |
|
|
|-------|-------|
|
|
| `frontend_nyla/config/.env.dev` | Dev-Mode Env (VITE_API_BASE_URL etc.) |
|
|
| `frontend_nyla/config/.env.int` | Integration |
|
|
| `frontend_nyla/config/.env.prod` | Produktion |
|
|
|
|
## Secrets-Verwaltung
|
|
|
|
Env-Dateien enthalten verschluesselte Werte (`DEV_ENC:`, `INT_ENC:`, `PROD_ENC:`).
|
|
Zur Entschluesselung wird der Master-Key ueber `APP_KEY_SYSVAR` geladen.
|
|
|
|
Details: -> `d-guides/encrypt-env-secrets.md`
|
|
|
|
## Weiterführende Guides
|
|
|
|
- Secrets verschluesseln: `d-guides/encrypt-env-secrets.md`
|
|
- Google OAuth einrichten: `d-guides/google-oauth-setup.md`
|
|
- Cookie/JWT-Migration: `d-guides/security-migration-guide.md`
|
|
- Coding-Konventionen: `d-guides/coding-conventions.md`
|
|
- Testing: `d-guides/testing-strategy.md`
|