Full-stack queue and appointment scheduling platform built with NestJS, React 19, TypeScript, MongoDB (Mongoose), and Redis (Bull). Supports multi-role workflows across employers, staff (places), and clients with timetable validation, role-based access control, and automated background email reminders.
- Video Walkthrough 1 - Queue and Appointment Flow
- Video Walkthrough 2 - Staff Timetable and Admin Controls
- Authentication and Authorization (
server/src/auth,server/src/roles):- Dual-token JWT authentication (
AccessTokenStrategy,RefreshTokenStrategy,LocalStrategy) using Passport andbcryptpassword hashing. - Route-level Role-Based Access Control (RBAC) enforced via custom
@Roles()decorators andRolesGuard(Employer,Employee/Place,Client), plus token-verified password reset flows (ResetTokenschema).
- Dual-token JWT authentication (
- Queue and Timetable Engine (
server/src/queues,server/src/timetables):- Manages service queues, assigned staff stations (
places), client positions, approval/cancellation states, and conflict-checked appointment slots. - Request payloads validated and normalized via custom NestJS pipes (
ScheduleValidationPipe,DataTransformationPipe) andclass-validatorDTOs.
- Manages service queues, assigned staff stations (
- Asynchronous Job Processing (
server/src/schedule,server/src/processors):- Uses Bull backed by Redis (
ioredis) to enqueue delayed appointment reminder jobs (send-appointment-reminder) and process transactional HTML emails asynchronously via Nodemailer and Handlebars templates (confirmation.hbs,passreset.hbs).
- Uses Bull backed by Redis (
- API Protection and Testing:
- Global rate limiting via
@nestjs/throttlerto protect endpoints against brute-force and abuse. - Unit and integration test suites built with Jest (
*.spec.ts) and Supertest (app.e2e-spec.ts).
- Global rate limiting via
- Backend: NestJS 10, TypeScript 5.7, Mongoose 8 (MongoDB), Bull and ioredis (Redis), Passport JWT, Nodemailer and Handlebars, Day.js,
@nestjs/throttler - Frontend: React 19, TypeScript, React Router 7, Ant Design (Antd 5), Axios, SASS/SCSS, Parcel 2
- Testing and Tooling: Jest, Supertest (E2E), ESLint 9, Prettier, Concurrently
auth/: JWT access and refresh strategies, Passport guardsdatabase/: MongoDB connection servicedto/: Request validation DTOsmail/: Nodemailer service and Handlebars email templatespipes/: Custom schedule validation and data transformation pipesprocessors/: Bull worker processor for background email jobsqueues/: Queue CRUD, client progression, and staff assignmentroles/: Role management and RBAC guardsschedule/: Redis and Bull delayed notification schedulerschemas/: Mongoose schemas (User,Queue,Timetable,Role,ResetToken)timetables/: Staff availability and slot booking engineusers/: User account management
api/: Axios HTTP client and request interceptorscomponents/: Modals, forms, data tables, layout, and debounced controlscontext/: Authentication and application state contextinterfaces/: Shared TypeScript domain interfacespages/: Queues, QueueDetails, Schedule, Profile, and authentication pagesrouter/: Protected and role-gated route definitions
- Node.js
>= 18.x - MongoDB (local instance on port
27017or MongoDB Atlas URI) - Redis (local instance on port
6379, Docker, or WSL on Windows) - SMTP or Gmail App Password (for Nodemailer transactional emails)
git clone https://github.com/arseniizar/queue-management.git
cd queue-management
npm install
npm install --prefix server
npm install --prefix clientCreate server/.env with the following variables:
MONGO_URI=mongodb://localhost:27017/queues-management
JWT_ACCESS_SECRET=your_access_secret_key
JWT_REFRESH_SECRET=your_refresh_secret_key
HOST_URL=http://localhost:1234
MAIL_FROM=noreply@example.com
MAIL_USER=your_email@gmail.com
MAIL_PASSWORD=your_16_char_google_app_passwordTo launch Redis, the NestJS backend (http://localhost:3000), and the React frontend (http://localhost:1234) concurrently from the root directory:
npm startTo run each service individually, start Redis (redis-server --daemonize yes), run the NestJS backend in watch mode on port 3000 (npm run start:server), and run the React frontend via Parcel on port 1234 (npm run start:client).
Run unit tests and end-to-end tests from the root directory:
npm test --prefix server
npm run test:e2e --prefix server