This repository contains the SeatBooking application, which allows users to manage seat bookings for flights. The application is built using ASP.NET Core, React, and Docker.
Follow the steps below to clone the repository, build the project, and run it using Docker or locally.
Ensure you have the following installed on your machine:
- Git: Download Git
- Docker: Download Docker
- Docker Compose: Comes bundled with Docker Desktop.
- Node.js: Download Node.js
- .NET SDK: Download .NET SDK
-
Clone the Repository
git clone git@github.com:MarioTiara/SeatBooking.git cd SeatBooking -
Run the Project via Docker Compose Build and start the containers using Docker Compose:
docker-compose up --build
-
Access the Application Once the containers are running, you can access the application at:
- Frontend:
http://localhost:8080/Home - Swagger API Documentation:
http://localhost:8080/swagger
- Frontend:
-
Clone the Repository
git clone git@github.com:MarioTiara/SeatBooking.git cd SeatBooking -
Update the Connection String Open
src/SeatBooking.Web/appsettings.jsonand update theConnectionStringssection with your database connection string:"ConnectionStrings": { "DefaultConnection": "YourDatabaseConnectionStringHere" }
-
Apply Database Migrations Navigate to the
src/SeatBooking.Webdirectory and run:dotnet ef database update
-
Install Frontend Dependencies Navigate to the
src/SeatBooking.Web/ClientAppdirectory and run:npm install
-
Build Frontend Assets After installing dependencies, run:
npx webpack --mode development
-
Run the Application Navigate back to the
src/SeatBooking.Webdirectory and run:dotnet run
-
Access the Application Once the application is running, you can access it at:
- Frontend:
http://localhost:5251/Home - Swagger API Documentation:
http://localhost:5251/swagger
- Frontend:
-
Access Swagger UI
Open your browser and go to:- For Docker:
http://localhost:8080/swagger - For local:
http://localhost:5251/swagger
- For Docker:
-
Upload Seat Map
In the Swagger UI, use thePOST /api/Seatmapendpoint to upload yourseatmap.jsonfile. -
Access the Application
After uploading the seat map, open:- For Docker:
http://localhost:8080/Home - For local:
http://localhost:5251/Home
- For Docker:
- SeatBooking.Domain: Contains domain models and business logic.
- SeatBooking.Infrastructure: Handles database access and persistence.
- SeatBooking.Web: Contains the web application (frontend and backend).
If you encounter issues:
- Ensure Docker is running (for Docker Compose).
- Ensure your database connection string is correct (for local setup).
- Check for port conflicts (default port is
8080for Docker and5251for local). - Run
docker-compose downto stop containers and try again (for Docker Compose). - Run
dotnet cleananddotnet buildto rebuild the project (for local setup).
This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to submit issues or pull requests to improve the project.