Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/gautamsh30/flightsandsearchtemp


https://github.com/gautamsh30/flightsandsearchtemp

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# Welcome to Flights Service

## Project setup

-clone project on your local
-execute `npm install` on the same path as of your root directory of the download project
-create a `.env` file in the root directory and add the following enviorment variable. - `PORT=3000`
-Inside the `src/config` folder create a new file `config.json` and then add following piece of json

```

{
"development": {
"username": ,
"password": ,
"database": "Flight_Search_DB_DEV",
"host": "127.0.0.1",
"dialect": "mysql"
},
"test": {
"username": "root",
"password": null,
"database": "database_test",
"host": "127.0.0.1",
"dialect": "mysql"
},
"production": {
"username": "root",
"password": null,
"database": "database_production",
"host": "127.0.0.1",
"dialect": "mysql"
}
}

```

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

# DB design

- airplane table
- flight
- airport
- city

- A flight belongs to an airplane but one airplane can be used in multiple flights
- A city has may airports but one airport belongs to a city
- One airport can have many flights, but a flight belongs to one airport

## Tables

### City -> id, name, created_at, updated_at

### Airport Table -> id, name, address, city_id, created_at, updated_at

Relationship -> city has many airports and airport belongs to a city (one to many)