mirror of
https://github.com/corazoncp/zoom-sched-poc.git
synced 2026-12-01 04:50:31 +00:00
- README.md: document gated zoom_start_url, payment_processing guard, 64 KiB cap, single-worker Docker note, and doc links - ARCHITECTURE.md: document component responsibilities, SQLite appointment state machine, and trust boundaries - docs/adr/0001-transient-credentials-and-gated-host-url.md: record decision for browser-memory-only credentials and gated host URL
2.8 KiB
2.8 KiB
Architecture — zoom-sched-poc
Canonical present-state architecture for the zoom-sched-poc proof-of-concept (feat/zoom-sched-poc).
System Topology
Single-container Flask + Gunicorn (--workers 1 --threads 4) application serving both the static 3-screen presentation UI and the JSON REST API behind a reverse proxy (Traefik).
flowchart LR
Browser["Browser (3-Screen SPA)<br/>Credentials in tab memory"] -->|HTTPS| Proxy["Reverse Proxy (Traefik)"]
Proxy -->|X-Forwarded-*| Flask["Flask App (ProxyFix + Limiter)<br/>MAX_CONTENT_LENGTH: 64 KiB"]
Flask --> DB[("SQLite WAL<br/>/app/data/appointments.db")]
Flask -->|HTTPS Bearer / Basic| Zoom["Zoom REST & OAuth API"]
Module Responsibilities
| Module | Responsibility |
|---|---|
app/__init__.py |
App factory (create_app), ProxyFix, Flask-Limiter (memory://), _resolve_appointment, HTTP routes, and error handlers (413, 429, ZoomAPIError). |
app/schemas.py |
Pydantic v2 request/response models; ZoomCredentials.client_secret uses SecretStr. |
app/db.py |
SQLite WAL initialization (init_db) and atomic state transitions (create_appointment, claim_appointment_for_payment, release_payment_claim, mark_appointment_confirmed, delete_appointment). |
app/zoom.py |
Zoom Server-to-Server OAuth token exchange, paginated slot conflict detection (max_pages=20), meeting creation, and meeting deletion. |
app/templates/index.html & static/style.css |
3-screen smooth-scroll presentation UI with escapeHtml() and safeHttpUrl() (http:/https: only). |
Appointment State Machine
stateDiagram-v2
[*] --> payment_pending: "POST /api/appointments (slot free)"
payment_pending --> payment_processing: "POST /pay atomic claim"
payment_processing --> payment_pending: "Zoom create_meeting fails (release)"
payment_processing --> confirmed: "Zoom meeting created"
payment_pending --> [*]: "DELETE (no Zoom call)"
confirmed --> [*]: "DELETE (deletes Zoom meeting)"
Trust Boundaries & Rate Limits
- Zoom credentials (
account_id,client_id,client_secret) are never written to SQLite, cookies, or disk; they are validated per request on/api/zoom/verify-credentials,/api/appointments,/pay, andDELETE. - Host ZAK link (
zoom_start_url) is omitted on unauthenticatedGET /api/appointments/<lookup_id>and returned only byPOST /payafter credential verification. - Brute-force rate limits (
Flask-Limitermemory://in a single Gunicorn worker):60/mindefault,10/minon/verify-credentials,/pay, andDELETE,15/minonPOST /api/appointments,20/minonGET /api/appointments/<lookup_id>.