This project is a Bus Ticket Reservation System developed as an assignment for the Full-stack (.NET) Developer Internship Batch 3. It is designed from the ground up to be scalable, maintainable, and reliable, strictly adhering to Clean Architecture and Domain-Driven Design (DDD) principles.
- Key Functional Features
- Technology & Architecture
- Architecture Overview (Clean Architecture + DDD)
- Setup and Running the Application
- UI Visualization
- Database Visualization
- Project Status & Next Steps
- Author & Contact
The system implements the following core functionalities:
A. Search Available Buses
- Users can search by Going From, Going To, and Journey Date.
- Results display Company Name, Bus Name, Start/Arrival Time, Price, and dynamically calculated Seats Left.
B. View Seat Plan & Book Seats
- Selecting a bus displays a seat layout.
- Seats are visually represented by status: Available, Selected, and Booked.
- Users can select a Boarding Point, Dropping Point, enter Name, and Mobile Number.
- Transaction: Booking logic (
BookSeatAsync) is executed within a database transaction to ensure atomicity, updating the seat status and creating aTicketentity, thus preventing double-booking issues.
| Component | Technology | Version / Requirement | Notes |
|---|---|---|---|
| Backend | .NET Core (C#) | .NET 9 | RESTful API |
| Database | Entity Framework Core | PostgreSQL | Data persistence |
| Frontend | Angular + TypeScript | Angular v20 | User Interface (ClientApp) |
| Styling | Tailwind CSS | v4 | Frontend styling |
| Testing | xUnit | v2.9.2 | Unit Testing, Logic and validation testing |
The solution is divided into distinct layers to enforce Separation of Concerns, manage dependencies, and facilitate testing.
| Layer (Project) | Responsibility | Key Contents | DDD Focus |
|---|---|---|---|
| Domain | Core business rules and entities | Entities, Value Objects, Domain Services | Domain Model |
| Application | Business logic, use cases | Application Services (e.g., SearchService, BookingService), Use Cases |
Orchestration |
| Application.Contracts | Data Transfer Objects, Interfaces | DTOs (AvailableBusDto, SeatPlanDto), Interfaces |
Contracts for communication |
| Infrastructure | Data access and external dependencies | EF Core DbContext, Repository Implementations |
Persistence |
| WebApi | API controllers and endpoints | REST API controllers, Dependency Injection setup | Presentation |
| ClientApp | User Interface | Angular application | Presentation |
| Tests | Unit and integration testing | xUnit test projects, Mocking, Validation of business logic | Quality Assurance |
git clone https://github.com/Imran-2022/BT-System.git
cd BT-SystemConfigure the Database,
Open the appsettings.json file in the /src/WebApi project and update the connection string to point to your PostgreSQL instance.
"ConnectionStrings": {
"DefaultConnection": "Host=localhost;Port=5432;Database=BusBookingDb;Username=postgres;Password=yourpassword"
}Apply database migrations (creates DB if missing) [from root means when you in BT-System]
dotnet ef database update --project src/Infrastructure --startup-project src/WebApi
Navigate to WebApi folder
cd src/WebApi(Optional) Restore dependencies
dotnet restore
Run the backend API
dotnet run
Navigate to the Angular project folder and install required packages:
cd src/ClientApp
npm install
Configure API URL
Open the api.ts file in the src/ClientApp/src/app/core/project and Update this to match your backend URL and port
/** Base URL of the .NET API */
private readonly baseUrl = 'http://localhost:5106/api';
Run the Frontend
npm start
or
ng serve
by this, The frontend should be accessible at localhost:4200 (or the port indicated by Angular CLI).
From the root of the solution, execute:
dotnet test src/BusTicketReservationSystem.slnCore Features Implemented:
- Search for available buses
- View seat plan
- Book seats with transaction safety
- Backend & frontend fully connected
- Unit tests with xUnit
Planned / Next Steps:
- User registration system
- Payment integration
- Admin dashboard for bus and schedule management
- Enhanced frontend styling and responsiveness
- Additional integration and E2E tests
- PDF version of ticket after purchase
Author : Md Imranul Haque
Email : [email protected]
LinkedIn : https://www.linkedin.com/in/md-imranul-haque/
Feel free to reach out for collaboration, feedback, or questions about this project.



