A modern, real-time queue management system built with Next.js, Node.js, and MongoDB. Perfect for businesses, Hospitals, clinics, banks, and any organization that needs efficient customer queue management.
- Real-time Queue Updates - Live queue status with Socket.IO
- Digital Token Generation - digital tokens
- Multi-Queue Support - Manage multiple service queues
- User Authentication - Secure login and registration
- Analytics Dashboard - Queue performance insights
- Mobile Responsive - Works on all devices
- Admin Panel - Complete queue management controls
You must configure environment variables for both backend and frontend. Copy .env.example to .env for development, and .env.production for production deployments. Fill in the required values as described below:
Core variables (required for all environments):
MONGODB_URIβ MongoDB connection stringJWT_SECRETβ Secret key for JWT authenticationFRONTEND_URLβ Frontend base URL (e.g., http://localhost:3000 or your production domain)BACKEND_URLβ Backend API base URL (e.g., http://localhost:5001 or your production API domain)
Email sending (backend SMTP):
SMTP_HOSTβ SMTP server host (for backend email notifications)SMTP_PORTβ SMTP server portSMTP_USERβ SMTP usernameSMTP_PASSβ SMTP password
Email sending (frontend EmailJS, optional):
EMAIL_JS_SERVICE_IDβ EmailJS service ID (if using EmailJS for frontend email sending)EMAIL_JS_TEMPLATE_IDβ EmailJS template IDEMAIL_JS_PUBLIC_KEYβ EmailJS public key
See .env.example for all required variables and descriptions. For production, ensure secrets and credentials are kept secure and never committed to version control. Use .env.production for your production environment variables.
- Node.js 18+ installed
- Docker and Docker Compose installed
- Git installed
git clone https://github.com/pkparthk/smart-queue-management.git
cd smart-queue-management# Copy environment template
cp .env.example .env
# Install all dependencies (backend & frontend)
npm run install-allNote: Ensure you fill in the required environment variables in
.envbefore starting the app.
# Start all services (frontend, backend, MongoDB)
npm start
# Or manually with docker-compose
docker-compose up -d- Frontend: http://localhost:3000
- Backend API: http://localhost:5001
- MongoDB: mongodb://localhost:27017
You can run backend and frontend separately for development:
# In one terminal (backend)
cd backend
npm install
npm run dev
# In another terminal (frontend)
cd frontend
npm install
npm run dev- If you encounter port conflicts, ensure ports 3000 (frontend), 5001 (backend), and 27017 (MongoDB) are free.
- For environment variable issues, double-check your
.envfile. - For Docker issues, ensure Docker Desktop is running and up to date.
You can deploy this project to any cloud or on-premise environment that supports Docker. For Azure, Vercel, or other platforms, see DEPLOYMENT.md for step-by-step instructions.
The backend exposes a RESTful API for all queue, token, and user operations. For detailed API endpoints and usage, see the API Docs or use tools like Postman to explore /api routes.
- Zustand β Lightweight state management for the frontend (used in
frontend/src/store/authStore.ts) - Jest β Testing framework for backend unit/integration tests
- Socket.IO β Real-time communication between backend and frontend
- Email Service Utility β For notifications (see
utils/emailService.tsin both backend and frontend) - Custom Middleware β For authentication, error handling, and more
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Socket.IO Client - Real-time updates
- Node.js - JavaScript runtime
- Express.js - Web framework
- TypeScript - Type-safe development
- Socket.IO - Real-time communication
- JWT - Authentication
- Bcrypt - Password hashing
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- Docker - Containerization
- Docker Compose - Multi-container orchestration
smart-queue-management/
βββ backend/
β βββ src/
β β βββ controllers/
β β βββ models/
β β βββ routes/
β β βββ middleware/
β β βββ socket/
β β βββ server.ts
β βββ config/
β βββ Dockerfile
β βββ package.json
β βββ tsconfig.json
βββ frontend/
β βββ src/
β β βββ app/
β β βββ components/
β β βββ hooks/
β β βββ store/
β β βββ styles/
β βββ Dockerfile
β βββ package.json
β βββ tsconfig.json
βββ .env.example
βββ DEPLOYMENT.md
βββ README.md
- Create and manage multiple queues
- Set queue capacity and estimated wait times
- Real-time queue status updates
- Generate digital tokens
- Token validation and verification
- Automatic queue position tracking
- Queue performance metrics
- Wait time analysis
- Service efficiency reports
- Admin: Full system management
- Staff: Queue operations and token management
- Customer: Token generation and queue status
- The system includes an email service utility for sending notifications to users (e.g., token confirmations, queue updates, password resets, and other alerts).
- Email logic is implemented in both backend and frontend utilities (
utils/emailService.ts). - Email sending is typically handled via SMTP; you must configure SMTP credentials in your
.envfile (see.env.example). - The email utility is designed to be extensibleβcustomize templates and triggers as needed for your business logic.
- Example use cases:
- Send a confirmation email when a user generates a new token.
- Notify users of their queue position or estimated wait time.
- Alert admins or staff of important queue events.
- This feature helps keep users informed in real time about their queue status, token details, and important system events.
Note: For email features to work, ensure your environment variables for SMTP (host, port, user, password, etc.) are set up correctly.
- JWT-based authentication
- Password hashing with bcrypt
- Input validation and sanitization
- CORS protection
- Rate limiting (configurable)
- Responsive design for all screen sizes
- Touch-friendly interface
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Built with modern web technologies
- Inspired by real-world queue management needs
- Community-driven development
β Star this repository if you find it helpful!
Made with β€οΈ for efficient queue management




