This is a Spring Boot backend API using SQLite as the database with comprehensive CRUD operations for Requests and Audit Events.
- Spring Boot 3.5.7
- Java 21
- SQLite Database
- Spring Data JPA
- Lombok
- Maven
- Request: Manages marketing requests with fields like title, description, status, priority, requestedBy
- AuditEvent: Tracks all system events with eventType, entityType, entityId, eventDetails, performedBy
- RequestRepository: JPA repository for Request entity with custom query methods
- AuditEventRepository: JPA repository for AuditEvent entity with custom query methods
- RequestService: Business logic for Request operations with automatic audit logging
- AuditEventService: Business logic for AuditEvent operations
- CommandCentreController: Single REST controller managing both Request and AuditEvent endpoints
GET /api/auth/success- OAuth success payload (includes JWT)GET /api/auth/user- Current user info (JWT or OAuth)POST /api/auth/bot-token- Issue long-lived bot JWT (requiresX-Bot-Key)
GET /api/requests- Get all requestsGET /api/requests/{id}- Get request by IDGET /api/requests/status/{status}- Get requests by statusGET /api/requests/priority/{priority}- Get requests by priorityGET /api/requests/requestedBy/{requestedBy}- Get requests by userPOST /api/requests- Create a new requestPUT /api/requests/{id}- Update a requestDELETE /api/requests/{id}- Delete a request
GET /api/audit-events- Get all audit eventsGET /api/audit-events/{id}- Get audit event by IDGET /api/audit-events/entity/{entityType}/{entityId}- Get audit events for specific entityGET /api/audit-events/type/{eventType}- Get audit events by typeGET /api/audit-events/user/{performedBy}- Get audit events by userGET /api/audit-events/daterange?start={start}&end={end}- Get audit events by date rangePOST /api/audit-events- Create a manual audit event
- SQLite database file:
marketing_command_centre.db(created automatically in project root) - Hibernate auto-generates tables from entity models
- Audit events are automatically logged for all Request operations (CREATE, UPDATE, DELETE)
- Java 21
- Maven
# Using Maven wrapper
./mvnw clean install
./mvnw spring-boot:run
# Or using Maven directly
mvn clean install
mvn spring-boot:runThe application will start on http://localhost:8080
Configuration can be found in src/main/resources/application.properties.example (copy to application.properties or supply env overrides):
- Database connection settings
- JPA/Hibernate settings
- Discord OAuth + guild requirements
- JWT settings for user and bot authentication (provide a Base64 secret)
✅ RESTful API with JSON responses ✅ Automatic audit logging for all Request operations ✅ SQLite database with JPA/Hibernate ✅ CORS enabled for frontend integration ✅ Lombok for clean code ✅ Spring Security with Discord OAuth + JWT authentication ✅ Comprehensive error handling
- Add validation annotations to models
- Implement custom exception handling
- Add pagination and sorting
- Enable and configure Spring Security
- Add API documentation (Swagger/OpenAPI)
- Write integration tests