Skip to content

Latest commit

 

History

History
executable file
·
86 lines (57 loc) · 1.54 KB

README.md

File metadata and controls

executable file
·
86 lines (57 loc) · 1.54 KB

Sunmait career day API server

TODO

  • cover users controller with tests
  • remove import = require
  • make sure timestamps for sequelize working fine
  • setup docker for dev needs (db)
  • setup docker for migration/seeders

Installation

You need to have PostgreSQL running on your local machine. PostgreSQL server config file located in:

/API/config/default.example

create your own 'default.json' with your data. Also you need to create a database with name "sunmait_career_days_development".

Installation all dependencies:

npm run install-all

Creating tables and filling them with test data (Migrations)

Configuration file located in:

/migrations/config.example

create your own 'config.json' with your data.

Next, to create tables you need run:

npm run migrate

and then for filling tables with test data run:

npm run seed

To undo migrate, run:

npm run migrate:undo

for seed run:

npm run seed:undo

Running server

To start the server run

npm start

Configuration to run in Docker

Development

To start the server in the docker container, you must correctly specify the database configuration in API/config/default.json and migrations/config/config.json.

By default, database config ​​should be equal to:

"username": "root",
"password": "my_password",
"database": "sunmait_career_days_development",
"host": "sunmait-career-day-devdb",
"port": "3306"

These values ​​you can find in the docker/docker-compose.dev.yml file.