Before you proceed with the installation, please download and install Node.js.
Dependencies installation is done using the npm init
command:
$ npm install
Create a .env file in the root of the project using .env.example as a base. The values inside .env.example can be used as is, but it is recommended to change them in production.
Remember the port must match with the one configured in the frontend repository!
$ docker run --name c15-database --env-file ./.env -p 5433:5432 -d postgres:latest
This command will create a container using the latest image of Postgres with the user and password defined in the .env file. After creating it you can start this container with docker start c15-database
.
Run your Postgres image and in the optional settings add these variables:
Make sure they match the ones you have in your .env file!
To seed the database with placeholder values you can use this command:
$ npx sequelize db:seed:all
Currently when you launch the app it will drop all the tables in the database before creating them from scratch, you can change this behavior by going to index.js and removing { force: false }
from database.sync()
.
The application uses Sequelize CLI to manage migrations and seeds, you can check its documentation to get started.
Run the following command and wait until you see The Express application is running on port:####
in the terminal.
$ npm run dev
The project uses Nodemon, which means the server will automatically restart every time a change is made in any file.
Cinthya Calbete Hipólito Cayupi Felipe Azócar Jonathan Ruiz