Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gautamsh30/flightsandsearchtemp
https://github.com/gautamsh30/flightsandsearchtemp
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gautamsh30/flightsandsearchtemp
- Owner: GautamSh30
- Created: 2024-02-03T14:21:47.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2024-02-12T12:03:47.000Z (11 months ago)
- Last Synced: 2024-11-22T18:17:00.300Z (about 2 months ago)
- Language: JavaScript
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)