This project is a Flight Service API built using Node.js. It is designed to handle flights, managing airports, cities,airplanes, seats and their related functionalities. This API is structured using best coding practices and project management recommendations.
The Flight Service API provides a robust interface for managing flight-related operations. It is capable of integrating with other services such as payment gateways for processing transactions, weather services for real-time weather updates, and customer relationship management (CRM) systems to enhance customer service.
src/
- Contains all the source code for the project.config/
- Configuration files and setup for libraries and modules, such asdotenv
for environment variables and logging configurations.routes/
- Definitions of API routes along with their corresponding middleware and controllers.middlewares/
- Middleware functions for request interception, such as validators and authenticators.controllers/
- Controllers handle incoming requests, pass data to the business layer, and structure API responses.repositories/
- Contains database interaction logic, including raw and ORM-based queries.services/
- Business logic layer that interacts with repositories to fetch and manipulate data.utils/
- Helper methods and custom error classes.
migrations/
- Database migration files generated by Sequelize.seeders/
- Database seeder files to populate the database with initial data.
- Purpose: To process payments for flight bookings securely.
- How it works: The API sends transaction details to the payment gateway and receives a confirmation response.
- Purpose: To provide passengers with real-time weather updates for their destinations.
- How it works: The API fetches weather data from external weather APIs and integrates this information into the flight status updates.
- Purpose: To manage customer interactions and enhance customer service.
- How it works: The API synchronizes customer data with the CRM system, enabling personalized communication and efficient service.
Once the server is running, you can use any HTTP client to interact with the API. The base URL is http://localhost:<PORT>/api
.