Initial commit: EatMe attendance tracker

Google-SSO PWA for bistro employee clock-in/out, admin employee
management, and stats with CSV export. Express + SQLite backend,
React + Zustand frontend in the light-mono-tui design language.
Multi-stage Dockerfile, compose.yaml for image-based deploys, nginx
reverse-proxy template, and an OKF documentation bundle in docs/.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Michal Pemcak
2026-08-12 11:57:55 +02:00
commit fffcb73ea4
90 changed files with 3411 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
---
type: Architecture Overview
title: System overview
description: How the EatMe frontend, backend, and database fit together.
tags: [architecture, backend, frontend]
timestamp: 2026-08-12T00:00:00Z
---
# System overview
EatMe is a small monorepo with two independently-runnable apps that ship as
one Docker image in production.
- **`backend/`** — Express + TypeScript API, SQLite via `better-sqlite3`
(entry point `backend/src/index.ts`). Owns all state: employee whitelist,
attendance events, sessions.
- **`frontend/`** — Vite + React + TypeScript PWA (entry point
`frontend/src/App.tsx`). Talks to the backend only over `/api/*`; in dev,
Vite proxies that path to `http://localhost:4000` (see
`frontend/vite.config.ts`).
## Request flow
1. Employee/admin signs in with Google Identity Services in the browser
(ID-token flow, no server-side OAuth redirect) — see
[Auth flow](./auth-flow.md).
2. The frontend POSTs the Google ID token to `POST /api/auth/google`; the
backend verifies it, issues its own JWT session cookie, and from then on
every `/api/*` call rides on that cookie (`credentials: 'include'` in
`frontend/src/api/client.ts`).
3. All app logic (fetching, polling, derived state) lives in Zustand stores
under `frontend/src/store/` — see [Frontend](/docs/frontend/index.md).
Components are thin consumers of store selectors/actions.
4. In production the backend also serves the built frontend as static files
(`dist/public/`, see [Deployment](./deployment.md)) — one process, one
container, one origin.
## Design language
The UI follows the "light monochrome TUI" style defined at
`~/doc/concepts/ui/light-mono-tui.md`: grey page background, black type and
1px borders, mono font, inverted fills for active/hover state, no accent
colors, no border-radius. Implemented as plain CSS tokens in
`frontend/src/styles/tui.css`.
## Related
- [Auth flow](./auth-flow.md)
- [Deployment](./deployment.md)
- [Data model](/docs/data-model/index.md)
- [API](/docs/api/index.md)