docs: update README and Copilot instructions for new DB init workflow

Replace placeholder clone URL with actual repo URL:
https://github.com/RobbStarkAustria/infoscreen_2025.git
Add first-run step to initialize the database using the one-shot script:
python server/initialize_database.py
Mention initialize_database.py in project structure
Add a one-shot DB init command to the “Database Management” section
Update Copilot instructions:
Prefer initialize_database.py for local dev (migrations + defaults + academic periods)
Note legacy init scripts were removed; use Alembic + initialize_database.py going forward
No runtime/code changes; documentation only
This commit is contained in:
RobbStarkAustria
2025-10-11 07:01:19 +00:00
parent 4a97ad4f1d
commit 0601bac243
3 changed files with 16 additions and 77 deletions

View File

@@ -72,8 +72,9 @@ Note: Syncfusion usage in the dashboard is already documented above; if a UI for
- Dashboard (dev): `dashboard/Dockerfile.dev` exposes :5173 and waits for API via `dashboard/wait-for-backend.sh`.
- Mosquitto: allows anonymous in dev; WebSocket on :9001.
- Common env vars: `DB_CONN`, `DB_USER`, `DB_PASSWORD`, `DB_HOST=db`, `DB_NAME`, `ENV`, `MQTT_USER`, `MQTT_PASSWORD`.
- Alembic: prod compose runs `alembic ... upgrade head` and `server/init_defaults.py` before gunicorn.
- Use `server/init_academic_periods.py` to populate default Austrian school years after migration.
- Alembic: prod compose runs `alembic ... upgrade head` and `server/init_defaults.py` before gunicorn.
- Local dev: prefer `python server/initialize_database.py` for one-shot setup (migrations + defaults + academic periods).
- `server/init_academic_periods.py` remains available to (re)seed school years.
## Production
- `docker-compose.prod.yml` uses prebuilt images (`ghcr.io/robbstarkaustria/*`).
@@ -100,6 +101,7 @@ Note: Syncfusion usage in the dashboard is already documented above; if a UI for
4) Return JSON-safe values (serialize enums and datetimes).
- When extending media types, update `MediaType` and any logic in `eventmedia` and dashboard that depends on it.
- Academic periods: Events/media can be optionally associated with periods for educational organization. Only one period should be active at a time (`is_active=True`).
- Initialization scripts: legacy DB init scripts were removed; use Alembic and `initialize_database.py` going forward.
## Quick examples
- Add client description persists to DB and publishes group via MQTT: see `PUT /api/clients/<uuid>/description` in `routes/clients.py`.