Giter VIP home page Giter VIP logo

technites-bn-backend's Introduction

Coverage Status Maintainability Build Status Reviewed by Hound

Barefoot Nomad

Making company travel and accommodation 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

  • Install Node.js if you dont have it installed.
  • Install Postgresql to your system
  • Install Redis database

Environment Setup

  1. git clone this repository && cd to the project directory
  2. with postgres create a 2 databases : one for test and another for development
  3. run npm install to install dependencies
  4. create a .env file in the root project directory
  5. copy the .env.example to the .env file and update it accordingly
  6. run npm run migrate && npm run seed to create the schemas and seed
  7. run npm run test to test the application unit tests

Testing specific endpoints:

Run in Postman or view full documentation of the API can be found here

Run the application with npm run dev and open an API testing tool. We will use Postman for this case.

http://localhost:3000/api/v1/<endpoint>
Authentication
Method EndPoint Enable a user:
POST /auth/signup Register to the barefoot
POST /auth/login Login to barefoot after email confirmation
POST /auth/logout Logout from barefoot
User
Method EndPoint Enable a user:
POST /auth/reset Request for password reset
PATCH /users/editprofile Edit user profile
Host
Method EndPoint Enable a user:
POST /host Add a verified host (Super admin)
Accommodation
    {
        accommodation_name: "myAccommodation",
        description: "This is my accommodation" ,
        location: "Kigali",
        images: "image upload",
    }
Method EndPoint Enable a user:
POST /accommodations Add an accommodation (Travel Admins / Verified Host)
GET /accommodations Get a list of all the accommodations
GET /accommodations/:id Get a specific accommodation
POST /accommodations/:id/rooms Add a room to a given accommodation (Travel admins/ Hosts)
GET /accommodations/:id/rooms get a list of all rooms in the specific accommodation
GET /accommodations/:id/rooms/:id get a specific room
POST /accommodations/:id/like Like a specific accommodation
PUT /accommodations/:id/unlike Unlike a specific accommodation
POST /accommodations/:id/feedback Provide feedback to a specific accommodation
Requests
    {
    request_type: "ReturnTrip",
    location_id: 1,
    departure_date: "2020-09-25",
    destinations: [
        { "destination_id": 2, "accomodation_id": 1, "room_id": 1, "check_in": "2020-09-25", "check_out": "2020-09-26"},
        { "destination_id": 3, "accomodation_id": 2, "room_id": 2, "check_in": "2020-09-27", "check_out": "2020-09-28"}
        ],
    reason: "Reason for the request",
    return_date: "2020-10-25"
    }
Method EndPoint Enable a user:
POST /requests Make a trip request
PATCH /request/:id Edit a trip request
POST /request/:id/comment Comment on a request
GET /requests/:id/approve Approve a trip request (Manager)
GET /requests/:id/reject Reject a trip request (Manager)
GET /requests?{query params} Reject a trip request (Manager)

Licence

This software is published by The Technites Dev Team under the MIT licence.

Contributors

Paul Otieno -TTL || Fred Mucyo || Didas Mbalanya || Jordy Bastien || Amily Kassim || Titus Thumbi

technites-bn-backend's People

Contributors

jordybastien avatar didasmbalanya avatar gik-hub avatar amilykassim avatar mucyomiller avatar api-imperfect avatar dependabot[bot] avatar

Watchers

James Cloos 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.