Skip to content

andela/caret-bn-backend

Repository files navigation

Coverage Status Reviewed by Hound Build Status Maintainability

Barefoot Nomad - Making company travel and accomodation easy and convinient.

Vision 🔭

Make company global travel and accommodation easy and convenient for the strong workforce of savvy members of staff, by leveraging the modern web.


Documentation 📖

For API documentation, please visit https://caret-bn-backend.herokuapp.com//api/v1/api-docs/

Setting Up The Application 🔧

A. Docker

  1. Install Docker on your local machine by following these instructions.

  2. After you have ensured that docker is running, clone the repo.

  3. Configure your environment with the following as follows:

# DATABASE CONFIG
DB_USERNAME=
DB_PASSWORD=

# DEVELOPMENT DATABASE
DEVELOPMENT_DB=

# TEST DATABASE
TEST_DB=

# PRODUCTION DATABASE
PRODUCTION_DB=
PRODUCTION_PORT=
DATABASE_PRODUCTION_HOST=
DATABASE_PRODUCTION_PORT=

# DATABASE HOST // Default to localhost
DATABASE_HOST=localhost

# DOCKER CONFIG

# DOCKER DB CONFIG
DATABASE_PORT= 

# APPLICATION

APPLICATION_PORT=port_your_application_will_run_on

  1. When the repo is cloned, run the command docker-compose build to build the image out

  2. If you have no errors run docker-compose up.

  3. Access http://localhost:<:APPLICATION_PORT> in Postman, if docker is running correctly, you will be returned with a message:

    { 
      "status": 200,
      "message": "Welcome to Barefoot Nomad!"
    }
  4. Ensure you have Postgres running

_Note: Your Postgres Database will run on port <:DATABASE_PORT>. If you're using PgAdmin or Postico ensure you create a database on the server localhost:<:DATABASE_PORT>

  1. When the server is running, create a database on your new PG server. Ensure your new development database is the same name as your DEVELOPMENT_DB and your test database is the same name as TEST_DB environment variables

  2. Run the command sequelize db:migrate:all

  3. Run the command sequelize db:seed:all

  4. Check your database to ensure proper functionality and correctness.

  5. To run a production version of the application, set up environment variables and execute the command docker-compose -f docker-compose.yml -f docker-compose.prod.yml up

API Endpoints 💧

  • Sign up endpoint

Endpoint Request Method Request parameter
/api/v1/users/register POST { "email": "[email protected]", "username": "KrinkYF", "password": "Kun376$$#$", "confirmPassword": "Kun376$$#$" }

Bugs 🐛

No known bugs. If you spot one, let us know

Author 💻

Andela Rwanda's Team ^CARET

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages