Initial commit
This commit is contained in:
93
00_Globale_Richtlinien/README.md
Normal file
93
00_Globale_Richtlinien/README.md
Normal file
@@ -0,0 +1,93 @@
|
||||
# 00_Globale_Richtlinien – Gesamtüberblick
|
||||
|
||||
Dieses Verzeichnis bündelt globale Planungsdokumente und einen entworfenen Code-Grundstock, auf dem spätere Komponenten aufbauen.
|
||||
|
||||
## Struktur
|
||||
|
||||
```plaintext
|
||||
00_Globale_Richtlinien/
|
||||
├── Planung/
|
||||
│ ├── Komponenten_Standardstruktur.md
|
||||
│ ├── Code_Style.md
|
||||
│ └── Namenskonventionen.md
|
||||
└── Entworfener_Code/
|
||||
├── requirements.txt
|
||||
├── Dockerfile
|
||||
├── docker-compose.yml
|
||||
├── app/
|
||||
│ ├── start.py
|
||||
│ ├── config/
|
||||
│ │ ├── config.yaml
|
||||
│ │ └── logging.yaml
|
||||
│ └── code/
|
||||
│ ├── app/
|
||||
│ │ ├── __init__.py
|
||||
│ │ └── main.py
|
||||
│ ├── api/
|
||||
│ │ ├── __init__.py
|
||||
│ │ ├── router.py
|
||||
│ │ └── routes/
|
||||
│ │ ├── __init__.py
|
||||
│ │ └── execute.py
|
||||
│ ├── core/
|
||||
│ │ └── base_component.py
|
||||
│ ├── src/
|
||||
│ │ ├── api.py
|
||||
│ │ ├── config.py
|
||||
│ │ ├── logger.py
|
||||
│ │ └── worker.py
|
||||
│ └── tests/
|
||||
│ └── test_smoke.py
|
||||
```
|
||||
|
||||
Hinweise:
|
||||
- Planung enthält verbindliche Vorgaben zu Struktur, Namens-/Code-Stil und Laufzeitarchitektur.
|
||||
- Entworfener_Code liefert ein minimales, startfähiges API-Gerüst mit FastAPI, Logging und Tests.
|
||||
|
||||
## Kernfunktionen des Entworfenen Codes
|
||||
|
||||
- Startskript: app/start.py startet den Server, lädt YAML-Konfiguration und Logging.
|
||||
- FastAPI-App: app/code/app/main.py erzeugt die App, bindet Router und Health-Check.
|
||||
- Beispiel-API: app/code/api/router.py und app/code/api/routes/execute.py registrieren /api/execute.
|
||||
- Minimal-API (Gerüst) unter app/code/src/api.py mit:
|
||||
- POST /start: löst eine nicht-blockierende Start-Routine aus (Delegation an app/code/src/worker.py).
|
||||
- GET /health: einfacher Health-Check.
|
||||
- POST /restart und POST /reload: planen (Gerüst) einen Neustart des Prozesses.
|
||||
- Logging: app/config/logging.yaml (rotierende Logs) und Zugriff über app/code/src/logger.py (Gerüst).
|
||||
- Tests: app/code/tests/test_smoke.py (pytest).
|
||||
|
||||
## Quickstart lokal (ohne Container)
|
||||
|
||||
Voraussetzungen: Python 3.10+ und pip.
|
||||
|
||||
```bash
|
||||
python -m venv .venv
|
||||
source .venv/bin/activate
|
||||
pip install -r 00_Globale_Richtlinien/Entworfener_Code/requirements.txt
|
||||
python 00_Globale_Richtlinien/Entworfener_Code/app/start.py --config 00_Globale_Richtlinien/Entworfener_Code/app/config/config.yaml
|
||||
```
|
||||
|
||||
Swagger: http://localhost:8000/docs
|
||||
|
||||
## Quickstart mit Docker/Compose
|
||||
|
||||
Build & Run:
|
||||
|
||||
```bash
|
||||
docker build -t entwurf-service 00_Globale_Richtlinien/Entworfener_Code
|
||||
docker run --rm -p 8000:8000 entwurf-service
|
||||
# oder:
|
||||
docker compose -f 00_Globale_Richtlinien/Entworfener_Code/docker-compose.yml up --build
|
||||
```
|
||||
|
||||
## Relevante Planungsdokumente
|
||||
|
||||
- Komponenten-Standardstruktur: 00_Globale_Richtlinien/Planung/Komponenten_Standardstruktur.md
|
||||
- Code Style: 00_Globale_Richtlinien/Planung/Code_Style.md
|
||||
- Namenskonventionen: 00_Globale_Richtlinien/Planung/Namenskonventionen.md
|
||||
|
||||
## Hinweise zur Weiterentwicklung
|
||||
|
||||
- Die konkrete Neustartstrategie (Supervisor/execv, Backoff, Auth) ist bewusst offen und wird später festgelegt.
|
||||
- Die Python-Config (app/code/src/config.py) ist die zentrale Quelle; YAML ergänzt externe Konfigurierbarkeit.
|
||||
- Altstrukturen können in Migrationsschritten bereinigt werden; maßgeblich ist die app/code-Aufteilung.
|
||||
Reference in New Issue
Block a user