The back-end repository for the website 'My Daily Planner', a web application for customer relationship management
This can be found hosted at https://it-project-2021-back-end.herokuapp.com/.
Documentation can be found hosted at https://it-project-2021-documentation.herokuapp.com/docs/.
There are two things that need to be setup: the yarn packages and the MongoDB connection.
First clone the back-end repository and then cd
into the folder. Then running the command yarn
should install all package dependencies.
Now you have to set up a .env
file to connect to MongoDB. Copy the .env.example
and rename it to .env
. Go to https://cloud.mongodb.com/v2/61077cd135d67c1280c8f601#security/database/users and add a new database user.
Now you can change the url after MONGO_HOST=
as follows:
mongodb+srv://<user>:<password>@cluster0.lozqs.mongodb.net/IT-Project?retryWrites=true&w=majority
Replace <user>
with your username and <password>
with your password. This isn't your MongoDB account, rather the user you just set up for the database.
From here the local development environment should be set up.
- Run the server:
yarn start
- Access the server at http://localhost:4040
This server was deployed to Heroku with a connection to GitHub.
A new Heroku user needs to be set up as mentioned above in "Setting up a local development environment". .env
config variables need to be added in the settings of the heroku app. No port needs to be set as Heroku hosts by default on port 80. The NODE_ENV variable was changed to production.
The documentation on the back-end API can be found at https://it-project-2021-documentation.herokuapp.com/docs/.
Alternatively, the documentation for the API can be accessed locally inside this repository:
- cd into the documentation folder:
cd documentation
- Run the documentation server:
yarn start
- Dependencies may need to be installed at first use:
yarn
- Dependencies may need to be installed at first use:
- Access the documentation server at http://localhost:8080
Note that the local server needs to also be running in order for the example querying to work.
Testing has been implemented and can be easily run with: yarn test