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.
- npm install mongoose, cors, express and body-parser
- 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
- 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.!!!!
/api/users
/api/users
/api/users/:uid
/api/users/:uid
/api/users/:uid
/api/service-providers
/api/service-providers/:uid
/api/service-providers
/api/service-providers/:uid
/api/service-providers/:uid
/api/posts
/api/posts/all
/api/posts/location/:location
/api/posts/service/:service
/api/posts/one/:postId
/api/posts/user/:uid
/api/posts/user/location/:uid/:location
/api/posts/user/service/:uid/:service
/api/posts/serviceprovider/:serviceProviderId
/api/posts/serviceprovider/location/:serviceProviderId/:location
/api/posts/serviceprovider/service/:serviceProviderId/:service
/api/posts
/api/posts/:postId
/api/posts/:postId
/api/posts/one/:postId
/api/posts/response/service-provider
/api/posts/response/user
/api/posts/response/service-provider/:serviceProviderId/:postId
/api/posts/response/:responseId