Commit graph

10 commits

Author SHA1 Message Date
23889315f5 Scoped DB role + own theme colour (port log E17)
- Split database.py into a runtime engine (scoped `kds` DB role, used for
  all request handling) and a migration engine (privileged `kitchen` role,
  used only at startup to create KDS's own tables and ALTER kitchen_settings)
  — KDS previously shared kitchen's full-access DB credential wholesale
- Dispose both engines on shutdown (main.py)
- Fix theme colour clash: KDS was accidentally seeded with kitchen's teal
  (#0d9488) instead of its own colour — now #ea580c (orange), regenerated
  PWA icons to match

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-06 14:45:01 +00:00
870027faca Add iOS install hint + Apple PWA meta tags, fix missing beforeinstallprompt handler
iOS Safari has no beforeinstallprompt API, so the portal's Install
button (?install=1) silently did nothing there. IosInstallHint now
shows Share -> Add to Home Screen steps on Safari, or a prompt to
switch to Safari first if opened in another iOS browser/in-app
webview (those can't install PWAs on iOS at all).

Also added apple-mobile-web-app-title + apple-touch-icon so the
home screen icon isn't a page screenshot, and added the
beforeinstallprompt handler that was missing entirely (Android
Install button did nothing either).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-06 14:12:12 +00:00
951a362dfd Add update-available banner + versioned /health endpoint
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-06 14:11:32 +00:00
46441c3b35 Fix dead manifest link and add proper PWA support
index.html linked /kds/manifest.json, which never existed (404).
Replaced with vite-plugin-pwa, matching the pattern used by every
other app, plus icons that were entirely missing before.
2026-07-29 17:28:50 +00:00
8eb0ab457f Fix session-expiry redirect breaking standalone PWA out of its shell
Same fix as kitchen: AuthGate unconditionally hard-navigated
window.top to the central /login on session expiry, even when not
embedded in the portal iframe — dropping an installed/directly-opened
kds session into the portal's framed browser view instead of staying
in its own window.

Now only bounces to central login when actually embedded (passing
?from= so it returns here afterwards); standalone or directly-opened
tabs get an in-app login form and never navigate away. Also wired up
the inactivity auto-logout timer. The legacy token/restrictedPages/
login/logout compat shim is unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-24 17:07:13 +00:00
c3d13446fc Fix SQLAlchemy mapper init error — remove back_populates from Resos models
KDS uses a minimal Kitchen stub (no resos_* relationship properties) so
back_populates="resos_bookings" etc. caused mapper init to fail on every
request. Changed all four Resos.kitchen relationships to viewonly=True
with no back reference — KDS only reads these, not writes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 09:09:33 +00:00
cd434b3a19 Make User a proper SQLAlchemy model so kds_course_bumps FK resolves
kds_course_bumps.bumped_by_user_id references users.id — SQLAlchemy needs
the User model in Base.metadata to resolve this at startup. Route handlers
still receive a SimpleNamespace from auth.py at runtime.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-12 12:38:47 +00:00
3acb880fc5 Add Kitchen SQLAlchemy model to models/user.py
settings.py imports Kitchen for the back-reference relationship on
KitchenSettings.kitchen. KDS uses kitchen_db directly so the table exists;
this minimal model satisfies the import without pulling in kitchen-only models.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-12 12:37:47 +00:00
32e13d6d49 Add .gitignore + package-lock.json; frontend build verified (84 modules, clean)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-12 12:17:05 +00:00
b94585084a Initial KDS scaffold — Phase 2 kitchen port
FastAPI backend (Python 3.11, httpx for SignalR/GraphQL — no MSSQL ODBC),
shares kitchen_db directly. React/TS/Vite fullscreen board frontend.

Backend: auth.py (APP_SLUG=kds, SimpleNamespace), main.py (4 KDS migrations,
SignalR start/stop), kds.py router, models (kds/settings/resos — read from
kitchen_db), signalr_listener.py (backoff pre-existing), kds_graphql.py,
database.py. Requirements stripped to ~9 packages; image ~400 MB lighter
than kitchen (no MSSQL ODBC layer).

Frontend: AuthGate (app=kds), single fullscreen route, dark board theme.
KDS.tsx URL prefix patched (/api/kds/ → /kds/api/kds/),
recipe images cross-app (/kitchen/api/recipes/).
nginx: 5 blocks with SSE proxy headers on /kds/api/ block.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-12 12:15:16 +00:00