Steps to create Workout Planner

Step 1: Create a project folder using the following command.

mkdir workout planner
cd workout planner

Step 2: In your project folder create a folder by the name server and navigate to it.

mkdir server
cd server

Step 3: Install the required packages

npm install bcryptjs cors dotenv express cookie-parser jsonwebtoken mongodb mongoose morgan helmet nodemon

The updated Dependencies in package.json file of backend will look like:

"dependencies": {
"bcryptjs": "^2.4.3",
"cors": "^2.8.5",
"dotenv": "^16.4.4",
"express": "^4.18.2",
"cookie-parser": "^1.4.6",
"jsonwebtoken": "^9.0.2",
"mongodb": "^6.3.0",
"mongoose": "^8.1.3",
"morgan": "^1.10.0",
"helmet": "^7.1.0",
"nodemon": "^3.0.3"
}

Step 4: Create a .env file to store things you don’t want to show to others.

MONGO = [mongo database connection string can be found at on cloud.mongodb.com > Clusters > Connect button]

JWT = randomly generate code


Step 5: Create .gitignore file. Here we specify which files or folders need to be ignored while committing to git repositories. We generally add node modules and .env file here

node_modules
.env

Workout Planner using MERN Stack

With a busy schedule, it is very important to prioritize our health and fitness. In this article, a walkthrough to creating a Workout Planner using MERN (Mongodb, Express, ReactJS, NodeJS) stack is explained. How to create own customized APIs using Mongoose for performing CRUD (Create, Read, Update and Delete) operations has been proposed along with an explanation of installation and setting up of the project.

Output Preview: Let us have a look at how the final output will loo like.

Preview of the Website

Similar Reads

Prerequisites

ReactNodeExpressMongodb and MongooseContext APIREST APIMERN Stack...

Approach to Create Workout Planner using MERN Stack

Functionalities:...

Steps to create Workout Planner:

Step 1: Create a project folder using the following command....

Folder Structure(Backend):

Backend Folder Structure...

Testing the Functioning of Backend

Step 7: In order to check whether the API calls to various endpoints are working or not, Postman or Insomnia can be used for the testing....

Folder Structure:

...