Skip to content
Public template

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

81 Commits

Folders and files

Repository files navigation

DB Airlines - For the flights to your dreams

dba-logo

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:

typescript mysql express angular nodejs html5 css3

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.

Table of Contents

Web Application

Getting Started (Web)

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 .

Running the Application

To run the application, you need to have the REST API running. After that, you can run the application using the following command:

ng serve

The application will be available at http://localhost:4200/.

Features

Account interaction:

Task Assigned to Current Status Notes
Login @bog1200 Done
Register @bog1200 In progress
Account management @bog1200 In progress
  • Manage payments

Flight interaction:

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

Passenger interaction:

Task Assigned to Current Status Notes
Manage passengers Planned
Manage luggage Planned

Admin interaction:

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

REST API

Getting Started (API)

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 .

Running the API

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.js

The API will be available at http://localhost:6060/.

Developing the API

To develop the API, you can use the following commands:

npm run dev

This will start the API in development mode, which means that the API will be restarted every time a file is changed.

Adding a new endpoint

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.

Documentation (API)

This project follows the OpenAPI Specification for the REST API.

API Versioning

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

Database Schema

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.

License

This project is licensed under the GNU General Public License v3.0.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages