Assignment created and guided with README file by Safwan kher(https://github.com/safwan-kher).
README and instruction by Safwan kher.
Develop an Expense Tracker application using Spring Boot, Thymeleaf, Bootstrap 5, PostgreSQL, JPA Hibernate, and JPQL. The application will help users manage their finances by logging expenses, categorizing them, and viewing summaries of their spending over time.
-
Backend Development: Use Spring Boot to create RESTful APIs.
-
Frontend Interface: Use Thymeleaf and Bootstrap 5 for the user interface.
-
Database: Use PostgreSQL for data storage.
-
ORM: Use JPA Hibernate for ORM and JPQL for custom queries.
-
Transactional Operations: Implement 10 custom operations on the repository with
@Modifying
and@Transactional
.
-
User: Represents a user of the application.
-
Expense: Represents an expense entry.
-
id
: Long (Primary Key) -
username
: String -
password
: String -
email
: String
-
id
: Long (Primary Key) -
amount
: Double -
description
: String -
category
: String -
date
: LocalDate -
user
: User (Many-to-One relationship)
-
Create a new Spring Boot project.
-
Add dependencies for Spring Data JPA, PostgreSQL, and Thymeleaf.
- Set up PostgreSQL database and configure application properties.
- Define
User
andExpense
entities with appropriate JPA annotations.
- Create
UserRepository
andExpenseRepository
interfaces extendingJpaRepository
.
- Implement 10 custom operations in the
ExpenseRepository
using JPQL and@Modifying
.
-
Update Expense Amount: Update the amount of an expense by its ID.
-
Delete Expense by Category: Delete all expenses of a specific category.
-
Update Expense Description: Update the description of an expense by its ID.
-
Update Expense Category: Update the category of an expense by its ID.
-
Delete Expenses by Date Range: Delete all expenses within a specific date range.
-
Update Expense Date: Update the date of an expense by its ID.
-
Update Expense User: Update the user associated with an expense by its ID.
-
Delete Expenses by User: Delete all expenses associated with a specific user.
-
Update Multiple Expenses: Update multiple expenses based on a list of IDs.
-
Delete Expense by ID: Delete an expense by its ID.
-
Create
UserService
andExpenseService
classes. -
Annotate service methods with
@Transactional
to ensure transactional integrity.
-
Create
UserController
andExpenseController
to handle HTTP requests. -
Implement endpoints for CRUD operations and custom operations.
-
Use Thymeleaf templates and Bootstrap 5 to create user-friendly interfaces.
-
Implement forms for inputting expenses, viewing summaries, and categorizing expenses.
-
Manualy test the servicesand features.
-
Ensure all custom operations are tested for correctness.
-
Submit the complete project with all source code, configuration files, and documentation.
-
Include a README file with instructions on how to set up and run the application.
-
Correctness and completeness of the implementation.
-
Proper use of Spring Boot, Thymeleaf, Bootstrap 5, PostgreSQL, JPA Hibernate, and JPQL.
-
Implementation of 10 custom repository operations with
@Modifying
and@Transactional
. -
User-friendly interface.
-
Code quality, including readability, organization, and documentation.
Good luck with your assignment!
From here by Chizuru Yamauchi
- New Project: From IntelliJ IDEA, create a new Maven project.
- Dependencies: Add dependencies for Spring Boot, Spring Data JPA, PostgreSQL, Thymeleaf, and Bootstrap 5.
- On terminal, git init -> git remote add origin git@URL -> git remote -v -> git pull origin main -> git branch -M main -> git add. -> git commit -m "----" -> git push origin main
-
On terminal, sudo -u postgres psql -> CREATE DATABASE expense_tracker; -> \c expense_tracker -> \q
-
Application Properties: Configure the PostgreSQL database connection in the
application.properties
file.
Category 'Study' is deleted.