GithubHelp home page GithubHelp logo

boondocks-bn-backend's Introduction

Build Status Coverage Status Reviewed by Hound

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.


GET STARTED

Set up

  • Navigate to the directory where you want to copy this repo,clone it by running git clone <link of the repo>

  • Install postgresql into your computer

  • Create two databases:

    • for development
    • for testing
  • add connection string Urls to the .env file :

    • DEV_DATABASE_URL=postgres://<username>:<password>@127.0.0.1:5432/<database for dev> for development

    • TEST_DATABASE_URL=postgres://<username>:<password>@127.0.0.1:5432/<database for test> for testing

    • Make a copy of the .env.example and rename it .env, add the corresponding project variables

  • Run migrations using npm run migrate

  • Run npm run db:seed for commit the seeds to the database

  • To undo: - all seeders run npm run db:seed:undo - all migrations run npm run migrate:undo

Run the app

  • Run npm run watch to start the server
  • Use postman to test the endpoints

Deployment

This app will be deployed on heroku, To access this app go to these link: - Production URL - Staging

API DOCUMENTATION

API Endpoints

Request Route Methods Description
/api/v1/auth/signup POST Users can sign up
/api/v1/auth/signin POST Users can sign in
/api/v1/auth/verification GET Users should be sent a verification email after signup
/api/v1/auth/reverifyUser GET Users should be able to re-request for the verification if it expires
/api/v1//auth/forgotPassword POST Users should be sent a reset password link when it's requested
/api/v1/auth/resetPassword' PATCH Users should be to update their password
/api/v1/trips/return POST Users can request for a return trip
/api/v1/trips/oneway POST Users can request for a return trip

Docker

Setting Up Docker

  1. Install Docker on your pc using instruction here. Make sure it's running well

  2. Navigate to the directory where you want to copy this repo,clone it by running git clone <link of the repo>

  3. Follow the .env.example file to setup your environment and populate with corresponding values

  4. In your root directory run docker build -t <your username>/node-web-app . to build your docker image

  5. Run docker images to assure that image was successfully created

  6. Run docker run -p <given port>:3000 -d <your username>/<image name> to run your image

Run app on Docker

  1. Run docker-compose build to create and start containers

  2. Run docker ps to get container ID

  3. Run docker exec -it <container id> sh to enter container

  4. Run npm migrate followed by npx sequelize-cli db:seed:all

  5. Run npm run watch and test endpoint using postman using route http://localhost:3000/<endpoind route>

boondocks-bn-backend's People

Contributors

api-imperfect avatar b0nbon1 avatar billmike avatar gildniy avatar kipropbrian avatar mastel22 avatar nshaphan avatar raymondmwaura avatar timolinn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.