Skip to content

AntoinS/albo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Albo Tap 2.0

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.

System Overview

  • 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

Core Domains

  • Users & Roles: users, roles, user_roles, admin_actions
  • Catalog: product_categories, products, product_prices
  • Sales: orders, order_items, view v_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.

Quick Start

1. Backend API

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload

Environment 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.

2. Svelte Frontend

cd frontend
npm install
npm run dev

Set VITE_API_BASE if the API is not running on http://localhost:8000:

VITE_API_BASE=http://127.0.0.1:8000 npm run dev

Available npm scripts:

  • npm run dev – live dev server
  • npm run build – production build
  • npm run check – type + Svelte diagnostics
  • npm run preview – preview built assets

User Journeys

Kiosk (iPad)

  1. PIN login (POST /api/auth/pin)
  2. Curated dashboard with live inventory and pricing (GET /api/kiosk/products)
  3. Tap-to-add cart, confirm order (POST /api/kiosk/orders)
  4. Success screen auto-resets to PIN entry

Admin & Bierwart (Desktop)

  1. Credential login (POST /api/auth/login)
  2. Responsive dashboard with KPIs, recent orders, low stock radar
  3. Inventory panel for restocking and price updates (admin)
  4. User management (create, activate/deactivate, assign roles) only for admins

Beerwardens inherit read-only access to overview, orders, and inventory metrics.

Database Snapshot

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.

Development Tips

  • Run python3 -m compileall app to ensure the backend compiles after changes
  • Use npm run check within frontend/ for type and markup validation
  • Update frontend/.env with VITE_API_BASE for different environments
  • Consider seeding initial data via an interactive Python shell if starting from scratch

Roadmap Ideas

  • Add Alembic migrations for schema evolution
  • Implement email notifications for low inventory thresholds
  • Extend reporting with export endpoints (CSV/Excel)

Enjoy the glow-up! 🍻

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published