This project is a flight ticket booking application that allows users to search for, book, and manage their flight reservations online.
It also includes an admin module to manage fare categories, extract statistics, and monitor flight performance.
- Flight Search: Find available flights based on user-selected criteria (date, departure, destination, etc.).
- Booking: Reserve flights and make payments through Stripe integration.
- Admin Panel: Modify or add fare categories, retrieve flight occupancy rates, and analyze customer data.
- Statistics: View charts and reports for data-driven strategic decisions.
client_compressed.mp4
you must check the /Demo
folder
-
Install Node.js and npm (for the frontend):
- Download and install from Node.js official website.
-
Install Java Development Kit (JDK):
- Ensure you have JDK 11 or higher installed.
-
Install MySQL:
- Set up a MySQL server and create a database for the application.
-
Install Maven:
- Required for building the Spring Boot backend.
-
Stripe API Keys:
- Obtain the public and secret keys from the Stripe dashboard.
-
Clone the repository:
git clone https://github.com/momonaim/mst-rsi-poo-flight-booking.git cd mst-rsi-poo-flight-booking/server
-
Update
application.properties
:- Navigate to
src/main/resources/application.properties
and update the following:spring.datasource.url=jdbc:mysql://localhost:3306/your_database_name spring.datasource.username=your_username spring.datasource.password=your_password
- Navigate to
-
Build the project:
mvn clean install
-
Run the backend server:
mvn spring-boot:run
Or use the SpringBoot Extension from VS Code
-
Navigate to the client directory:
cd flight-booking/client
-
Install dependencies:
npm install
-
Update the Stripe public key:
- Open
src/index.js
and replace the placeholder:const stripePromise = loadStripe('your_stripe_public_key');
- Open
-
Start the development server:
npm start
-
Access the application:
- Open your browser and navigate to
http://localhost:3000
.
- Open your browser and navigate to
-
Run initial scripts:
- Execute the SQL scripts if needed to initialize the database schema and seed data.
-
Verify database connection:
- Ensure the backend is correctly connected to the MySQL database by checking the logs for successful startup messages.
To enable payment functionality, update the Stripe API keys in the relevant files.
The Stripe secret key must be updated in the following files:
-
server/src/main/java/com/flight/flight_backend/StripeConfig.java
- Locate the following line:
Replace
Stripe.apiKey = "STRIPE_API_SECRET_KEY";
"STRIPE_API_SECRET_KEY"
with your actual Stripe secret key.
- Locate the following line:
-
server/src/main/java/com/flight/flight_backend/controller/PaymentController.java
- Ensure that the secret key is correctly referenced in all methods interacting with Stripe.
The Stripe public key must be updated in:
client/src/index.js
- Locate the following line:
Replace
const stripePromise = loadStripe('STRIPE_API_PUBLIC_KEY');
'STRIPE_API_PUBLIC_KEY'
with your actual Stripe public key.
- Locate the following line:
- Security: Never expose the secret key on the frontend. Use environment variables to securely store the API keys, especially in a production environment.
- Stripe Documentation: For more information about managing API keys, refer to the official Stripe documentation.
- Frontend: React with Material-UI for the user interface.
- Backend: Spring Boot for handling services and REST APIs.
- Database: MySQL for storing flight, customer, and reservation data.
- Payment: Stripe integration for seamless payment management.
Contributions are welcome! If you'd like to participate, feel free to open an issue or submit a pull request.
Thank you for your interest in this flight booking project. 🚀