You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A production-ready, secure complaint tracking system built using Spring Boot, Java 21, and PostgreSQL, designed to empower students and staff to raise and track environmental or facility-related issues within their campus or organization.
Features
User Registration & JWT-based Authentication
Raise, View, Update, Delete Complaints
Image Upload Support (e.g., for proof/evidence)
Role-based Access Control (User/Admin)
Admin Panel for managing complaints & statuses
Complaint Categories like Waste, Water, etc.
Timestamps for every complaint
Secure Password Storage using BCrypt
Entity Relationship Diagram (ERD)
+---------+ +------------+ +-------------+
| User |<----->| Complaint |<------>| Category |
+---------+ +------------+ +-------------+
| id | | id | | id |
| name | | title | | name |
| email | | description| +-------------+
| password| | imagePath |
| role | | status |
+---------+ | timestamp |
| user_id FK |
| category_id FK |
+-------------+
Tech Stack
Layer
Technology
Backend
Spring Boot
Language
Java 21
Security
Spring Security + JWT
Database
PostgreSQL
ORM
Spring Data JPA
File Upload
upload link for just now
Build Tool
Maven
API Endpoints
Auth
Endpoint
Method
Description
/auth/register
POST
Register new user
/auth/login
POST
Authenticate user
User Complaint
Endpoint
Method
Description
/complaints
POST
Create a new complaint
/complaints
GET
List complaints of logged-in user
/complaints/{id}
GET
Get specific complaint details
/complaints/{id}
PUT
Update complaint (if owner)
/complaints/{id}
DELETE
Delete complaint (if owner)
Admin
Endpoint
Method
Description
/admin/complaints
GET
Get all complaints
/admin/complaints/{id}/status
PUT
Update complaint status
Categories
Endpoint
Method
Description
/categories
GET
List all categories
Security Configuration
/auth/** is publicly accessible
/complaints/** requires USER or ADMIN
/admin/** requires ADMIN role
JWT used for stateless authentication
BCryptPasswordEncoder used for password hashing
How to Run the Project
Prerequisites
Java 21
PostgreSQL (running on default port)
Maven
Setup Instructions
Clone the repository
git clone https://github.com/your-username/ecoaware-backend.git
cd ecoaware-backend