A comprehensive, production-ready queueing system for multi-lane service environments. Built with Next.js 15, TypeScript, Tailwind CSS, shadcn/ui, and MySQL (Prisma ORM).
- Admin: Full dashboard access, manage users and lanes
- User (Cashier/Staff): Queue operations for assigned lanes (Next, Call, Buzz, Serve)
- Display: Real-time display of all active lanes and queue status
- Reservation: Customer-facing interface to get queue numbers and wait times
- Admin Dashboard: Manage lanes, users, assignments, and view live stats
- Queue Operations: Advance, call, buzz, and serve queue numbers (per lane, per day, with daily reset)
- Reservation System: Customers select a lane, get a queue number, and see estimated wait
- Display System: Shows all active lanes, current/next numbers, and queue status in real time
- Role-based Authentication: Custom, secure, no third-party providers
- Daily Reset: Queue numbers and stats are always based on todayβs operations only
- Responsive UI: Built with shadcn/ui and Tailwind CSS for a modern, accessible experience
- Physical Ticket Printing: Print queue tickets for customers (if printer is connected)
- Real-Time Updates: All interfaces update automatically for live queue status
- Frontend: Next.js 15 (App Router), TypeScript, Tailwind CSS, shadcn/ui
- Backend: Next.js API routes, Prisma ORM
- Database: MySQL
- Authentication: Custom JWT-based
- Node.js 18+
- MySQL
git clone <repo-url>
cd queue
npm installCopy .env.example to .env and update DB credentials and secrets.
npm run db:generate
npm run db:push
npm run db:seednpm run devnpm run build
npm run build:production- Admin: admin / admin123
- Cashier 1: c1 / 123
- Cashier 2: c2 / 123
- Regular Lane: General queue for all customers
- PWD Lane: Priority for PWDs and Senior Citizens
src/
app/
admin/ # Admin dashboard
user/ # Cashier interface
display/ # Display screens
reservation/ # Customer reservation
api/ # API routes
components/
ui/ # shadcn/ui components
lib/ # Auth, Prisma, utils
prisma/ # Prisma schema & migrations
public/ # Static assets
scripts/ # Seed and utility scripts
POST /api/auth/loginβ LoginPOST /api/auth/logoutβ LogoutGET /api/lanesβ List all lanes (today's stats)GET /api/queue/reservationβ Lane status for reservation (today only)POST /api/queue/reservationβ Get a new queue numberPOST /api/queue/operationsβ Queue actions (Next, Call, Buzz, Serve)GET /api/users/assigned-lanesβ Lanes assigned to current user (today only)
npm run devβ Start dev servernpm run buildβ Build for productionnpm run build:productionβ Create deployable packagenpm run db:generateβ Generate Prisma clientnpm run db:pushβ Push schema to DBnpm run db:seedβ Seed DB with demo data
- User: System users (admin, cashier, etc.)
- Lane: Service lanes (regular, PWD, etc.)
- LaneUser: Assignment of users to lanes
- QueueItem: Queue entries (per lane, per day)
- Node.js 18+, MySQL, PM2, Apache with
mod_proxy - Prisma binary targets set for Linux in
prisma/schema.prisma:binaryTargets = ["native", "debian-openssl-3.0.x"]
- Clone/copy the project to the server (e.g.
/var/www/node/queue) npm install- Set up
.env(see Environment Variables below) npx prisma generate && npx prisma migrate deploynpm run build- Configure PM2 in
ecosystem.config.js(port, cwd, log paths) pm2 start ecosystem.config.js && pm2 save
Add to your virtual host config:
ProxyPass "/queue" "http://localhost:3007/queue"
ProxyPassReverse "/queue" "http://localhost:3007/queue"DATABASE_URL="mysql://user:password@localhost:3306/queue"
JWT_SECRET="your-secret"
NEXTAUTH_URL="https://yourdomain.com/queue"
NEXT_PUBLIC_BASE_PATH=/queueThe app is deployed under /queue. This is configured in next.config.ts:
basePath: '/queue'All client-side API calls use getApiUrl() from src/lib/api.ts to prepend the base path automatically.
Printing is handled client-side β the browser on the reservation PC calls a local print server directly, so tickets print silently with no dialog regardless of where the app is hosted.
Browser (reservation PC) β http://localhost:12345/print β print-server.js β EPSON printer
- Copy
scripts/print-server.jsto the Windows PC connected to the printer - Install Node.js on that PC
- Update
PRINTER_NAMEin the script to match the exact printer name shown in Devices and Printers - Run:
node print-server.js
Option A β Task Scheduler (recommended):
- Open
taskschd.msc - Create Basic Task β Trigger: At startup β Action: Start
nodewith argument"C:\path\to\print-server.js" - In Properties: check Run whether user is logged on or not + Run with highest privileges
Option B β Startup folder (hidden window):
- Press
Win + Rβshell:startup - Create
start-print-server.vbs:Set WshShell = CreateObject("WScript.Shell") WshShell.Run "node ""C:\path\to\print-server.js""", 0, False
- Chrome / Edge: Fully supported (allows
http://localhostfrom HTTPS pages) - Firefox: Blocked by default (mixed content policy)
- Run
npm run build:production(seeproduction/folder) - Copy
production/to your server - Run
deploy.batas Administrator
MIT
If you find this project useful, consider supporting me:
- π GitHub Sponsors
- β Buy Me a Coffee
- π Ko-fi
Your support keeps this project alive and maintained!
For questions or support, open an issue in this repository.