Defect Management is a robust Spring Boot application designed to orchestrate the software testing lifecycle. It provides a secure, role-based RESTful API for tracking bugs, managing resolutions, and maintaining a transparent audit trail of project defects.
- Spring Boot 3.2.2
- Spring Data JPA (Persistence Layer)
- Spring Web (RESTful Services)
- Spring Security 6 (JWT & RBAC)
- Spring AOP (Audit & Logging)
- PostgreSQL (Production - Azure Flexible Server)
- H2 Database (Local Development & Testing)
- jjwt 0.11.5 (JSON Web Tokens)
- springdoc-openapi 2.4.0 (Swagger UI)
- Lombok
- SLF4J
- Hibernate Validator
- Java 17 (LTS)
- Maven 3.8+
- PostgreSQL (Optional for local setup)
git clone https://github.com/krtksharma/defect-tracker-backend.git cd defect-tracker-backend
Update src/main/resources/application-azure.yml or set environment variables:
spring:
datasource:
url: jdbc:postgresql://${DB_HOST}:5432/${DB_NAME}
username:
mvn clean install mvn spring-boot:run
http://localhost:8080/swagger-ui/index.html
- URL:
/api/users/login - Method:
POST - Description: Validates credentials and returns a Bearer Token
Request Body: { "userName": "tester", "password": "password123" }
Response (200 OK): { "token": "eyJhbG...", "role": "ROLE_TESTER" }
- Endpoint:
POST /api/defects/new - Role: Tester
- Features:
- Daily assignment limits
- Automatic SLA calculation
- Endpoint:
PUT /api/defects/resolve - Role: Developer
- Features:
- Status transition
- Resolution history tracking
- Endpoint:
GET /api/defects/getAll - Description: Fetch all active and closed defects
- Endpoint:
POST /api/defects/{id}/attachments - Constraint: Max file size 10MB
- Endpoint:
GET /api/defects/{id}/history - Description: Retrieve immutable audit logs
-
Stateless Authentication: Uses JWT for scalable, session-less security across distributed systems.
-
Persistence Strategy: Optimized for PostgreSQL with fallback to H2 for easy onboarding.
-
Persistent Storage: Uses
/homedirectory in Azure App Service Linux to persist file uploads across restarts. -
Aspect-Oriented Programming (AOP): Clean separation of audit logging from business logic.
Kartik Sharma