Al Boraq is a web-based application built using the Jakarta EE architecture, designed for train ticket management and reservation. This academic project was developed to apply software development concepts and the MVC architectural pattern in a real-world scenario. The application provides a complete solution, from route searching to PDF ticket generation, including a secure payment simulation system.
The application covers the essential functionalities of a modern railway ticketing system:
- User account creation and authentication.
- User profile management.
- Selection of departure and arrival stations.
- Travel date selection.
- Choice between one-way or round-trip journeys.
- Schedule selection and fare consultation.
- Choice of travel class (First or Second Class).
- Passenger quantity management.
- Real-time seat availability management.
- Simulated credit card payment interface.
- Validation and verification of banking information.
- Automatic generation and display of transport tickets in PDF format after confirmation.
- Management of reference data such as trains, stations, and schedules through the back-office system.
The project follows a strict MVC (Model-View-Controller) architecture, ensuring a clear separation between business logic, data access, and the user interface.
- Programming Language: Java
- Web Framework: Jakarta EE (Servlets, JSP)
- Application Server: Apache Tomcat
- Database: MySQL
- Data Access: JDBC (DAO Pattern)
- Project Management: Maven
- Frontend: HTML5, CSS3, JSP
- Containerization: Docker
- WEB Layer: Controllers (Servlets) and Views (JSP) handling user interactions.
- BUSINESS Layer: Classes representing the application logic (
Train,Reservation,AlBoraq, etc.). - DAO Layer: Handles persistence and SQL database interactions.
The system modeling is based on standard UML diagrams:
- Use Case Diagram: Represents interactions between actors and the system.
- Class Diagram: Defines the structure of core entities such as
Passenger,Ticket,Trip,BankCard, and others.
- JDK (Java Development Kit) 11+
- Apache Tomcat (v9 or v10)
- MySQL Server
- Maven
- Clone the GitHub repository.
- Create a local MySQL database named
Gestion_Reservation. - Configure the JDBC connection in the file
src/Dao/dbconnexion.javausing your local database credentials.
Compile the project:
mvn clean installDeploy the generated .war file to your Tomcat server.
The application is fully containerized using Docker, ensuring environment reproducibility and simplified deployment.
A multi-stage build is used in the Dockerfile:
- Stage 1: Maven compiles the source code and generates the
.warfile. - Stage 2: The
.waris deployed on an Apache Tomcat server in the final lightweight image.
The app container and the MySQL container communicate through a dedicated Docker network (alboraq-network).
- Docker Desktop installed and running.
1. Build the Docker image:
docker build -t alboraq-app .2. Create the Docker network:
docker network create alboraq-network3. Start the MySQL container:
docker run -d \
--name alboraq-db \
--network alboraq-network \
-e MYSQL_ROOT_PASSWORD=root \
-e MYSQL_DATABASE=gestion_reservation \
-e MYSQL_USER=alboraq \
-e MYSQL_PASSWORD=alboraq123 \
-p 3307:3306 \
mysql:8.04. Start the application container:
docker run -d \
--name alboraq-app \
--network alboraq-network \
-p 8080:8080 \
alboraq-app© 2025 Al Boraq Project — All Rights Reserved.