Skip to content

pasqualegabriel/TTip-Unquivalencia-BackEnd

Repository files navigation

Build Status

TIP-BACKEND

University Proyect of TIP - UNQ

Members

Number Name UNQ-Records EMail Position
1 Camila Cintioli camila.cintioli@gmail.com Developer
2 Gabriel Pasquale 33566 pasqualeunq@gmail.com Developer
3 Fernando Autalan 38046 f.n.autalan@gmail.com Developer
4 Susana Rosito rosito.susana@gmail.com Tutora

Trello

tip - trello

Frontend

UNQuivalencias - frontend

Documentación

UNQuivalencias - documentación

Installing node

Get the latest version of node from the official website or using nvm Nvm approach is preferred.

Getting dependencies

  • npm install
  • npm install -g sequelize sequelize-cli pg pg-hstore

Database configuration

Before running the app, make sure you have postgresql installed and a db created, to create it run the following steps inside a psql terminal:

  1. CREATE DATABASE db_project_name;
  2. CREATE DATABASE db_project_name_test;
  3. \c db_project_name
  4. CREATE ROLE "project_name" LOGIN CREATEDB PASSWORD 'project_name';
  5. grant all privileges on database db_project_name_test to project_name;
  6. ALTER DATABASE db_project_name_test OWNER TO project_name;

Then, set in .env some variables:

  • DB_HOST=localhost
  • DB_PORT=5432
  • DB_NAME=db_project_name
  • DB_USERNAME=project_name
  • DB_PASSWORD=project_name
  • NODE_API_DB_NAME_TEST=db_project_name_test

Remember not to push nor commit the .env file.

Finally, run in a terminal (proyect base):

  1. NODE_ENV=testing npm run create-db && NODE_ENV=testing npm run migrations
  2. npm run create-db && npm run migrations

Model and Migration

To create a model with its migration, for example, run sequelize model:generate --name user --attributes name:string,password:string,age:integer

Migrations

To create a migration, run sequelize migration:create --name="my-migration-name" --migrations-path ./migrations/migrations.

To run them, execute npm run migrations.

Seeders

To create a seeder, run sequelize seed:create --name my-seed-file.

To run them, execute npm run seed-db.

Starting your app

Now, to start your app run npm start in the rootpath of the project. Then access your app at localhost:port. The port is logged in the console where you ran the start script.

Testing your app

Now, to test your app run npm test in the rootpath of the project.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published