Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vinamrasaurav/flightsandsearchservice


https://github.com/vinamrasaurav/flightsandsearchservice

Last synced: 26 days ago
JSON representation

Awesome Lists containing this project

README

        

# Welcome to Flights Service

## Project Setup
- Clone the project on your local
- Execute `npm install` on the same path as of your root directory of the downloaded project.
- Create a `.env` file in the root directory and add the following environment variable
- `PORT = 3000`
- `DB_SYNC = true` (Required only once after setting up associations, once done can change it to false).
- Inside the src/config folder create a new file `config.json` and then add the following piece of json in it.
```
{

"development": {
"username": ,
"password": ,
"database": "Flights_Search_DB_Dev",
"host": "127.0.0.1",
"dialect": "mysql"
},

}
```
- Once you have added you db config as listed above, go to the src folder from your terminal and execute `npx sequelize db:create` and then execute `npx sequelize db:migrate`.

## Tables

- City - id, name, updatedAt, createdAt

- Airport - id, name, address, cityId, updatedAt, createdAt
- Relationship - City has multiple airports and Airport belongs to a city. (one to many relationship).

- Airplane - id, modleName, capacity, updatedAt, createdAt

- Flights - id, flightName, airplaneId, arrivalAirportId, departureAirportId, arrivalTime, departureTime, totalSeats, price, boardingGate, createdAt, updatedAt.