VOOZH about

URL: https://www.geeksforgeeks.org/mern/expense-management-system-using-mern-stack/

⇱ Expense Management System using MERN Stack - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Expense Management System using MERN Stack

Last Updated : 23 Jul, 2025

In this article, we’ll walk through the step-by-step process of creating a Expense Management System using the MERN (MongoDB, ExpressJS, React, NodeJS) stack. This project will showcase how to set up a full-stack web application where users can add their budget and put daily expenses that get deducted from the budget.

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

👁 addBudget
Create New Budget Page

Prerequisites:

Approach to Create Expense Management System using MERN:

  • List all the requirement for the project and make the structure of the project accordingly.
  • Chooses the required dependencies and requirement which are more suitable for the project.

For Backend:-

  • Create a directory named model inside root directory.
  • Create javascript files named User.js and Budget.js in the model directory for collection schema.
  • Then create another route directory inside root(Backend folder).
  • Create javascript files named auth.js and budget.js to handle API request.

For Frontend:-

  • Create a components directory inside root directory( Budget_Tracker folder).
  • Create four file of javascript inside components folder namely Expense.jsx, Home.jsx, RegistrationForm.jsx and LoginForm.jsx.

Steps to Create the Backend Server:

Step 1: Create a directory for project

mkdir Backend
cd Backend

Step 2: Create a server using the following command in your terminal.

npm init -y

Step 3: Install the required dependencies in your server using the following command.

npm i express mongoose cors nodemon jsonwebtoken

Project Structure:

👁 Capture4

The package.json file of backend will look like:

"dependencies": {
"bcryptjs": "^2.4.3",
"cors": "^2.8.5",
"express": "^4.18.2",
"jsonwebtoken": "^9.0.2",
"mongoose": "^8.2.0"
}

Example: Below is an example of server for creating budget tracker with MERN Stack.

Start your server using the following command.

npm start

Steps to Create the Frontend Application:

Step 1: Initialized the React App with Vite and installing the required packages

npm create vite@latest -y
->Enter Project name: "Frontend"
->Select a framework: "React"
->Select a Variant: "Javascript"
cd Frontend
npm install



Project Structure:

👁 frontend

The package.json file of frontend will look like:

 "dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.0.1",
"react-router-dom": "^6.22.2"
},
"devDependencies": {
"@types/react": "^18.2.56",
"@types/react-dom": "^18.2.19",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.56.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"vite": "^5.1.4"
}
}



Example: Below is an example of frontend for creating budget tracker with MERN Stack.

Start your frontend application using the following command.

npm run dev

Output:

  • Browser Output:
👁 Expense Management System using MERN Stack
Expense Management System using MERN Stack
  • Output of data saved in Database:
👁 Database of Expense Management System using MERN Stack
Database of Expense Management System using MERN Stack
Comment

Explore