# KoolTap Remote Tab Control A production-quality remote tab control system for venues. Allows bar staff to manage and close tabs remotely from a web dashboard, with commands delivered to bar terminals via a sync API. ## Architecture - **Monorepo** managed with pnpm - **NestJS** backend API with Prisma ORM on PostgreSQL - **Next.js** dashboard with App Router, TanStack Query, and shadcn/ui - **Shared** TypeScript types package ``` apps/ api/ # NestJS backend dashboard/ # Next.js frontend packages/ shared/ # Shared types & constants scripts/ device-sync.ts # Device simulator docs/ api.md # API documentation architecture.md architecture-decisions.md local-development.md testing.md production.md security.md ``` ## Requirements - Node.js >= 18 - pnpm >= 8 ## Quick Start ```bash # 1. Install dependencies pnpm install # 2. Generate Prisma client cd apps/api pnpm db:generate # 3. Run migrations pnpm db:migrate # 4. Seed demo data pnpm db:seed cd ../.. # 5. Start both API and Dashboard in dev mode pnpm dev ``` API runs on http://localhost:3001 Dashboard runs on http://localhost:3000 Swagger docs at http://localhost:3001/api/docs ## Demo Credentials | Role | Email | Password | |--------|--------------------|------------| | Admin | admin@example.com | Admin123! | | Manager | viewer@example.com | Viewer123! | | Superadmin | superadmin@example.com | Super123! | The seed also adds a second venue, KoolTap Festival Bar (festival@example.com / Admin123!). To make an existing user a superadmin elsewhere, run `pnpm --filter @kooltap/api run superadmin ` (`--revoke` makes them an admin again). ## Device Simulator ```bash # Run a full demo (register, sync, ack) cd scripts npx ts-node device-sync.ts demo # Or step by step: npx ts-node device-sync.ts register "Bar Terminal 1" ABC123 npx ts-node device-sync.ts sync npx ts-node device-sync.ts ack completed ``` ## Running Tests ```bash # Unit tests pnpm test # E2E tests pnpm test:e2e ``` ## Docker ```bash docker compose up ``` ## Production Notes See [docs/production.md](docs/production.md) for production deployment.