A secure and scalable backend system for managing financial records with role-based access control (RBAC), built using Spring Boot.
This project simulates a real-world finance dashboard backend where users interact with financial data based on their roles. It demonstrates backend architecture, API design, authentication, authorization, and data aggregation.
finance-backend/
│── src/ # Source code (controllers, services, entities, security)
│── postman_collection/ # Postman collection for API testing
│── pom.xml # Maven configuration
│── mvnw / mvnw.cmd # Maven wrapper
│── .gitignore # Ignored files
│── LICENSE
│── README.md
- Secure REST APIs with JWT authentication
- Role-Based Access Control (ADMIN / ANALYST / VIEWER)
- Financial data aggregation (income, expense, balance)
- Swagger API documentation with JWT support
- Clean layered architecture
- Java 21
- Spring Boot 3.3.x
- Spring Security (JWT Authentication)
- Spring Data JPA (Hibernate)
- MySQL
- Maven
- Swagger (OpenAPI) - SpringDoc OpenAPI 2.x.x
- JWT-based authentication
- Stateless session management
- Role-Based Access Control (RBAC)
| Role | Permissions |
| ------- | ------------------------------------ |
| ADMIN | Full access (CRUD + user management) |
| ANALYST | Read records + dashboard |
| VIEWER | Read-only access |
| Code | Meaning |
|------|-----------------------|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 500 | Internal Server Error |
- Create users
- Assign roles
- Activate/Deactivate users
- Role-based restrictions
- Create, update, delete records
- View all records
- Pagination support (page, size and type)
- Filtering by record type (INCOME / EXPENSE)
- Category-based classification
- Ownership-based update restriction
- Total Income
- Total Expense
- Net Balance
- Category-wise aggregation
- JWT authentication
- Custom UserDetailsService
- Method-level authorization (
@PreAuthorize) - Secure API endpoints
- Input validation using
@Valid - Global exception handling
- Structured error responses
Swagger UI: This project uses Swagger (springdoc-openapi) to provide interactive API documentation.
--> http://localhost:8080/swagger-ui/index.html
Below are screenshots of the Swagger UI for this project:

Import the provided collection:
email: [admin@test.com] password: Admin@test1234
email: [analyst@test.com] password: Analyst@test1234
email: [viewer@test.com] password: Viewer@test1234
git clone https://github.com/Anuj-Kumar-1952/Finance-Data-Processing-and-Access-Control-Backend
cd finance-backend
Rename:
application-example.properties → application.properties
Update with your credentials:
spring.datasource.url=jdbc:mysql://localhost:3306/your_database_name
spring.datasource.username=YOUR_USERNAME
spring.datasource.password=YOUR_PASSWORD
app.jwt.secret=YOUR_SECRET_KEY
app.jwt.expiration-ms=3600 # JWT token valid for 1 hour
mvn spring-boot:run
http://localhost:8080/swagger-ui/index.html
- Layered architecture (Client -> Security Filter Layer -> Controller -> DTO <-MAPPINGS-> Entity -> Service → Repository)
- JWT-based stateless authentication
- RBAC using Spring Security
- Ownership validation for secure updates
- Centralized exception handling
Anuj Kumar ak1952002@gmail.com
This project was built to simulate a real-world finance dashboard, showcasing backend engineering skills such as API design, security implementation, and data processing.
