feat: overhaul with modular API, agent endpoints, migrations, backup and tests

- Split monolithic app.py into server/api/ routers
- Add Pydantic schemas for input validation
- Add /agent/* API with separate AGENT_TOKEN auth
- Replace static schema.sql with versioned migrations (datenerhaltend)
- Add tools/backup_db.py for SQLite backups
- Add Dockerfile HEALTHCHECK and compose.yml AGENT_TOKEN env
- Add pytest tests for user and agent API
- Update README with API docs and deployment safety notes
- Bump version to 1.2.0
This commit is contained in:
Frank Schwenk
2026-09-21 12:46:44 +02:00
parent 7cec3030c1
commit 88bdf6f34b
31 changed files with 942 additions and 184 deletions
+3 -4
View File
@@ -1,6 +1,5 @@
from __future__ import annotations
import asyncio
import logging
from datetime import datetime, timedelta
@@ -10,11 +9,11 @@ from apscheduler.triggers.cron import CronTrigger
from apscheduler.triggers.date import DateTrigger
from server.ai import generate_daily_motivation, generate_roast_of_the_day
from server.config_loader import load_meds_config, slot_to_dict, today_str
from server.db import get_db, utc_now_iso
from server.config_loader import load_meds_config, today_str
from server.db import get_db
from server.messages import pick
from server.push import send_slot_reminder
from server.slots import build_today, get_log_for_day, mark_missed_for_overdue
from server.slots import get_log_for_day, mark_missed_for_overdue
logger = logging.getLogger(__name__)
scheduler = AsyncIOScheduler()