Skip to content

BCIT-SSD-2020-21/hauler-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hauler-Mobile App Backend

The back-end of the hauler app handles the database for both the apps, user and service provider. The database is created in MongoDb and also is stored on the cloud via MongoAtlas.

Installation requirements

dependancies required to be installed

  • npm install mongoose, cors, express and body-parser

Currently the database on MongoDb is hosted on their shared cluster plan (free).

  • A dot env file will have to be created at the root to store the below Url and add the databse cluster password. MONGO_URI= mongodb+srv://hauler:@clusterhauler.v3kve.mongodb.net/myFirstDatabase?retryWrites=true&w=majority

Team Members

Kulveer Brar

Abhishek Pundir

Owen Ow

Mandeep Dhillon


DEPLOYMENT ON HEROKU

  • In order to deploy the backend app on Heroku, you have to follow the below steps:
  • First open https://id.heroku.com/login in your browser and signup to create the account first
  • Once the account is created, it will send the email verification link to your email which you had signed up.
  • Once you have verified the email, set up your own password and login again into Heroku
  • After you have successfully logged into Heroku, you have to commit all the changes on VS Code on main/master branch
  • Once the commits are done, then run command "npm i -g heroku" in your project folder. It will install the heroku CLI for you in order to login into Heroku while the deployment.
  • Once the installation is done, then type command heroku login and it will take you to the browser for login. Click the Log In button and return back to the command line.
  • After that you have to type command heroku create, to create the heroku app.
  • Now you heroku app is created locally and in order to push that app, run command git push heroku main/master. NOTE: main/master should be chose according to the brach you are in.
  • Once the command is complete it will give you the https:// link, which will be your link to the backend app deployed.
  • Now your backend app is completely deployed on Heroku.!!!!

EndPoints

For User

To get all users:

/api/users

To create new user:

/api/users

To get one user by id:

/api/users/:uid

To delete user:

/api/users/:uid

To edit user profile:

/api/users/:uid

For Service Provider

To get all service Provider:

/api/service-providers

To get one service Provider by id:

/api/service-providers/:uid

To create new service Provider:

/api/service-providers

To delete one service Provider:

/api/service-providers/:uid

To edit service Provider Profile:

/api/service-providers/:uid

For Posts

To get all posts:

/api/posts

To get all active posts:

/api/posts/all

To get active posts for specific location:

/api/posts/location/:location

To get active posts for specific service:

/api/posts/service/:service

To get one post by id:

/api/posts/one/:postId

To get all posts posted by specific user:

/api/posts/user/:uid

To get all post by specific user and specific location:

/api/posts/user/location/:uid/:location

To get all post by specific user and specific service:

/api/posts/user/service/:uid/:service

To get all posts service provider responded to:

/api/posts/serviceprovider/:serviceProviderId

To get all posts service provider responded to for specific location:

/api/posts/serviceprovider/location/:serviceProviderId/:location

To get all posts service provider responded to for specific service:

/api/posts/serviceprovider/service/:serviceProviderId/:service

To create new Post:

/api/posts

To delete one post:

/api/posts/:postId

To edit post:

/api/posts/:postId

To update post visiblity when post gets accepted:

/api/posts/one/:postId

To add service provider response:

/api/posts/response/service-provider

To add user response:

/api/posts/response/user

To get response by service provider id on specific post:

/api/posts/response/service-provider/:serviceProviderId/:postId

To delete response:

/api/posts/response/:responseId

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •