A simple and practical Personal Expense Tracker application built with Spring Boot. This application allows users to track their expenses, categorize them, and generate reports.
- Expense Management: Add, view, and delete expenses.
- Expense Categorization: Group expenses into categories such as Food, Travel, and Shopping.
- Report Generation: Generate reports for total expenses by category.
- In-Memory Database: Uses H2 database for lightweight storage.
- RESTful APIs: Exposes endpoints for easy interaction.
- Java 17
- Spring Boot
- Spring Web
- Spring Data JPA
- H2 Database
- DevTools
- Maven
- Java JDK 17 or higher
- Maven
- Visual Studio Code with Java Extension Pack
-
Clone the repository:
git clone https://github.com/thekartikeyamishra/Personal-Expense-Tracker cd expense-tracker
-
Import the project into your IDE (e.g., VSCode).
-
Build the project:
mvn clean install
-
Run the application:
mvn spring-boot:run
-
Access the H2 Database Console:
- URL:
http://localhost:8080/h2-console
- JDBC URL:
jdbc:h2:mem:expensetrackerdb
- URL:
Request: POST /expenses
Body:
{
"description": "Grocery Shopping",
"category": "Food",
"amount": 150.0
}
Response:
{
"id": 1,
"description": "Grocery Shopping",
"category": "Food",
"amount": 150.0
}
Request: GET /expenses
Response:
[
{
"id": 1,
"description": "Grocery Shopping",
"category": "Food",
"amount": 150.0
}
]
Request: GET /expenses/category/{category}
Response:
[
{
"id": 1,
"description": "Grocery Shopping",
"category": "Food",
"amount": 150.0
}
]
Request: DELETE /expenses/{id}
Response: Status 204 (No Content)
spring.datasource.url=jdbc:h2:mem:expensetrackerdb
spring.datasource.driverClassName=org.h2.Driver
spring.jpa.hibernate.ddl-auto=update
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
- Add authentication and user management.
- Integrate with an external database like PostgreSQL.
- Create a front-end interface with React or Angular.
- Implement analytics and visual reports using charting libraries.