This project consists of two main parts: the frontend application built with React and Material-UI, and the backend application built with Node.js, Express, and MongoDB. The application allows users to track their expenses, manage categories, and view expense history with comprehensive statistics.
This is the frontend application for the Expense Tracker project. The application is built using React and Material-UI and allows users to track their expenses, manage categories, and view expense history.
-
Clone the repository:
git clone https://github.com/hjungwoo01/expense_tracker.git cd expense_tracker/frontend
-
Install dependencies:
npm install
-
Start the development server:
npm start
-
Build the project for production:
npm run build
- User authentication (login and registration)
- Dashboard to view total expenses and statistics
- Add, edit, and delete expenses
- Manage categories
- View expense history
- Responsive design with Material-UI
This is the backend application for the Expense Tracker project. The backend is built using Node.js, Express, and MongoDB. It provides RESTful APIs for user authentication, managing expenses, and managing categories.
-
Clone the repository:
git clone https://github.com/hjungwoo01/expense_tracker.git cd expense_tracker/backend
-
Install dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in the root of thebackend
directory and add the following variables:PORT=5000 MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret
-
Start the development server:
npm run dev
This will start the server on
http://localhost:5000
.
-
POST /api/auth/register
Register a new user.
{ "username": "testuser", "email": "[email protected]", "password": "password123", "name": "Test User" }
-
POST /api/auth/login
Login an existing user.
{ "username": "example", "password": "password123" }
-
GET /api/expenses
Get all expenses for the authenticated user.
-
POST /api/expenses
Add a new expense.
{ "description": "Dinner at Restaurant", "amount": 50, "currency": "USD", "category": "Dining", "date": "2024-06-15" }
-
DELETE /api/expenses/:id
Delete an expense by ID.
-
GET /api/categories
Get all categories for the authenticated user.
-
POST /api/categories
Add a new category.
{ "name": "Food" }
-
PUT /api/categories/:id
Edit a category by ID.
{ "name": "Groceries" }
-
DELETE /api/categories/:id
Delete a category by ID.
- User authentication with JWT
- Manage expenses (add, edit, delete)
- Manage categories (add, edit, delete)
- Secure RESTful API
The following environment variables are used in this project:
- PORT: The port on which the server will run (default is 5000).
- MONGODB_URI: The connection string for the MongoDB database.
- JWT_SECRET: The secret key for signing JWT tokens.