Skip to content

atlp-rwanda/cabal-bn-be

Repository files navigation

Cabal Barefoot Nomad Backend Development

Reviewed by HoundCircleCICoverage Status


Project Setup


Start Up

  • 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 running npm install -g yarn script to be able to install project dependencies.
  • To install project packages run yarn install.

Dotenv setup

  • 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.

Sequelize ORM Setup

  1. 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 and DATABASE_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.
  2. Running Migrations

    • Run yarn dbmigrate in terminal to fire up migration
  3. To Undo Migrations

    • Run yarn migrate:undo to undo all migrations
  4. To Reset Migrations

    • Run yarn migrate:reset to reset all migrations.
  5. Running Seeds

    • Run yarn seeding to seed all

You can run all those scripts with a single script yarn dbmigrate:all

Running server

  • Run yarn dev to run server locally

Running tests

  • Run yarn test to run tests

API Production Link

Production Link

API Documentation

  • Local:

    http://localhost:{port}/api-docs/

    Replace {port} with the port specified in .env file. Example http://localhost:5000/api-docs/

  • Remote:

    Swagger Documentation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published