https://github.com/ritu456286/flight-booking-system
This a backend learning project following microservices architecture.
https://github.com/ritu456286/flight-booking-system
expressjs microservice nodejs
Last synced: 12 months ago
JSON representation
This a backend learning project following microservices architecture.
- Host: GitHub
- URL: https://github.com/ritu456286/flight-booking-system
- Owner: ritu456286
- Created: 2025-02-08T08:00:31.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-09T09:57:09.000Z (about 1 year ago)
- Last Synced: 2025-02-09T10:26:52.020Z (about 1 year ago)
- Topics: expressjs, microservice, nodejs
- Language: JavaScript
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Setup the project
- Clone this github repo and open it in your favourite text editor.
- In the root directory create a `.env` file and add the following env variables
```
PORT=
```
ex:
```
PORT=3000
```
- Inside the folder path, execute the following to download the dependencies:
```
npm install
```
- Inside the `src/config` folder, create a file named `config.json`, and paste the following code:
```
{
"development": {
"username": "root",
"password": null,
"database": "database_development",
"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"
}
}
```
- go inside the `src` folder, and execute the following command:
```
npx sequelize init
```
- By executing the above command, you wil get migrations and seeders folders along with the given default config.json file.
- Run the following commands after intialization to create the database and do the db migrations:
```
npx sequelize db:create
npx sequelize db:migrate
```
- If you're setting up your development environment, then write the username of your db, password of your db, and in dialect mention whatever db you are using. For ex: mysql, postgres, mariadb, etc.
- If you're setting up test or prod environment, make sure you also replace the host with the hosted db url.
- To run the server execute:
```
npm run dev
```