DB Airlines - For the flights to your dreams
DB Airlines is a fictional airline company that offers flights to all over the world.
The company is based in the city of Bucharest, Romania.
This project is the mockup of an airline company's system.
The project consists of:
A web application, written using Angular in HTML5, CSS3, and TypeScript that allows users to book flights, check their flight status, and manage their account
A REST API, written using Express in TypeScript that allows the web application to communicate with the database.
An SQL database schema, that stores all the data needed for the airline.
To get started with the web application, you need to have Node.js installed on your machine. After that, you can clone the repository and install the dependencies:
git clone https://github.com/bog1200/DB_Airline_Project.git
cd DB_Airline_Project\web
npm install .To run the application, you need to have the REST API running. After that, you can run the application using the following command:
ng serveThe application will be available at http://localhost:4200/.
| Task | Assigned to | Current Status | Notes |
|---|---|---|---|
| Login | @bog1200 | Done | |
| Register | @bog1200 | In progress | |
| Account management | @bog1200 | In progress |
|
| Task | Assigned to | Current Status | Notes |
|---|---|---|---|
| Flight search | @bog1200 | Done | TODO: Allow search only for days with flights |
| Book a flight | @bog1200 | In progress | |
| Cancel a flight | @bog1200 | Planned | |
| Check flight status | @bog1200 | Planned |
| Task | Assigned to | Current Status | Notes |
|---|---|---|---|
| Manage passengers | Planned | ||
| Manage luggage | Planned |
| Task | Assigned to | Current Status | Notes |
|---|---|---|---|
| Manage flights | Planned | ||
| Manage passengers | Planned | ||
| Manage luggage | Planned | ||
| Manage airports | Planned | ||
| Manage airplanes | Planned | ||
| Manage flight routes | Planned | ||
| Manage flight schedules | Planned | ||
| Manage staff | Planned |
To get started with the REST API, you need to have Node.js installed on your machine. After that, you can clone the repository and install the dependencies:
git clone https://github.com/bog1200/DB_Airline_Project.git
cd DB_Airline_Project\api
npm install .To run the API, you need to have a MySQL or MariaDB database running. You can use the database schema to create the database.
It is also necessary to have a .env file in the root directory of the project for the environment variables such as the database connection. The .env file should contain the following variables:
# The host or ip of the database server
DB_HOST=
# The user and password of the database
DB_USER=
DB_PASS=
# The name of the database table
DB_NAME=
# The port of the database server (optional - default: 3306)
DB_PORT=After that, you can run the API using the following commands:
npm run build
node build/server.jsThe API will be available at http://localhost:6060/.
To develop the API, you can use the following commands:
npm run devThis will start the API in development mode, which means that the API will be restarted every time a file is changed.
The API automatically generates the documentation for the endpoints at each build of the API.
When a new endpoint is added, it is necessary to add the documentation for it. The documentation is written in YAML according to the OpenAPI Specification.
The documentation for each endpoint is located in the same file, above the endpoint.
This project follows the OpenAPI Specification for the REST API.
| Version | Current Status | Notes |
|---|---|---|
| 2 | In progress | |
| 1 | Done |
The documentation for the public version is displayed using Swagger and can be found here.
Each instance of the API also has its own documentation, which can be found at http://localhost:6060/api/vX/docs/, where X is the current API version
The database schema is written in SQL. It can be found here. It contains the following tables:
| Table Name | Description |
|---|---|
| ACCOUNT | Contains the information about the accounts. |
| ACCOUNT_CARD | Contains the information about the payment cards |
| AIRPLANE | Contains the information about the airplanes. |
| AIRPLANE_MANUFACTURER | Contains a list of airplane manufacturers. |
| AIRPLANE_TYPE | Contains the information about the airplane types. |
| AIRPORT | Contains the information about the airports. |
| AIRPORT_GATE | Contains the information about the airport gates. |
| AIRPORT_GATE_TYPE | Contains a list of airport gate types. |
| CITY | Contains the information about the cities. |
| COUNTRY | Contains the information about the countries. |
| EMPLOYEE | Contains the information about the employees. |
| FLIGHT | Contains the information about the flights. |
| FLIGHT_CREW | Contains the information about the flight crews. |
| JOB | Contains the information about the jobs. |
| LUGGAGE | Contains the information about the luggage. |
| PASSENGER | Contains the information about the passengers. |
| TICKET | Contains the information about the tickets. |
| TICKET_PAYMENT | Contains the information about the ticket payments. |
| TICKET_PAYMENT_CARD | Contains the information about the ticket payment cards. |
| TICKET_PAYMENT_METHOD | Contains a list of ticket payment methods. |
The schema also contains the following views:
| View Name | Description |
|---|---|
| LAST_MINUTE_TICKETS | Contains the information about the last minute tickets. |
| LUGGAGE_STATISTICS | Contains luggage statistics. |
| MONTHLY_INCOME_AIRPORT | Ranks airports by income. |
| MONTHLY_PASSENGER_COUNT | Contains the information about the monthly passenger count. |
| PAYMENT_STATISTICS | Contains the information about the payment statistics. |
| PREFERRED_DESTINATIONS | Ranks destinations by passenger count. |
| TICKETS_PER_FLIGHT | Contains the information about the flight usage. |
| TOP_ACCOUNTS | Ranks accounts by purchase value. |
| TOP_AIRPORT_PASSENGERS | Ranks airports by passenger count. |
| TOP_PILOTS | Ranks the pilots by flight time. |
Note: The views are not accessible through the API. They are only used for statistical purposes.
This project is licensed under the GNU General Public License v3.0.