Skip to content

andela/mervels-bn-backend

Repository files navigation

Reviewed by Hound Build Status Coverage 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.

Pre-Requisites

  • Postgresql and database created
  • Redis

How to Install and run the application

  • Clone the application and run npm install
  • Run cp .env.example .env to create .env variables and fill them
  • Run npm db-migrate:dev to create db migrations
  • Run npm db-seed:test to add seeders to the database if u need.
  • Run npm run start:dev to start development server

User Credentials seeded to the Database

Super Administrator

{
	"userEmail": "[email protected]",
	"userPassword": "Root1123#"
}

Manager

{	
   "userEmail": "[email protected]",
    "userPassword": "Root1123#"
}

Travel Admin

{
	"userEmail": "[email protected]",
	"userPassword": "Root1123#"
}

Requester

{	
   "userEmail": "[email protected]",
    "userPassword": "Root1123#"
}

Docker Development Setup

  • Install Docker from Docker For Mac or Docker For Windowsfor windows you will also need to install docker-compose
  • After cloning the application from Github. Switch to the main app where there's the Dockerfile and the docker-compose.yml file
  • Create a .env file and copy .env.example and fill the variables
  • Run docker-compose up. Make sure port 3000 is not taken if so change the port in docker-compose.yml file.
  • Test the application on the link 127.0.0.1:3000/api/docs

API Documentation

Run in Postman

End Point Name Method Category EndPoint Description
Register User POST Users /api/v1/auth/signup This registers a users to the system
Verify User PATCH Users /api/v1/auth/verify?token= User verify account
Login User POST Users /api/v1/auth/sigin This signs in a user to the system
Update User Role PUT Users /api/v1/auth/updateRole Manager can update user roles
Reset User Password PUT Users /api/v1/auth/resertPassword/{id}/token User reset Password
Get UserProfile GET Users /api/v1/profile Gets the user profile
Update UserProfile PATCH Users /api/v1/profile Updates user profile
Signout POST Users /api/v1/auth/signout Logsout singed in user
Unsubscribe PATCH Users /api/v1/auth/unsubscribe Unsubscibe from email notifications
Preferences PATCH Users /api/v1/auth/email-preferences Change email notification preferences
One Way Request POST Requests /api/v1/requests/oneway Creates a oneway request
Return Request POST Requests /api/v1/requests/oneway Creates a oneway request
Multicity Request POST Requests /api/v1/requests/multi_city Creates a oneway request
Pending Requests GET Requests /api/v1/requests/ Manager get all pending requests
Search Requests GET Requests /api/v1/requests?{params} Users can search through requests
Approve Request PATCH Requests /api/v1/requests/approve/{id} Manager Approve request using Request Id
Reject Request PATCH Requests /api/v1/requests/reject/{id} Manager Reject request using Request Id
Get one request GET Requests /api/v1/requests/{id} Manager and request owner can get it by id
All accommodations GET Accommodations /api/v1/accommodations Get all accommodations
Accommodation by ID GET Accommodations /api/v1/accommodations/{id} Get accommodation by ID
Add accommodation POST Accommodations /api/v1/accommodations Create accommodation
Rate accommodation POST Accommodations /api/v1/accommodations/{id}/ratings Rate an accommodation
Review accommodation GET Accommodations /api/v1/accommodations/{id}/feedback Add feedback to accommodation
Like/Unlike PATCH Accommodations /api/v1/accommodations/{id}/like User to like/unlike accommodation
Add Room POST Accommodations /api/v1/accommodations/rooms Travel Admin to add rooms to accommodation
Add comment POST Comments /api/v1/request/{id}/comment User can comment on Requests by Id
Requests Comments GET Comments /api/v1/request/{id}/comment User get all comments they added to requests
Update comment PATCH Comments /api/v1/requests/comments/{id} User update comment by Id
Delete comment DELETE Comments /api/v1/requests/comments/{id} User delete comment by Id

Technologies Used

  • NodeJs / Express
  • Postresql Database with Sequelize as ORM
  • Redis
  • Swagger for API Documentation
  • Heroku For Hosting

Contributors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages