Express server with REST API for MongoDB CRUD functions.
Backend for the habitmaker webapp.
The app can be found here: https://habitmaker.onrender.com
For the entire application to work, you must run this server simultaneously with the habitMaker-client in a separate terminal. You can find the client code here
Changes before local usage: Inside config/corsOptions.js change the allowedOrigins endpoint to the one you are running the client on. For example:
Run npm install
to install the project dependencies.
Run npm run dev
to run the server locally.
Enviroment Variables: You will also need to add enviroment variables in a .env file
- MONGO_URL: A URL to a MongoDB Atlas database you own
- ACCESS_TOKEN_SECRET: A SSH key, can be generated with the ssh-keygen command in the terminal.
- REFRESH_TOKEN_SECRET:A SSH key, can be generated with the ssh-keygen command in the terminal.
- VERIFICATION_EMAIL: This must be an outlook email address. To use other email providers, adjust the nodemailer config.
- VERIFICATION_EMAIL_PASSWORD:Verification email address password.
- Node.js
- Express
- MongoDb
- Mongoose
- JSON Web Tokens
- CORS
- Nodemailer
Coding Resources:
- Dave Grey's MERN stack tutorial on YouTube and GitHub
- Sending Emails with NodeMailer Tutorial on BetterProgramming
You can find the License for this project here
This project is licensed under the terms of the MIT license.