PROJECT DOCUMENTATION

Expenditure Management System

A web-based financial expenditure management application developed using Java 11 and Spring Boot 2.7, with MySQL persistence and deployment on a Linux VPS server. The system manages expenditure transactions, payment information, consolidated expenditure and available balance.

1. Project Overview

The Expenditure Management System is designed to digitize and centralize the organization's expenditure management process. It provides a structured way to create, search, review and consolidate expenditure transactions.

The sample screens show four important business areas: searching expenditure records, entering expenditure information, calculating consolidated expenditure and viewing the total available balance.

Transaction ManagementRecord expenditure details in a structured format.
SearchSearch expenditure information by applicable criteria.
ConsolidationCalculate expenditure totals for a selected period.
BalanceDisplay the current available financial balance.

2. Business Problem

Manual expenditure management using paper registers or spreadsheets can make it difficult to maintain accurate financial records and quickly identify historical transactions.

  • Difficulty searching historical expenditure records.
  • Manual calculation of total expenditure.
  • Difficulty tracking payment modes.
  • Difficulty identifying who made a payment and to whom it was paid.
  • Difficulty calculating the available balance.
  • Duplicate or inconsistent manual entries.
  • Limited visibility into expenditure by category or date.
The application addresses these issues by maintaining expenditure information in a centralized database and exposing it through a user-friendly web application.

3. Project Objectives

  1. Digitize the expenditure recording process.
  2. Maintain a centralized expenditure database.
  3. Provide search and filtering capabilities.
  4. Record account head and purpose of every payment.
  5. Track cash, cheque and online payment modes.
  6. Maintain expenditure date and amount.
  7. Track the payment source and payment recipient.
  8. Calculate consolidated expenditure.
  9. Display available balance information.
  10. Provide a reliable foundation for reporting and auditing.

4. Functional Modules

Expenditure ManagementAdd, view, update and manage expenditure transactions.
Search ExpenditureFind transactions based on expenditure criteria.
Payment ManagementMaintain Cash, Cheque and Online payment modes.
Consolidated ExpenditureCalculate total expenditure for a period.
Balance ManagementDisplay total available balance.
ReportingSupport financial analysis based on date, category and payment mode.

5. Technology Stack

Layer / ComponentTechnologyPurpose
Programming LanguageJava 11Core application development.
Backend FrameworkSpring Boot 2.7REST APIs, configuration and application runtime.
Web LayerSpring MVC / RESTHandle browser/API requests.
PersistenceSpring Data JPARepository abstraction and CRUD operations.
ORMHibernateObject-relational mapping.
DatabaseMySQL 8Persistent financial data storage.
Build ToolMavenBuild, dependency management and packaging.
ServerLinux VPSProduction hosting environment.
Application RuntimeEmbedded TomcatRuns the Spring Boot application.
Reverse ProxyNginxHTTPS termination and reverse proxy where configured.
FrontendHTML, CSS, JavaScriptUser interface and client-side interaction.
Version ControlGitSource code management.

7. Add Expenditure

The Add Expenditure functionality opens the Expenditure Information screen. The user enters the transaction details and submits them for persistence.

User enters data
Frontend validation
REST Controller
Service
Repository
MySQL

8. Expenditure Fields

FieldDescriptionExample
Account HeadExpense category.Maintenance
Purpose of PaymentReason for expenditure.Building maintenance
Payment Mode TypeMethod used to make payment.Cash / Cheque / Online
Expenditure AmountFinancial amount of the transaction.15000.00
Expenditure DateDate on which expense occurred.20-08-2026
Paid ByPayment source.KESHAVA SEVA SAMITHI
Payment Made ToPayment recipient.ABC Maintenance Services
For financial calculations, Java BigDecimal is recommended instead of double or float.

9. Consolidated Expenditure

The Search Total Consolidated Expenditures screen provides a mechanism to calculate the total expenditure for a selected date or date range.

Start Date
Search
Database Aggregation
SUM(Amount)
Total Amount

Example

ExpenseAmount
Electricity₹5,000
Maintenance₹10,000
Stationery₹3,000
Transportation₹7,000
Total₹25,000

10. Total Balance Information

The Total Balance Information screen displays the total available balance. The sample screen shows an available balance of 391000.0.

A typical business calculation is: Available Balance = Total Available Funds − Total Expenditure. The exact source of funds and balance rules should follow the actual application's business implementation.
Total Funds       = ₹500,000
Total Expenditure = ₹109,000
--------------------------------
Available Balance = ₹391,000

11. End-to-End Business Workflow

User / Administrator
Expenditure Information Screen
Spring Boot REST API
Validation + Business Rules
Spring Data JPA / Hibernate
MySQL Database
Search / Consolidation / Balance

12. Reporting

The system can support several useful financial reports.

Daily ExpenditureExpenses recorded for a particular day.
Monthly ExpenditureTotal expenditure for a month.
Date RangeTotal expenditure between two dates.
Account HeadExpense grouped by category.
Payment ModeExpense grouped by Cash, Cheque and Online.
Payment RecipientHistory of payments made to a particular recipient.

13. Application Architecture

Browser / Frontend — HTML, CSS, JavaScript
REST Controller Layer
Service Layer — Business Logic
Repository Layer — Spring Data JPA
Hibernate / JPA
MySQL 8 Database

Recommended Package Structure

com.example.expenditure
│
├── controller
│     └── ExpenditureController
│
├── service
│     ├── ExpenditureService
│     └── BalanceService
│
├── service.impl
│     ├── ExpenditureServiceImpl
│     └── BalanceServiceImpl
│
├── repository
│     └── ExpenditureRepository
│
├── entity
│     └── Expenditure
│
├── dto
│     ├── ExpenditureRequest
│     └── ExpenditureResponse
│
├── exception
│     ├── GlobalExceptionHandler
│     └── ResourceNotFoundException
│
└── config
      └── ApplicationConfiguration

14. Controller Layer

The Controller layer receives HTTP requests from the frontend and delegates business operations to the Service layer.

@RestController
@RequestMapping("/api/expenditures")
public class ExpenditureController {

    @PostMapping
    public ResponseEntity<?> create(
            @RequestBody ExpenditureRequest request) {
        // create expenditure
        return ResponseEntity.ok().build();
    }

    @GetMapping
    public ResponseEntity<?> getAll() {
        // retrieve expenditures
        return ResponseEntity.ok().build();
    }
}

The controller should remain lightweight and should not contain complex financial business logic.

15. Service Layer

The Service layer is responsible for business rules and application logic such as validation, calculation, transaction handling and conversion between DTOs and entities.

@Service
public class ExpenditureServiceImpl
        implements ExpenditureService {

    private final ExpenditureRepository repository;

    public ExpenditureServiceImpl(
            ExpenditureRepository repository) {
        this.repository = repository;
    }

    @Override
    public ExpenditureResponse create(
            ExpenditureRequest request) {

        // validate request
        // convert request to entity
        // save entity
        // return response
        return null;
    }
}

16. Repository Layer

Spring Data JPA provides the repository abstraction used to perform CRUD operations and database queries without writing repetitive JDBC code.

public interface ExpenditureRepository
        extends JpaRepository<Expenditure, Long> {

    List<Expenditure> findByAccountHead(
            String accountHead);
}

17. Entity & DTO Design

JPA Entity

@Entity
@Table(name = "expenditure")
public class Expenditure {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    private String accountHead;
    private String purposeOfPayment;
    private BigDecimal amount;
    private LocalDate expenditureDate;
    private String paymentMode;
    private String paidBy;
    private String paymentMadeTo;
}

Request DTO

public class ExpenditureRequest {

    private String accountHead;
    private String purposeOfPayment;
    private String paymentMode;
    private BigDecimal amount;
    private LocalDate expenditureDate;
    private String paidBy;
    private String paymentMadeTo;
}

18. Validation

Financial transactions should be validated before they are persisted.

FieldValidation
Account HeadMandatory
PurposeMandatory
Payment ModeMandatory and restricted to supported values
AmountMandatory and greater than zero
Expenditure DateMandatory
Paid ByMandatory
Payment Made ToMandatory
@NotBlank
private String accountHead;

@NotNull
@DecimalMin("0.01")
private BigDecimal amount;

@NotNull
private LocalDate expenditureDate;

19. Transaction Management

Database transactions are important when one business operation performs multiple database changes.

@Transactional
public ExpenditureResponse create(
        ExpenditureRequest request) {

    // validate
    // save expenditure
    // update related balance if applicable
}
If a multi-step financial operation fails, the transaction should be rolled back to prevent partial or inconsistent data.

20. Exception Handling

A global exception handler provides consistent responses to frontend clients and keeps internal database details out of user-facing errors.

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(
        ResourceNotFoundException.class)
    public ResponseEntity<?> handleNotFound(
            ResourceNotFoundException ex) {

        return ResponseEntity
            .status(HttpStatus.NOT_FOUND)
            .body(ex.getMessage());
    }
}
StatusTypical Meaning
400Invalid request or validation failure.
401Authentication required.
403User is not authorized.
404Requested record does not exist.
409Conflict or duplicate business data.
500Unexpected server-side error.

21. Security

Since the application manages financial information, access control should be implemented according to the actual project requirements.

AdministratorManage expenditure records, reports and configuration.
Authorized UserView and search permitted financial records.
AuthenticationVerify that only authorized users can access the application.
AuthorizationRestrict sensitive operations according to user roles.

22. REST APIs

POST/api/expenditures — Create expenditure
GET/api/expenditures — Retrieve expenditures
GET/api/expenditures/{id} — Retrieve one expenditure
PUT/api/expenditures/{id} — Update expenditure
DELETE/api/expenditures/{id} — Delete expenditure
GET/api/expenditures/search — Search expenditures
GET/api/expenditures/total — Calculate total expenditure
GET/api/expenditures/balance — Retrieve available balance
GET/api/expenditures/report — Generate/report expenditure information

Example Request

POST /api/expenditures
Content-Type: application/json

{
  "accountHead": "Maintenance",
  "purposeOfPayment": "Building maintenance",
  "paymentMode": "ONLINE",
  "amount": 15000.00,
  "expenditureDate": "2026-08-20",
  "paidBy": "KESHAVA SEVA SAMITHI",
  "paymentMadeTo": "ABC Maintenance Services"
}

23. Database Design

A typical expenditure table can contain the following fields:

ColumnPurpose
idPrimary key.
account_headExpense category.
purpose_of_paymentReason for payment.
amountFinancial amount.
expenditure_dateTransaction date.
payment_modeCash, Cheque or Online.
paid_byPayment source.
payment_made_toPayment recipient.
created_byUser who created the record.
created_dateCreation timestamp.
updated_byUser who last updated the record.
updated_dateLast update timestamp.
Monetary columns should preferably use DECIMAL(15,2) or a suitable precision defined by the application's financial requirements.

24. Important SQL Queries

Total Expenditure

SELECT COALESCE(SUM(amount), 0)
FROM expenditure;

Total Expenditure for Date Range

SELECT COALESCE(SUM(amount), 0)
FROM expenditure
WHERE expenditure_date
BETWEEN ? AND ?;

Expenditure by Account Head

SELECT account_head,
       SUM(amount)
FROM expenditure
GROUP BY account_head;

Expenditure by Payment Mode

SELECT payment_mode,
       SUM(amount)
FROM expenditure
GROUP BY payment_mode;

25. Linux VPS Deployment

The Spring Boot application can be packaged as an executable JAR and deployed on a Linux VPS server.

Internet / Browser
Domain / DNS
Nginx — HTTPS / Reverse Proxy
Spring Boot JAR — Java 11
MySQL 8

Build

mvn clean package

Run Application

java -jar expenditure-management.jar

Typical Linux Service Commands

sudo systemctl start expenditure
sudo systemctl stop expenditure
sudo systemctl restart expenditure
sudo systemctl status expenditure

26. Nginx Production Architecture

Nginx can be placed in front of the Spring Boot application to expose a clean HTTPS domain while keeping the Spring Boot port internal.

Browser
   |
   | HTTPS :443
   v
 Nginx
   |
   | reverse proxy
   v
localhost:8080
   |
   v
Spring Boot Application
   |
   v
MySQL

Nginx can provide:

  • HTTPS/SSL termination.
  • HTTP to HTTPS redirection.
  • Reverse proxy.
  • Request and connection management.
  • Static content handling where required.

27. Production Configuration

Database credentials should not be hardcoded in source code. Environment variables or a secure configuration mechanism should be used.

server.port=8080

spring.datasource.url=jdbc:mysql://localhost:3306/expenditure_db
spring.datasource.username=${DB_USERNAME}
spring.datasource.password=${DB_PASSWORD}

spring.jpa.hibernate.ddl-auto=validate
spring.jpa.show-sql=false

Linux environment variables can be configured separately:

export DB_USERNAME=application_user
export DB_PASSWORD=********

28. Logging & Troubleshooting

Application logs should capture important operational information without exposing sensitive financial or authentication information.

  • Application startup and shutdown.
  • Successful expenditure creation.
  • Validation failures.
  • Database errors.
  • Unexpected exceptions.
  • Authentication/authorization failures.
2026-08-20 10:15:20 INFO
Expenditure created successfully. id=101

2026-08-20 10:20:30 ERROR
Unable to save expenditure

For systemd-managed services, Linux logs can be inspected using:

journalctl -u expenditure

29. Database Backup Strategy

Financial data requires a reliable backup and restoration strategy.

MySQL Database
Scheduled Backup
Separate Storage
Restore Testing
mysqldump expenditure_db > expenditure_backup.sql
  • Automate backups.
  • Store important backups separately from the VPS.
  • Retain backups according to business requirements.
  • Periodically test restoration.

30. Testing Strategy

Unit Testing

  • Service logic.
  • Balance calculation.
  • Validation.
  • Business rules.

Integration Testing

  • Controller to service.
  • Service to repository.
  • Repository to database.
  • End-to-end transaction flow.

API Testing

REST APIs can be tested using tools such as Postman.

UI Testing

  • Search expenditure.
  • Add expenditure.
  • Date selection.
  • Payment mode selection.
  • Empty-result behavior.
  • Consolidated amount.
  • Balance display.

31. Production & Security Practices

  • Use HTTPS in production.
  • Do not expose database ports publicly unless required.
  • Use a dedicated application database user.
  • Do not store database passwords in source code.
  • Validate all financial input.
  • Use BigDecimal for monetary calculations.
  • Use database transactions for multi-step operations.
  • Implement authentication and role-based authorization.
  • Maintain audit information for important financial changes.
  • Configure regular database backups.
  • Monitor application and server logs.
  • Keep the Linux server and application dependencies updated.

32. Interview Explanation

2–3 Minute Project Explanation

I worked on an Expenditure Management System developed using Java 11 and Spring Boot 2.7. The primary objective of the application was to digitize and centralize the organization's expenditure management process.

The system allows authorized users to create expenditure records by providing information such as account head, purpose of payment, payment mode, expenditure amount, expenditure date, paid-by information and payment recipient.

We provided search functionality to retrieve expenditure records and a consolidated expenditure feature to calculate total expenditure for a selected period. The system also displays the total available balance based on the application's financial business rules.

From the technical perspective, the backend follows a layered architecture consisting of Controller, Service, Repository, Entity and DTO layers. Spring Data JPA and Hibernate are used for persistence with MySQL.

The application is packaged as a Spring Boot executable JAR and deployed on a Linux-based VPS server. Nginx can be used as a reverse proxy for HTTPS access. The project also considers validation, exception handling, transaction management, logging, database backup and production deployment practices.

33. Resume Description

Expenditure Management System

Developed and deployed a web-based Expenditure Management System using Java 11, Spring Boot 2.7, Spring Data JPA, Hibernate, MySQL and Linux VPS, enabling organizations to manage expenditure transactions, payment details, consolidated expenses and available balance.

Key Responsibilities

  • Developed REST APIs using Spring Boot 2.7.
  • Implemented expenditure CRUD operations.
  • Implemented expenditure search and filtering.
  • Developed consolidated expenditure calculations.
  • Implemented available balance calculation.
  • Used Spring Data JPA and Hibernate for persistence.
  • Implemented validation and exception handling.
  • Designed DTO-based API communication.
  • Used transactional business operations.
  • Developed database aggregation queries.
  • Deployed the Spring Boot application on a Linux VPS.
  • Configured production application properties and logging.
  • Performed API and integration testing.
  • Supported database backup and production troubleshooting.

34. Project Summary

Expenditure Create and maintain individual financial transactions.
Search Quickly locate expenditure records.
Consolidation Calculate total expenditure for a period.
Balance Display available balance information.

Complete Technology Flow


                         USER
                          |
                          v
                 HTML / CSS / JavaScript
                          |
                          v
                  REST Controller
                          |
                          v
                    Service Layer
                          |
                          v
                  Spring Data JPA
                          |
                          v
                     Hibernate
                          |
                          v
                      MySQL 8
                          |
                          v
                 Financial Records


                PRODUCTION DEPLOYMENT

                    Internet
                       |
                       v
                    Domain
                       |
                       v
                  Nginx / HTTPS
                       |
                       v
                 Linux VPS Server
                       |
                       v
              Spring Boot 2.7 / Java 11
                       |
                       v
                    MySQL 8
                       |
                       v
                  DB Backups
    
Overall Project Value: The application transforms a manual expenditure tracking process into a centralized digital financial management solution, providing transaction management, search, consolidated expenditure calculation and balance visibility in a single system.