The Expense Tracker is a simple application for managing user accounts and their expenses. It allows users to create new accounts, see all created accounts, create expenses, see all expenses, and search for expenses based on different criteria. The application is developed using Spring Boot, Thymeleaf, Bootstrap 5, PostgreSQL, JPA Hibernate, and JPQL.
- Model: Contains the
User
entity class representing a user account as well as anExpense
entity representing an expense. - Repository: Contains the
UserRepository
interface and theExpenseRepository
interface for database operations. TheExpenseRepository
implements 10 custom operations using JPQL and@Modifying
. - Service: Contains the
UserService
andExpenseService
interfaces for business logic. Service methods are annotated with@Transactional
to ensure transactional integrity. - Controller: Contains the
ExpenseTrackerController
class for handling web requests. It implements endpoints for CRUD operations and custom operations. - ExpenseTrackerApplication: Runs the whole application.
- Templates: Contains all HTML files developed using Thymeleaf templates and Bootstrap 5.
id
: Long (Primary Key)username
: Stringpassword
: Stringemail
: String
id
: Long (Primary Key)amount
: Doubledescription
: Stringcategory
: Stringdate
: LocalDateuser
: User (Many-to-One relationship)
- Description: Displays the details of a specific expense, including its ID, amount, description, category, date, and associated user. Provides a link to go back to the list of expenses.
- Description: Provides a form for creating or editing an expense. Includes fields for the amount, description, category, date, and user. Offers a button to save the expense and a link to cancel the operation.
- Description: Displays a list of all expenses in a table format, showing their ID, amount, description, category, date, and user. Provides links to view details or delete each expense and a button to add a new expense.
- Description: Displays the details of a specific user, including their ID, username, and email. Provides a link to go back to the list of users.
- Description: Provides a form for creating or editing a user. Includes fields for the username, password, and email. Offers a button to save the user and a link to cancel the operation.
- Description: Displays a list of all users in a table format, showing their ID, username, and email. Provides links to view details or delete each user and a button to add a new user.
- URL:
/
- Description: Displays the home page.
-
URL:
/users/new
-
Method:
GET
-
Description: Displays the form to create a new user.
-
URL:
/users/new
-
Method:
POST
-
Description: Creates a new user and redirects to the home page.
-
URL:
/expenses/new
-
Method:
GET
-
Description: Displays the form to create a new expense.
-
URL:
/expenses/new
-
Method:
POST
-
Description: Creates a new expense and redirects to the home page.
- URL:
/expenses/all
- Method:
GET
- Description: Displays all expenses.
Endpoint | Method | Description |
---|---|---|
/ |
GET | Home page |
/users/new |
GET | Display form to create a new user |
/users/new |
POST | Create a new user |
/expenses/new |
GET | Display form to create a new expense |
/expenses/new |
POST | Create a new expense |
/expenses/all |
GET | List all expenses |
- Clone the Repository:
git clone <repository-url> cd expense-tracker
- Configure PostgreSQL Database:
- Create a PostgreSQL database named
expense_tracker
. - Update the
application.properties
file with your PostgreSQL credentials.
- Create a PostgreSQL database named
- Build and Run the Application:
./mvnw spring-boot:run
- Access the Application:
Open your web browser and go to
http://localhost:8080
.
- 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.