How chuonghoai/smart_space works
SmartSpace is a multi-client messaging and collaboration product with a Spring Boot backend; the README names separate Flutter client, admin, and staff apps but documents no feature-level client flows. The backend’s supported workflow includes authentication, OTP registration, and token refresh, alongside conversation creation and message persistence. The graph preserves other major backend domains visible in the tree, including media, notifications, devices, and reports. Evidence is limited: most of those domain services and their controller wiring were not sampled, so their relationships are not asserted.
Main entry points: AuthenticationService.java Authentication · UserRepository.java User repository · ChatMessageService.java Chat messages · AuthController.java Auth endpoints
Components 25
Flutter apps
- Client app
smartspace_client - Admin app
smartspace_admin - Staff app
smartspace_staff
Identity and profiles
- Auth endpoints
SmartSpace_Backend/src/main/java/com/vn/smart_space/controller/auth/AuthController.java - Authentication
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/auth/AuthenticationService.java - User profiles
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/user/UserService.java - JWT handling
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/jwt/JwtService.java - Auth contracts
SmartSpace_Backend/src/main/java/com/vn/smart_space/dto/request/auth - User entity
SmartSpace_Backend/src/main/java/com/vn/smart_space/model/User.java - User repository
SmartSpace_Backend/src/main/java/com/vn/smart_space/repository/UserRepository.java
Messaging
- Conversations
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/conversation/ConversationService.java - Chat messages
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/chat/ChatMessageService.java - Conversation store
SmartSpace_Backend/src/main/java/com/vn/smart_space/repository/ConversationRepository.java - Message store
SmartSpace_Backend/src/main/java/com/vn/smart_space/repository/ChatMessageRepository.java
Product services
- Media uploads
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/cloudinary/CloudinaryService.java - Device tokens
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/device/DeviceService.java - Notifications
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/notification/NotificationServiceImpl.java - Reports
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/report/ReportServiceImpl.java
Backend platform
- Domain statuses
SmartSpace_Backend/src/main/java/com/vn/smart_space/consts - API exceptions
SmartSpace_Backend/src/main/java/com/vn/smart_space/exception/BadRequestException.java - Revoked-token store
SmartSpace_Backend/src/main/java/com/vn/smart_space/repository/InvalidatedTokenRepository.java
Other components
- App user
- Redis
- Relational database
- Cloudinary
Connections 16
- App user → Client app: uses
- Client app → Auth endpoints: calls
- Auth endpoints → Authentication: delegates to
SmartSpace_Backend/src/main/java/com/vn/smart_space/controller/auth/AuthController.java - Auth endpoints → User profiles: delegates to
SmartSpace_Backend/src/main/java/com/vn/smart_space/controller/auth/AuthController.java - Authentication → User repository: looks up users
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/auth/AuthenticationService.java - Authentication → JWT handling: uses tokens
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/auth/AuthenticationService.java - Authentication → Redis: stores OTP and refresh tokens
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/auth/AuthenticationService.java - User profiles → User repository: reads and saves
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/user/UserService.java - User profiles → Redis: checks OTP verification
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/user/UserService.java - JWT handling → Revoked-token store: checks revocation
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/jwt/JwtService.java - Conversations → User repository: loads participants
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/conversation/ConversationService.java - Conversations → Conversation store: queries and saves
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/conversation/ConversationService.java - Chat messages → User repository: loads sender
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/chat/ChatMessageService.java - Chat messages → Conversation store: checks membership and updates
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/chat/ChatMessageService.java - Chat messages → Message store: saves message
SmartSpace_Backend/src/main/java/com/vn/smart_space/service/chat/ChatMessageService.java - Media uploads → Cloudinary: uploads media