This project is a Spring Boot application for the Metrorail system, featuring a web interface for ticket purchasing, admin management, and automated database initialization.
You can choose between running the project using Docker (recommended) or setting it up manually.
This is the easiest way to run the project. It automatically sets up both the Spring Boot application and the MySQL database in containers.
Prerequisites:
- Docker Desktop installed and running.
Steps:
- Open a terminal in the project root folder.
- Run the following command:
docker-compose up --build
- Access the application at:
http://localhost:8080
Use this option if you want to run the application directly on your machine.
Prerequisites:
- Java 17 (JDK): Ensure Java 17 is installed.
- Verify with:
java -version
- Verify with:
- MySQL Server: Ensure MySQL is installed and running.
- Create a database named
test2. - Default credentials:
root/1234.
- Create a database named
Steps:
- Open a terminal in the project folder.
- Build and run using the Maven wrapper:
.\mvnw spring-boot:run
- Access the application at:
http://localhost:8080
The application initializes with two primary accounts for demonstration:
| Role | Username | Password |
|---|---|---|
| Admin | Mahim Ismail |
mahim321 |
| User | Dummy User |
password |
- Admin Account: Has full access to the Admin Dashboard (
/admin/system). - Gifting Feature: You can showcase ticket gifting between these two accounts.
If your local MySQL setup differs from the defaults, you can override settings using environment variables:
DB_URL: Database URL (default:jdbc:mysql://localhost:3306/test2)DB_USERNAME: Database username (default:root)DB_PASSWORD: Database password (default:1234)
Example (Windows PowerShell):
$env:DB_PASSWORD="your_password"; .\mvnw spring-boot:runThis project is licensed under the MIT License.











