QA-TestCraft’s Travel Booking Service
Welcome to QA-TestCraft’s Travel Booking Service — a full-stack travel booking platform that demonstrates both guest and registered user booking experiences. It showcases how a real-world transport booking system operates from registration and OTP verification to trip search, seat selection, discounts, and payment integration.
1. System Overview
The system is divided into three main operational areas:
- Public Area: For guest users (Homepage, Search, Schedules, Guest Booking, Login, OTP Verification).
- Protected Area: For verified users (Dashboard, Discount-based Bookings, Payment Confirmation).
- Admin Area: For administrators (Manage Users, Routes, Schedules, Discounts, and Bookings).
Diagram — System Overview
+----------------------------------------------------+ | QA-TestCraft Travel App | |----------------------------------------------------| | Next.js 15 (App Router) + Tailwind CSS frontend | | API Routes (serverless backend) | | Middleware (JWT Auth Guard, OTP flow) | | MongoDB via Mongoose | | Paystack (Payment Gateway) | | Nodemailer (Email OTP Service) | +----------------------------------------------------+ ┌──────────────────────────────┐ │ Public Area │ │ (Homepage, Search, Guest) │ └──────────────┬───────────────┘ │ ▼ ┌──────────────────────────────┐ │ Protected Area │ │ (Dashboard, Discounts, Auth) │ └──────────────┬───────────────┘ │ ▼ ┌──────────────────────────────┐ │ Admin Area │ │ (Manage Users, Routes, etc.) │ └──────────────────────────────┘
2A. Guest User Booking Flow
- User visits the homepage and selects From, To, and Date.
- The system displays all available schedules for the chosen route.
- User selects a schedule and chooses the number of seats available.
- A quote is automatically generated (based on the schedule’s price).
- User enters minimal guest details (first name, last name, email).
- Payment is initiated via Paystack test gateway.
- Upon success, a booking confirmation is shown.
Diagram — Guest Flow
+----------------------------+ | Homepage (Public) | |----------------------------| | User selects From/To/Date | +-------------+--------------+ | ▼ +----------------------------+ | Available Schedules Page | |----------------------------| | Fetch via /api/schedules | | Display car, time, seats | +-------------+--------------+ | ▼ +----------------------------+ | Guest Quote Page | |----------------------------| | Choose seat count | | Compute total fare | | Confirm booking | +-------------+--------------+ | ▼ +----------------------------+ | /api/bookings/create | |----------------------------| | Save guest info | | Generate booking ID | | Initialize Paystack | +-------------+--------------+ | ▼ +----------------------------+ | Paystack Redirect/Callback | |----------------------------| | Verify payment status | | Update booking → paid | | Show Confirmation Page | +----------------------------+
2B. Registered User Flow
- User registers with full details and verifies email via OTP.
- After admin approval, user logs in using credentials.
- Verified users gain access to the protected dashboard.
- Users search for routes and view available discounts (if active).
- After selecting seats, the discounted total is computed dynamically.
- Payment and booking confirmation proceed automatically.
Diagram — Registered Flow
+----------------------------+ | Registration Page | |----------------------------| | /api/users/register | | Save pending user | | Generate OTP | +-------------+--------------+ | ▼ +----------------------------+ | Email OTP Verification | |----------------------------| | /api/auth/otp/verify | | Mark emailVerified=true | +-------------+--------------+ | ▼ +----------------------------+ | Admin Approval (Backend) | |----------------------------| | /api/users/approve | | Set status=active | +-------------+--------------+ | ▼ +----------------------------+ | Login Page (UI) | |----------------------------| | /api/auth/login | | JWT Cookie Created | | Redirect to Dashboard | +-------------+--------------+ | ▼ +----------------------------+ | Dashboard Page (Protected) | |----------------------------| | /api/discount/active | | Apply discount on quote | +-------------+--------------+ | ▼ +----------------------------+ | /api/bookings/create | |----------------------------| | User creates booking | | Payment via Paystack | | Confirmation shown | +----------------------------+
2C. Admin Flow
- Admin logs in to manage backend data (users, routes, schedules, cars, discounts, bookings).
- Approves or rejects new users via the “Approve User” endpoint.
- Creates new destinations, routes, and schedules.
- Applies active discounts and monitors bookings/payments.
Diagram — Admin Flow
+----------------------------+ | Admin Login | |----------------------------| | /api/auth/login | | role = admin | | JWT Cookie issued | +-------------+--------------+ | ▼ +----------------------------+ | Admin Dashboard | |----------------------------| | /api/admin/stats | | Display user counts, etc. | +-------------+--------------+ | ▼ +---------------------------------+ | User Management Module | |---------------------------------| | /api/users/approve / reject | | Activate or disable users | +-------------+-------------------+ | ▼ +---------------------------------+ | Route & Schedule Management | |---------------------------------| | /api/routes /api/schedules | | Create destinations and trips | +-------------+-------------------+ | ▼ +---------------------------------+ | Discount Management | |---------------------------------| | /api/discount/create /active | | Apply promo percentages | +-------------+-------------------+ | ▼ +---------------------------------+ | Payment & Booking Reports | |---------------------------------| | /api/payments/verify | | /api/bookings/stats | | Track completed transactions | +---------------------------------+
Summary
The QA-TestCraft Travel Booking App demonstrates a complete end-to-end transportation booking experience. It integrates OTP authentication, user management, trip scheduling, dynamic pricing, and Paystack payment handling — all within a single, unified Next.js environment. This project stands as a professional QA and full-stack testing model for automation, performance validation, and practical software education.