An expense tracker application built with a Node.js backend using Express and MongoDB, and a React frontend. This application allows users to add, view, update, and delete transactions, and it calculates the total balance, income, and expenses.
Clone the repository:
git clone https://github.com/rajverma/Expense-Tracker.git
cd .\backend\
Install dependencies:
npm install
Create a .env
file in the backend
directory and add the following environment variables:
PORT=5000
MONGODB_CONNECTION=your_mongodb_connection_string
Start the server:
npm run dev
Navigate to the frontend directory:
cd .\frontend\
Install dependencies:
npm install
Create a requestMethods.js
file in the frontend/src
directory and add the following code:
import axios from 'axios';
const publicRequest = axios.create({
baseURL: 'http://localhost:5000/',
});
export default publicRequest;
Start the React application:
npm run dev
POST /expenses
- Add a new expenseGET /expenses
- Get all expensesGET /expenses/recent
- Get the 5 most recent expensesPUT /expenses/:id
- Update an expense by IDDELETE /expenses/:id
- Delete an expense by IDContributions are welcome! Please open an issue or submit a pull request for any changes.
This project is licensed under the MIT License.