Next-generation beverage booking platform featuring a Touch-first kiosk for members and a rich analytics cockpit for admins and beerwardens. The stack now consists of a FastAPI backend with a redesigned relational schema and a SvelteKit + Tailwind front end that delivers a wow-worthy experience on first load.
- Backend: FastAPI, SQLAlchemy, JWT auth (
app/) - Frontend: SvelteKit (TypeScript) with TailwindCSS (
frontend/) - Database: SQLite by default (override with
DATABASE_URL) - Identity: Role-based access (member, beerwart, admin) with hashed PINs/passwords
- Users & Roles:
users,roles,user_roles,admin_actions - Catalog:
product_categories,products,product_prices - Sales:
orders,order_items, viewv_order_totals
Admins can onboard users, maintain inventory, and audit actions. Members log in with PIN, build a cart, and confirm orders in seconds. Beerwardens gain read-only insights into consumption and stock.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reloadEnvironment variables (optional):
| Variable | Default | Purpose |
|---|---|---|
DATABASE_URL |
sqlite:///./app.db |
Database connection |
SECRET_KEY |
dev-secret-change-me |
JWT signing secret |
ACCESS_TOKEN_EXPIRE_MINUTES |
120 |
Token lifetime (minutes) |
CORS_ORIGINS |
http://localhost:5173,http://localhost:4173 |
Allowed front-end origins |
The API bootstraps default roles (admin, member, beerwart) on startup and exposes a health probe at /healthz.
cd frontend
npm install
npm run devSet VITE_API_BASE if the API is not running on http://localhost:8000:
VITE_API_BASE=http://127.0.0.1:8000 npm run devAvailable npm scripts:
npm run dev– live dev servernpm run build– production buildnpm run check– type + Svelte diagnosticsnpm run preview– preview built assets
- PIN login (
POST /api/auth/pin) - Curated dashboard with live inventory and pricing (
GET /api/kiosk/products) - Tap-to-add cart, confirm order (
POST /api/kiosk/orders) - Success screen auto-resets to PIN entry
- Credential login (
POST /api/auth/login) - Responsive dashboard with KPIs, recent orders, low stock radar
- Inventory panel for restocking and price updates (admin)
- User management (create, activate/deactivate, assign roles) only for admins
Beerwardens inherit read-only access to overview, orders, and inventory metrics.
users ──< user_roles >── roles
│ │
└── orders ──< order_items >── products ──< product_prices
admin_actions tracks privileged changes.
v_order_totals aggregates line totals per order for reporting.
Inventory counts live on products.inventory_units. Price history is captured through time-bound rows in product_prices.
- Run
python3 -m compileall appto ensure the backend compiles after changes - Use
npm run checkwithinfrontend/for type and markup validation - Update
frontend/.envwithVITE_API_BASEfor different environments - Consider seeding initial data via an interactive Python shell if starting from scratch
- Add Alembic migrations for schema evolution
- Implement email notifications for low inventory thresholds
- Extend reporting with export endpoints (CSV/Excel)
Enjoy the glow-up! 🍻