Skip to content

Belal-uddin/Bus-Ticket-Reservation-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BusBook – Bus Ticket Reservation System

A full‑stack .NET + Angular implementation of a bus ticket reservation system built with Clean Architecture and DDD.

⭐️ Features

  • Search buses by From, To, Journey Date
  • See available seats with live status (Available / Booked / Sold)
  • Book seats with passenger details
  • EF Core (PostgreSQL) with migrations
  • Unit tests for search and booking logic

Search Page Search Result Seat Layout Search Page

🧱 Solution Structure

BusBook/
├─ src/
│  ├─ Domain/                    # Entities, Value Objects, Domain Services
│  ├─ Application/               # Use cases, business logic
│  ├─ Application.Contracts/     # DTOs, Interfaces
│  ├─ Infrastructure/            # EF Core, DbContext, Repositories
│  ├─ WebApi/                    # ASP.NET Core REST API
│  └─ client/                    # Angular app (UI)
├─ tests/                        # Unit test projects
└─ BusBook.sln                   # Solution

🚀 Quick Start

1) Prerequisites

  • .NET 9 SDK
  • Node.js 18+ & npm
  • Angular CLI (npm i -g @angular/cli)
  • PostgreSQL 14+

2) Clone & Restore

 git clone https://github.com/Belal-uddin/Bus-Ticket-Reservation-System.git
 cd BusBook

# Restore .NET deps
 dotnet restore

# Install Angular deps
 cd src/client
 npm install
 cd ../..

3) Configure database

Create a PostgreSQL database (e.g., busbook_db). Then set the connection string in src/WebApi/appsettings.Development.json:

{
  "ConnectionStrings": {
    "DefaultConnection": "Host=localhost;Port=5432;Database=busbook_db;Username=postgres;Password=postgres"
  }
}

4) Apply EF Core migrations

# From repository root
 dotnet tool update --global dotnet-ef

 # Ensure Infrastructure is the migrations assembly and WebApi is startup
 dotnet ef database update -p src/Infrastructure -s src/WebApi

5) Run the API

cd src/WebApi
 dotnet run
# API runs on https://localhost:5001 (or shown port)

6) Run the Angular app

cd src/client
# Set the API base URL in src/environments/environment.ts
# Example:
# export const environment = { apiUrl: 'https://localhost:5001' };

 ng serve --open

🧪 Tests

# From repository root
 dotnet test

📚 Key Projects

  • Domain – Entities like BusCompany, Bus, Route, BusSchedule, Seat, Ticket, etc.
  • Application – Use cases like SearchService and BookingService.
  • Application.Contracts – DTOs: AvailableBusDto, SeatPlanDto, BookSeatInputDto, etc.
  • InfrastructureAppDbContext, repositories, PostgreSQL provider, migrations.
  • WebApi – Controllers: /api/search, /api/booking.
  • client – Angular components for search, seat plan, and booking.

🔌 API Endpoints (example)

  • GET /api/search?from=Dhaka&to=Chittagong&date=2025-10-28
  • GET /api/booking/seat-plan/{busScheduleId}
  • POST /api/booking/book with BookSeatInputDto

About

This is a bus ticket reservation system where users can book and buy tickets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors