- Clone the Repository
git clone https://github.com/Landienzla/Cerebrum-Tech-Flight-API.git cd Cerebrum-Tech-Flight-API
- Create and Fill the .env File
Before starting, create a
.env
file at the root of the project. You need to setGMAIL_ADDRESS
andGMAIL_PASSWORD
environment variables for sending email verification mails. If these are not provided, make sure to read the documentation carefully for alternative configurations. - Install Dependencies
npm install
- Set up PostgreSQL Database
Make sure you have PostgreSQL installed and running. Update the database connection details in the configuration file.
- Start the Development Server
npm run develop
- Build and Run the Application
- Build the application by running:
npm run build
- Start the application in production mode using:
npm run start:prod
- Build the application by running:
Your application should now be running at http://localhost:3001.
Briefly describe the layout of your project, e.g.,
src/
: All the TypeScript server code resides here.routes/
: Contains Express route definitions for the various API endpoints.controllers/
: Houses the logic for handling requests and responses for each route. Controllers are responsible for interfacing between the API routes and the database models.middlewares/
: Includes middleware functions used across the application. Middlewares are used for tasks like request processing, authentication, error handling, and other common functions that are executed during the HTTP request-response cycle.utils/
: Utility functions that provide common functionalities used throughout the application, such as helper functions, data formatting, and other shared logic.
This application offers a comprehensive suite of features for handling flight-related operations, user authentication, and reservation management. Below is an overview of the core functionalities:
-
User Registration and Login: Secure registration and login processes for users.
-
Email Verification: After registering, users receive an email verification link to ensure the authenticity of their email address.
-
Flight Listing: Users can view a list of available flights. The listing functionality includes various filters for ease of searching.
-
Flight Details: Detailed information about specific flights can be accessed, providing users with comprehensive data about flight schedules, durations, and more.
-
Making Flight Reservations: Users can make reservations on available flights, choosing their preferred seats.
-
Cancelling Reservations: Users have the flexibility to cancel their reservations if their plans change.
-
Listing User Reservations: Users can view all their reservations, both past and upcoming, in one place.
-
Reservation Details: Detailed view of a specific reservation, including flight details, seat number, and reservation status.