A full-featured bus booking web application inspired by the redBus platform, built with ASP.NET Core Web API (backend) and Angular 19 (frontend).
This project replicates real-world booking functionalities with a responsive UI, secure authentication, and role-based access for users and vendors.
⚠️ Note: This project is licensed under MIT for educational and demonstration purposes.
Proper credit to the original author (Rabindra Nath Chanda) is required when reusing or
redistributing this code.
- JWT-based login with access and refresh token system
- Role-based access control for users and vendors
- Prevention of multiple logins with the same refresh token
- Session validation for enhanced security
- Google reCAPTCHA v3 integration for bot protection on login and signup
- Smart booking form with date/time pickers and dynamic dropdowns for route selection
- Real-time fare calculation and seat availability tracking
- Popup booking form with auto-filled room/bus details for faster booking
- Vendors can list buses, manage schedules, and view bookings
- Payment & finance management: total earnings overview and withdrawal system (once per day)
- Reusable settings UI with error handling and toast notifications
- Includes form validation, feedback messages, and responsive design
- Entity Framework models and DbContext.
- Support for MSSQL with migration and database import options
- Sends confirmation emails upon successful bookings
- Auto-generated tickets with detailed booking info
| Layer | Technology |
|---|---|
| Frontend | Angular 19, TypeScript, HTML, CSS |
| Backend | ASP.NET Core Web API, C# |
| Database | Microsoft SQL Server (MSSQL) |
| Security | JWT Authentication, Google reCAPTCHA v3 |
| Email Service | Google SMTP |
| Containerization | Docker |
cd ./redBus_App
npm install
ng serveNote:
Update the
apiURLinsrc/environments/environment.ts&src/environments/environment.development.tswith your backend API endpoint.Add your Google reCAPTCHA v3 site key in both environment files as:
export const environment = { production: false, apiUrl: 'https://localhost:7042/api', reCaptchaSettings: { SiteKey: 'YOUR_SITE_KEY' } };
cd ./redBus-apiOpen redBus-api.sln in Visual Studio 2022 and build the project.
Note:
Add your Mail ID and App Password inside
appsettings.json:"Email": { "Username": "yourmail@gmail.com", "Password": "yourapppassword" }Add your SQL Server instance address:
"AllowedHosts": "*", "ConnectionStrings": { "DBConnection": "Server=YOUR_SQL_SERVER\\SQLEXPRESS;Database=redBus;Trusted_Connection=True;TrustServerCertificate=True;MultipleActiveResultSets=true" }Add Jwt Configuration as you want:
"Jwt": { "Key": "redBus-Api-Super-Secret-Key-rabindra", "Issuer": "redBus_Api", "Audience": "redBus_Client" }Add your Google reCAPTCHA site key and secret key:
"reCaptchaSettings": { "SiteKey": "YOUR_SITE_KEY", "SecretKey": "YOUR_SECRET_KEY" }The backend validates reCAPTCHA tokens on login and signup endpoints for bot prevention.
The backend supports Docker-based containerization; ensure environment variables like
DB_PASSWORDandEMAIL_USERNAMEare set in your Docker setup.
Option 1: Import from Backup
cd './DB Backup'Import redBus.bacpac (not redBus.old.bacpac) into SQL Server Management Studio (SSMS).
📖 Reference Guide – Importing .bacpac Files
Option 2: Using Entity Framework
Update-DatabaseDatabase setup is not required for the docker setup. the Docker-Compose will take care of all things.
cd redBus-Clone
- On Windows run build.ps1 script, it will handle everything.
.\build.ps1
- On Linux/MacOS run build.sh script, it will handle everything.
chmod +x ./build.sh .\build.sh
- Stop running containers
docker compose down -v
- ✅ Clean architecture with separation of concerns
- 🔒 Secure JWT & refresh token flow with single-session enforcement
- 🧠 Google reCAPTCHA v3 integration for advanced bot protection
- 🌗 Responsive Angular UI with dark mode support
- 💰 Vendor payment management and withdrawal system
- 📧 SMTP-based email system for booking confirmations
- 💬 Real-time feedback, reusable components, and toast notifications
- 🐳 Backend ready for Docker containerization
Rabindra Nath Chanda .NET & Angular Developer 📍 Kolkata, India