A production-inspired Complaint Management System built with Spring Boot, designed around secure authentication, role-based access control, complaint lifecycle management, asynchronous event processing, and real-time notifications.
The project demonstrates modern backend engineering practices including:
- JWT Authentication & Refresh Token Rotation
- Spring Security
- Role-Based Access Control (RBAC)
- Soft Delete Account Recovery
- Event-Driven Email Notifications
- Real-Time WebSocket Updates
- Cloudinary File Management
- Dockerized Deployment
- Feature-Based Architecture
- Global Exception Handling
- Pagination & Filtering
- Transaction Management
Client
|
v
Spring Security Filter Chain
|
v
JWT Authentication Filter
|
v
Controllers
|
v
Services
|
v
Repositories
|
v
MySQL Database
Authentication
│
├── Registration
├── Login
├── OTP Verification
├── Forgot Password
├── Refresh Token
└── Account Recovery
User Profile
│
├── Profile Management
├── Image Upload
├── Image Removal
└── Cloudinary Integration
Complaint Management
│
├── Create Complaint
├── Update Complaint
├── Track Complaint
├── Complaint History
├── Attachments
└── Complaint Analytics
Administration
│
├── Complaint Assignment
├── Complaint Monitoring
├── User Monitoring
├── Status Management
└── Admin Management
Notification System
│
├── Async Email Events
├── Event Listeners
└── WebSocket Notifications
User
|
v
Send OTP
|
v
Verify OTP
|
v
Registration Request
|
v
Check Existing User
|
+----------------------------+
| |
| ACTIVE |
| |
+--> Registration Blocked
|
| DELETED
|
+--> Restore Existing Account
|
| BLOCKED / SUSPENDED
|
+--> Registration Blocked
|
v
Password Hashing
|
v
Create User
|
v
Create User Profile
|
v
Publish Registration Event
|
v
Async Welcome Email
One of the key features of this project is Account Recovery using Soft Delete.
Instead of permanently deleting user records:
ACTIVE
|
DELETE
|
v
DELETED
When the same user attempts registration again:
User Exists?
|
v
Status = DELETED
|
v
Restore Existing Account
|
v
Update User Data
This preserves historical records while allowing account recovery.
User Login
|
v
Email Exists?
|
+--> No -> Invalid Credentials
|
v
Account Deleted?
|
+--> Yes -> Account Deleted
|
v
Account Active?
|
+--> No -> Account Blocked/Suspended
|
v
Password Match?
|
+--> No -> Invalid Credentials
|
v
Generate Tokens
|
+--> Access Token
|
+--> Refresh Token
|
v
Store Refresh Token
|
v
Return Tokens
Contains:
- Roles
- Authorities
Purpose:
- API Authorization
Expiration:
- Short Lived
Contains:
Purpose:
- Generate New Access Token
Expiration:
- Long Lived
Stored in:
- Database
Security:
- Refresh Token Rotation
- Refresh Token Revocation
Refresh Request
|
v
Validate Token Type
|
v
Load User
|
v
Compare DB Refresh Token
|
+--> Invalid
|
v
Generate New Tokens
|
v
Replace Old Refresh Token
|
v
Return New Tokens
User
|
| One-To-One
|
v
UserProfile
User
|
| One-To-Many
|
v
Complaint
Complaint
|
| One-To-Many
|
v
ComplaintLog
Complaint
|
| One-To-Many
|
v
ComplaintAttachment
User Creates Complaint
|
v
Ticket Generated
|
v
Complaint Submitted
|
v
Assigned To Admin
|
v
In Progress
|
v
Resolved
|
v
History Preserved
Each complaint maintains:
- Unique Ticket ID
- Complaint Logs
- Status History
- Admin Actions
- Attachments
- Resolution Information
WebSocket notifications are used for:
Super Admin
|
Assign Complaint
|
+--> Notify Assigned Admin
|
+--> Notify User
Admin
|
Update Status
|
v
User Notification
Cloudinary is used for:
- Upload Image
- Update Image
- Remove Image
- Upload Evidence
- Replace Attachments
- Remove Attachments
The project uses:
- ApplicationEventPublisher
- Event Listeners
- Async Processing
Purpose:
User Registration
|
Publish Event
|
v
Background Email Processing
|
v
Immediate API Response
The user does not wait for email delivery before receiving the API response.
- Spring Security
- JWT Authentication
- Refresh Token Rotation
- Password Encryption
- Role-Based Authorization
- Endpoint Protection
- Method Level Security
- Secure OTP Verification
SUPER_ADMIN
|
+--> Manage Users
|
+--> Manage Admins
|
+--> Assign Complaints
|
+--> Monitor System
ADMIN
|
+--> Handle Assigned Complaints
|
+--> Update Complaint Status
USER
|
+--> Create Complaint
|
+--> Track Complaint
|
+--> Manage Profile
Feature-based branching strategy was followed throughout development.
main
├── feature/auth
├── feature/user-profile
├── feature/complaint
├── feature/async-events
├── feature/global-exception-handler
└── feature/docker-setup
This structure helps isolate development work and keeps the main branch stable.
- Java
- Spring Boot
- Spring Security
- Spring Data JPA
- Hibernate
- MySQL
- JWT
- Refresh Tokens
- WebSocket
- Cloudinary
- Docker
- Docker Compose
- Java Mail
- Async Event Processing
Detailed API documentation will be added here.
Authentication APIs
User Profile APIs
Complaint APIs
Admin APIs
Super Admin APIs
Notification APIs
- Redis Caching
- Background Complaint Analytics
- Scheduled Reports
- Audit Dashboard
- API Rate Limiting
- Monitoring & Metrics
- CI/CD Pipeline
Pankaj Tirdiya
Java Backend Developer
GitHub: https://github.com/p-a-n-k-a-j