Expense Tracker β Full Stack Application
Java (Spring Boot) + React + MongoDB
A simple full-stack Expense Tracker that allows users to add, edit, delete, and view expenses with a clean UI and REST API backend.
π Features
Add, edit, delete expenses
View expenses in a table
Total expense calculation
MongoDB database storage
React frontend + Spring Boot backend
REST API with Axios
Fully deployable
π§± Project Structure
expense-tracker/
β
βββ backend/
β βββ src/main/java/
β βββ src/main/resources/
β βββ pom.xml
β
βββ frontend/
βββ src/
βββ public/
βββ package.json
π οΈ Tech Stack Backend
Java 17
Spring Boot
Spring Web
Spring Data MongoDB
Maven
Frontend
React.js
Axios
HTML/CSS
Database
MongoDB (Local or Atlas)
βοΈ Backend Setup cd backend .\mvnw.cmd spring-boot:run
Backend runs at:
Test API:
GET http://localhost:8081/api/expenses
π» Frontend Setup cd frontend npm install npm start
Frontend runs at:
π API Endpoints
Base URL: http://localhost:8081/api/expenses
Method Endpoint Description GET /api/expenses Get all expenses POST /api/expenses Create new expense PUT /api/expenses/{id} Update an expense DELETE /api/expenses/{id} Delete an expense π Example JSON { "title": "Groceries", "amount": 500, "category": "Food", "date": "2025-12-04", "note": "Vegetables & fruits" }