Make company global travel and accommodation easy and convenient for the strong workforce of savvy members of staff, by leveraging the modern web.
- Environment : Nodejs
- Package Manager : NPM
- Compiler : Babel
- Testing : Mocha and Chai
- Linting : ESLint
- Object-relational mapping (ORM) : Sequelize
- Database : postgresql
Node a runtime environment for JavaScript
Postman to test the Api endpoints
Visual studio code for editing and running the app
PostgreSQL for Database
- From your computer, open terminal
- Run
git clone https://github.com/andela/knights-bn-backendto clone the repository OR Download the project
- Create a file and name it
.envin root directory - Find a file named
.env.example - use
.env.exampleas a blueprint for your.env - Provide values to all environmental variables in
.envfile.
Open terminal from your computer
-
Run
npm installto install all dependencies. -
Run
CREATE DATABASE databasename;to create your database. -
Run
npm run createTablesto create your database tables. -
Run
npm testto test automatically if the is functioning properly as expected -
Run
npm startto run the app in development environment. -
copy URL
https://knights-bn-backend-staging.herokuapp.com/api/v1/docsto the browser for the API Documentation. -
copy URL
https://knights-bn-backend-staging.herokuapp.com/api/v1/to postman to start testing the endpoints.
- POST /auth/signup - Create user account
- POST /auth/login - Signing In a registered user
- POST /auth/login/google - Sign-in with Google
- POST /auth/login/facebook - Sign-in with Facebook
- POST /reset_pw/user -resetting password
- PATCH /password/reset/:id/:token - for new password
- PATCH /auth/logout - Logout a user
- PATCH /users/setUserRole - Set/update a user's role
- POST /trips/returnTrip - create a two-way trip request
- GET /trips/myRequest - view all my request history
- GET /user/profile - get user profile information
- PATCH /edit/user/profile - For editing user profile
- GET /trips/pendingApproval - view Avail Requests for Approval
- GET /remembered - For editing user profile
- PATCH /trips/reject/?requestId - view all my request history
- POST /trips/request/multicity - For requesting multiple destinations at once
- GET /trips/search?filterKey=your search -find Requests through the search functionality
- GET /notifications -For checking new notifications
- PATCH /notifications -For marking all notification as read
- GET /trips/view/request/{id} for viewing single request
- GET /trips/edit/request/{id} for editing single request
- PATCH /trips/edit/:requestId - For a user to edit an open request.
- PATCH /trips/approve/:requestId - For a manager to approve a request and send notification to the user.
- GET /trips/request/:requestId - For a user to view specific trip request.
- GET /chat:requestId - For Viewing the past chats.
- GET /rooms/accommodations/:3 - For viewing available room in an accommodation.
- POST /book/accommodations - For booking an accommodation.
- GET /bookings - For viewing my bookings.
- GET /trips/stats/:date? - For a manager and a user to get statistics of the trips made.
- GET /accommodation/comment/:id? - For commenting on accommodation.
- GET /most/traveled - For viewing most travelled destinations.
- GET /accommodation/like/:id? - For liking accommodation.
- GET /accommodation/dislike/:id? - For disliking accommodation.
- GET /api/v1/users - For superAdmin to get all Users on the system
- /api/v1/users/:email - For superAdmin to get one User
Click here to create an issue about this app