Cabal Barefoot Nomad Backend Development
- Clone this repository
- Make sure that you have node.js and npm installed on your machine. For more information refer to node js installation guide
- Install
yarn
package by runningnpm install -g yarn
script to be able to install project dependencies. - To install project packages run
yarn install
.
- Create
.env
in project root directory - Open
.env.example
file to to get project environment variables. - Copy all keys from the
.env.example
file to.env
file and add values to corresponding keys. These can be obtained from the project administrator.
-
Configuring
.env
- Download and install pgAdmin
- Create two databases, one for testing and another for development.
- Copy
DATABASE_DEV_URL=postgres://your_db_user:[email protected]:5432/your_dev_db_name
andDATABASE_TEST_URL=postgres://your_db_user:[email protected]:5432/your_test_db_name
URLs from.env.example
to.env
- Edit them with your real database user, password and database name.
-
Running Migrations
- Run
yarn dbmigrate
in terminal to fire up migration
- Run
-
To Undo Migrations
- Run
yarn migrate:undo
to undo all migrations
- Run
-
To Reset Migrations
- Run
yarn migrate:reset
to reset all migrations.
- Run
-
Running Seeds
- Run
yarn seeding
to seed all
- Run
You can run all those scripts with a single script yarn dbmigrate:all
- Run
yarn dev
to run server locally
- Run
yarn test
to run tests
-
Local:
http://localhost:{port}/api-docs/
Replace
{port}
with the port specified in.env
file. Examplehttp://localhost:5000/api-docs/
-
Remote: