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.
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.
3. Project Objectives
- Digitize the expenditure recording process.
- Maintain a centralized expenditure database.
- Provide search and filtering capabilities.
- Record account head and purpose of every payment.
- Track cash, cheque and online payment modes.
- Maintain expenditure date and amount.
- Track the payment source and payment recipient.
- Calculate consolidated expenditure.
- Display available balance information.
- Provide a reliable foundation for reporting and auditing.
4. Functional Modules
5. Technology Stack
| Layer / Component | Technology | Purpose |
|---|---|---|
| Programming Language | Java 11 | Core application development. |
| Backend Framework | Spring Boot 2.7 | REST APIs, configuration and application runtime. |
| Web Layer | Spring MVC / REST | Handle browser/API requests. |
| Persistence | Spring Data JPA | Repository abstraction and CRUD operations. |
| ORM | Hibernate | Object-relational mapping. |
| Database | MySQL 8 | Persistent financial data storage. |
| Build Tool | Maven | Build, dependency management and packaging. |
| Server | Linux VPS | Production hosting environment. |
| Application Runtime | Embedded Tomcat | Runs the Spring Boot application. |
| Reverse Proxy | Nginx | HTTPS termination and reverse proxy where configured. |
| Frontend | HTML, CSS, JavaScript | User interface and client-side interaction. |
| Version Control | Git | Source code management. |
6. Search Expenditure
The Search Expenditure screen shown in the supplied screenshot allows the user to select an expenditure type and search for matching expenditure records.
Screen Components
- Expenditure Type dropdown.
- Search button.
- Add Expenditure action.
- Result table.
- No-record message when there are no matching records.
Result Columns
| Column | Purpose |
|---|---|
| Account Head | Category under which the expenditure is recorded. |
| Purpose Of Payment | Business reason for making the payment. |
| Amount | Amount spent. |
| Date | Date of expenditure. |
| Paid By | Source/entity making the payment. |
| Payment Made To | Person, vendor or organization receiving payment. |
7. Add Expenditure
The Add Expenditure functionality opens the Expenditure Information screen. The user enters the transaction details and submits them for persistence.
8. Expenditure Fields
| Field | Description | Example |
|---|---|---|
| Account Head | Expense category. | Maintenance |
| Purpose of Payment | Reason for expenditure. | Building maintenance |
| Payment Mode Type | Method used to make payment. | Cash / Cheque / Online |
| Expenditure Amount | Financial amount of the transaction. | 15000.00 |
| Expenditure Date | Date on which expense occurred. | 20-08-2026 |
| Paid By | Payment source. | KESHAVA SEVA SAMITHI |
| Payment Made To | Payment recipient. | ABC Maintenance Services |
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.
Example
| Expense | Amount |
|---|---|
| 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.
Total Funds = ₹500,000
Total Expenditure = ₹109,000
--------------------------------
Available Balance = ₹391,000
11. End-to-End Business Workflow
12. Reporting
The system can support several useful financial reports.
13. Application Architecture
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.
| Field | Validation |
|---|---|
| Account Head | Mandatory |
| Purpose | Mandatory |
| Payment Mode | Mandatory and restricted to supported values |
| Amount | Mandatory and greater than zero |
| Expenditure Date | Mandatory |
| Paid By | Mandatory |
| Payment Made To | Mandatory |
@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
}
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());
}
}
| Status | Typical Meaning |
|---|---|
| 400 | Invalid request or validation failure. |
| 401 | Authentication required. |
| 403 | User is not authorized. |
| 404 | Requested record does not exist. |
| 409 | Conflict or duplicate business data. |
| 500 | Unexpected server-side error. |
21. Security
Since the application manages financial information, access control should be implemented according to the actual project requirements.
22. REST APIs
/api/expenditures — Create expenditure/api/expenditures — Retrieve expenditures/api/expenditures/{id} — Retrieve one expenditure/api/expenditures/{id} — Update expenditure/api/expenditures/{id} — Delete expenditure/api/expenditures/search — Search expenditures/api/expenditures/total — Calculate total expenditure/api/expenditures/balance — Retrieve available balance/api/expenditures/report — Generate/report expenditure informationExample 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:
| Column | Purpose |
|---|---|
| id | Primary key. |
| account_head | Expense category. |
| purpose_of_payment | Reason for payment. |
| amount | Financial amount. |
| expenditure_date | Transaction date. |
| payment_mode | Cash, Cheque or Online. |
| paid_by | Payment source. |
| payment_made_to | Payment recipient. |
| created_by | User who created the record. |
| created_date | Creation timestamp. |
| updated_by | User who last updated the record. |
| updated_date | Last update timestamp. |
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.
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.
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
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
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
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