A simple Expense Tracker built using Node.js, JSON file storage, and vanilla JavaScript frontend. No databases or frameworks required.
Simple, file-based expense tracking in your browser.
- ✅ Add income or expense transactions
- 📋 View a list of all transactions
- 📊 Monthly balance overview
- 🗂 Category-wise summary
- ❌ Delete transactions
expense-tracker/
├── index.js # Node.js backend (Express)
├── transactions.json # Stores all transactions (auto-created)
├── public/
│ ├── index.html # Frontend UI
│ └── script.js # Frontend logic
└── README.md # This file
git clone https://github.com/yourusername/expense-tracker.git
cd expense-trackernpm install expressnode index.jsGo to http://localhost:3000 in your browser.
| Method | Endpoint | Description |
|---|---|---|
| GET | /transactions |
List all transactions |
| POST | /transactions |
Add a new transaction |
| DELETE | /transactions/:index |
Delete a transaction by index |
| GET | /report/category |
Get category totals |
| GET | /balance/:year/:month |
Get monthly balance summary |
{
"description": "Groceries",
"amount": -50.75,
"date": "2025-05-10",
"category": "Food"
}- Positive
amount= Income - Negative
amount= Expense
- The frontend is served from the
publicfolder using Express. - All transactions are saved in a file called
transactions.json. - When you add, delete, or view transactions, the backend reads/writes that file.
- The frontend dynamically updates based on the responses using JavaScript.
Request:
GET /balance/2025/05
Response:
{
"month": "2025-05",
"totalTransactions": 5,
"balance": 1200
}- Edit transactions
- User login support
- Data visualization charts
- Migrate to a real database (MongoDB/SQLite)
Your Name 📧 obwogialex728@gmail.com 🔗 github.com/AlexObwogi
This project is open source and available under the MIT License.