How nxvxrloseee/coursework works
1. This repository is a multi-client repair-service platform with one shared backend and two user-facing clients. The backend is the system of record; the React web app is for master/admin workflows, and the Flutter app is for customers.
2. The backend lives in RD/ and is a Spring Boot 3.5 application on JDK 17. It uses PostgreSQL with JPA/Hibernate as the main persistence layer, and ddl-auto=update indicates the schema is managed from entities rather than migrations. The backend is containerized and meant to run with its supporting services through docker-compose.yml.
3. The backend’s core domain is ticket-centric. The main entities model users, roles, ticket categories, tickets, ticket services, status history, ticket messages, media attachments, services/price items, and notifications. That gives the architecture a clear transactional boundary around “repair ticket lifecycle” plus supporting catalog and communication data.
4. The request boundary is REST controllers in controller/, backed by service-layer orchestration in service/ and repository access in repository/. The important services are TicketManagementService, ChatService, DashboardService, NotificationService, UserService, AuthService, FileService, and PriceListService, which map closely to the business areas exposed by the clients.
5. Authentication and authorization are centralized in security/ with JWT-based auth (JwtProvider, JwtFilter) and SecurityConfig. The README notes refresh handling via httpOnly cookie and bcrypt password hashing, so the auth boundary is stateful at the browser/app edge but stateless in the main request pipeline.
6. Real-time communication is a separate subsystem. WebSocketConfig and the chat DTOs/controllers indicate STOMP-based WebSocket messaging for ticket chat and live updates. This sits alongside REST, not inside it, so chat is likely a mixed model: REST for history/state, WS for live message delivery.
7. Async/infrastructure integrations are first-class in the backend config: RabbitConfig, RedisConfig, and MinioConfig. RabbitMQ and Redis support cross-cutting concerns such as notifications and transient state/caching, while MinIO handles file/object storage for ticket media and uploaded artifacts. FileController and FileService are the boundary for that object-storage flow.
8. NotificationController, NotificationService, and the notification DTOs/entities form a dedicated notification pipeline. The mobile client also has a push_service, so the system likely combines backend-generated notification events with device push delivery on the customer side.
9. The dashboard subsystem is isolated around DashboardController/DashboardService and returns analytics DTOs such as revenue points and summary responses. This implies a reporting/read-optimized path separate from the transactional ticket CRUD path, which is important for diagramming read vs write responsibilities.
10. DataSeeder indicates the backend bootstraps initial reference data, likely roles/categories/services, so some parts of the domain are initialized automatically at startup. GlobalExceptionHandler and ApiException define the error boundary and consistent API failure responses.
11. rd-master/ is the operator UI built with React, Vite, and TypeScript. It consumes the backend through dedicated API modules (src/api/*), uses a client wrapper, maintains auth and notification state in stores, and includes a WebSocket hook for live ticket/chat updates. Its pages map directly to backend domains: dashboard, tickets, history, notifications, services, profile, login, and ticket detail.
12. rd-customer/ is the customer-facing Flutter app targeting Android/iOS and other Flutter platforms. It has its own API layer and screens for login/register, ticket creation, ticket history/details, notifications, profile, and guest access. This client is narrower than the web app and focuses on self-service ticket submission and chat follow-up.
13. Operationally, the system is packaged for local/container deployment. RD/docker-compose.yml brings up the backend plus PostgreSQL, Redis, RabbitMQ, MinIO, and the web frontend, while backup.sh supports PostgreSQL dump/restore workflows. That makes the deployment topology a small service stack centered on the Spring backend rather than a distributed microservice mesh.
Main entry points: controller REST API · main.dart Flutter app · config Config · RdApplication.java RD app
Components 21
Spring backend
Shared system of record for tickets, users, chat, notifications, and reporting.
- RD app · Backend application entrypoint and composition root.
RD/src/main/java/com/cw/rd/RdApplication.java - Config · Application bootstrap, storage, messaging, security, and realtime configuration.
RD/src/main/java/com/cw/rd/config - REST API · REST boundary for auth, tickets, users, catalog, files, notifications, and dashboard.
RD/src/main/java/com/cw/rd/controller - WebSocket · Live chat and update channel alongside REST.
RD/src/main/java/com/cw/rd/config/WebSocketConfig.java - Services · Core orchestration for tickets, chat, auth, users, files, notifications, pricing, and dashboard.
RD/src/main/java/com/cw/rd/service - Domain model · Users, roles, tickets, ticket lifecycle, catalog items, messages, media, and notifications.
RD/src/main/java/com/cw/rd/entity - Repositories · Persistence access for ticketing, users, catalog, messages, status history, and notifications.
RD/src/main/java/com/cw/rd/repository - Security · JWT filters, token provider, and Spring security configuration.
RD/src/main/java/com/cw/rd/security - API models · Request and response payloads for auth, tickets, chat, dashboard, services, notifications, and users.
RD/src/main/java/com/cw/rd/dto - Infra config · Redis, RabbitMQ, MinIO, seeding, and storage wiring.
RD/src/main/java/com/cw/rd/config - Errors · API exception types and global response handling.
RD/src/main/java/com/cw/rd/exception
Admin web
React operator console for master workflows and live support.
- Master UI · Operator web client for administration and live support.
rd-master/src/App.tsx - Web API · Typed API wrappers for backend domains.
rd-master/src/api - Web state · Auth, notification, and websocket state management.
rd-master/src/store - Web pages · Dashboard, tickets, history, notifications, services, profile, login, and detail screens.
rd-master/src/pages
Customer app
Flutter self-service client for customers.
- Flutter app · Customer-facing self-service application.
rd-customer/lib/main.dart - App API · Customer app HTTP clients for auth, tickets, chat, notifications, services, categories, and users.
rd-customer/lib/api - App screens · Login, register, ticket creation, ticket history/detail, notifications, profile, guest access, and tickets.
rd-customer/lib/screens - Push service · Customer-side push notification integration.
rd-customer/lib/services/push_service.dart
Deployment
Containerized local/runtime stack and supporting services.
- Compose stack · Local deployment stack for backend and support services.
RD/docker-compose.yml - Backup script · Database dump and restore helper.
RD/backup.sh
Connections 27
- RD app → Config: bootstraps · Main application loads infrastructure and feature wiring.
- RD app → REST API: serves · Application exposes REST endpoints through controllers.
- RD app → Services: uses · Business workflows are implemented in service layer.
- Config → Security: enables · Security is configured as part of application setup.
- Config → WebSocket: enables · WebSocket/STOMP messaging is configured centrally.
- Config → Infra config: wires · Messaging, cache, object storage, and seeding are initialized here.
- REST API → API models: maps · Controllers exchange typed request and response models.
- REST API → Services: delegates · HTTP handlers orchestrate through business services.
- Services → Domain model: reads/writes · Services operate on ticket, user, message, notification, and catalog entities.
- Services → Repositories: persists · Services use repositories for database access.
- Repositories → Domain model: stores · Repositories manage the JPA entity model.
- Security → REST API: guards · JWT-based auth protects request handling.
- Errors → REST API: handles · Global exception handling shapes API failures.
- REST API → WebSocket: publishes · Chat and live updates are exposed through realtime endpoints.
- Master UI → Web API: calls · React UI uses dedicated API modules.
- Master UI → Web state: uses · Web auth, notification, and websocket state live in stores and hooks.
- Master UI → Web pages: renders · Operator workflows are organized as route pages.
- Web API → REST API: consumes · Frontend API client targets backend REST controllers.
- Web state → WebSocket: subscribes · Web client listens for live chat and update events.
- Flutter app → App API: calls · Flutter UI uses client API wrappers.
- Flutter app → App screens: renders · Customer journeys are implemented as screens.
- Flutter app → Push service: receives · Mobile app integrates device push notifications.
- App API → REST API: consumes · Customer API layer talks to backend REST endpoints.
- Flutter app → WebSocket: listens · Customer chat flow can use realtime updates where available.
- Compose stack → RD app: runs · Docker compose brings up the backend service.
- Compose stack → Infra config: provisions · Compose stack includes PostgreSQL, Redis, RabbitMQ, and MinIO.
- Backup script → Compose stack: supports · Backup script complements the deployed database stack.