A robust, intentionally vulnerable-by-design Class Booking Management platform built specifically for Software Testing Training. This application is architected using a microservices pattern on the backend and a Neumorphism-styled Next.js 15 interface on the frontend.
The system is designed to be deployed seamlessly to Vercel (for Serverless Frontend & Backend) and Neon (for Serverless PostgreSQL).
- Frontend: Next.js 15 (App Router), React, Tailwind CSS, Framer Motion, Zustand.
- Backend Microservices: Node.js, Express,
pg(PostgreSQL Client), JWT Authentication.- Auth Service: Manages user authentication, token issuance, and refresh token rotation.
- Booking Service: Handles the core state-machine of class reservations (Draft, Submit, Claim, Forward, Approve, Reject).
- Notification Service: Manages in-app Server-Sent Events (SSE) and persistent notifications.
- Database: PostgreSQL (Neon Serverless DB).
To run the application locally, you can choose between two methods:
- Ensure Docker Desktop is running.
- In the root directory, start the infrastructure:
This starts the PostgreSQL database and all backend microservices locally.
docker-compose up --build -d
- Open a new terminal, navigate to the frontend, and start the Next.js app:
cd frontend npm install npm run dev
- Install PostgreSQL locally and create a database named
class_booking. - Run the SQL scripts located in the
database/folder to create schemas and seed data:psql -U postgres -d class_booking -f database/schema.sql psql -U postgres -d class_booking -f database/seed.sql
- In separate terminal windows, start the frontend and each microservice inside
backend/by runningnpm installandnpm start.
The system is configured to deploy effortlessly to Vercel as a unified monorepo. Vercel acts as the API Gateway, utilizing the vercel.json file to map /api/* traffic to the backend Express Serverless Functions.
- Create a free account at Neon.tech.
- Create a new PostgreSQL project.
- Once created, you can initialize the database in two ways:
- Method A (CLI): Set your
DATABASE_URLin your local.envand run:npm run db:seed
- Method B (GUI): In the Neon SQL Editor, execute the contents of
database/schema.sqlanddatabase/seed.sql.
- Method A (CLI): Set your
- Copy your Pooled Connection String (ensure it has
?sslmode=require).
- Push this repository to GitHub.
- Log in to Vercel and import your repository.
- In the Environment Variables section, add:
DATABASE_URL: [Your Neon Connection String]JWT_SECRET: [A random string for security]NODE_ENV:production
- Click Deploy.
⚠️ Serverless Architecture Note: Since this is deployed using Vercel Functions, the microservices are technically "Stateless Functions". In-memory states (like SSE registries in the notification service) will behave differently than in a persistent server. The system is designed to handle this by using the database as the source of truth, but SSE connections will periodically reconnect.
💡 Vercel Deployment Note: During deployment, you may see a warning: "Due to builds existing in your configuration file, the Build and Development Settings... will not apply". This is expected and safe to ignore, as the
vercel.jsonfile is intentionally used to orchestrate the multi-service build.
🛡️ Security Patch: The frontend has been upgraded to Next.js 15.1.7 to address CVE-2025-66478.
This system is purposefully built to support Software Testing Classes. It contains specific workflows, state transitions, and intentionally designed architectural "edges" for students to discover.
All seeded accounts share the password: password123
| Role | Description | |
|---|---|---|
| CREATOR | creator1@test.com |
Can draft, submit, and cancel bookings. |
| REVIEWER | reviewer1@test.com |
Can claim pending reviews, forward to approvers, or reject. |
| APPROVER | approver1@test.com |
Final authority to approve or reject forwarded requests. |
| ADMIN | admin@test.com |
System administrator with full visibility. |
Instructors can use this application to teach:
- State Machine / Business Logic Testing: Verifying that a Booking cannot jump from
DRAFTdirectly toAPPROVEDwithout passing throughIN_REVIEW. - Role-Based Access Control (RBAC): Ensuring a
CREATORcannot call thePATCH /api/bookings/:id/approveendpoint. - Concurrency & Capacity Testing: Attempting to double-book a classroom (
slot_id+date) simultaneously. - API Security: Testing JWT tampering, missing tokens, and SQL Injection vulnerabilities (if any are introduced during training exercises).
The frontend implements a custom Neumorphism (Soft UI) design system:
- Palette: Cool Slate Gray background (
#e2e8f0) with Electric Teal accents (#0d9488). - Styling: Utilizes heavy inner and drop shadows to create a "pressed" or "extruded" physical button feel.
- Animations: Powered by
framer-motionfor smooth page transitions and micro-interactions.