How vanter-tech/null works
1. Repository shape
- This is a monorepo with three deployable pieces:
- null_services_frontend: Angular client, also wrapped by Tauri for desktop packaging.
- null_services_backend: Spring Boot monolith exposing the domain API and real-time services.
- null_services_gateway: a separate Spring Boot gateway/edge service.
2. Top-level request path
- Client traffic starts at the gateway or directly at the backend depending on deployment.
- The backend is the system of record for auth, chat, social graph, and voice/session state.
- The frontend talks to the backend through generated REST clients, plus WebSocket connections for live updates.
3. Backend architecture
- The backend follows a classic controller → service → repository structure.
- Domain packages are split by feature: auth, user, role, server, conversation, message, friends, voice, email, kafka, websocket, security, and handler.
- Persistence is handled through repository interfaces, with MongoDB as the main datastore.
4. Identity and security boundary
- Authentication is JWT-based.
- SecurityConfig, JwtFilter, JwtService, and UserDetailServiceImpl form the security layer.
- auth handles registration, login, and activation flows; user, role, and token model account state and issued tokens.
- GlobalExceptionHandler and business error codes centralize API error responses.
5. Core chat domain
- The chat model is split into:
- Servers and Channels for Discord-style communities.
- Conversations for direct or scoped dialogs.
- Messages for persisted chat content.
- Friends for social relationships and requests.
- Controllers expose CRUD and workflow endpoints, while services enforce business rules and membership/access checks.
6. Real-time communication
- The backend contains a dedicated websocket package with configuration and event listeners.
- This is the live-update path for presence, messaging, and likely channel/server state changes.
- The frontend has a WebSocket client service, so the architecture supports both REST for state changes and WebSockets for push updates.
7. Asynchronous/event-driven path
- Kafka is used as an internal decoupling layer via MessageProducer and MessageConsumer.
- This likely supports notifications, email dispatch, and other side effects that should not block user-facing requests.
- The design separates command handling in the API from async processing in the event pipeline.
8. Email and account activation
- The backend includes an EmailService and HTML template resources for activation mail.
- The README indicates OTP/account activation emails are sent as part of the registration flow.
- This is a side-channel workflow triggered by auth events, not by direct UI polling.
9. Voice subsystem
- Voice support is modeled separately from text chat.
- The backend has VoiceController, VoicePresenceController, VoicePresenceService, and LiveKitService.
- This suggests an external or dedicated LiveKit-style service handles media transport, while the backend manages join/presence/control state.
10. Frontend structure
- The Angular client is feature-oriented:
- pages/login, pages/register, pages/activate-account for auth entry.
- modules/chat for the main application surface.
- Chat is further split into server, DM, member, user-panel, and modal components, which mirrors the backend domain boundaries.
11. Frontend integration layer
- The frontend includes a generated API client under src/app/services/api.
- That client contains typed models and services for authentication, users, servers, conversations, friends, messages, and voice.
- Supporting services include:
- HTTP token interception,
- route guarding,
- local auth/token management,
- modal and navigation helpers,
- WebSocket client integration.
12. Packaging and runtime
- Angular is the primary UI runtime; Tauri suggests a desktop wrapper around the same frontend.
- The backend and gateway are standard Maven/Spring Boot applications.
- Local development is container-oriented, with docker-compose.yml used to coordinate supporting infrastructure.
13. Infrastructure dependencies
- The README and file tree point to MongoDB, Kafka, and a local SMTP environment such as Maildev/Mailhog.
- Those services form the non-application backbone for persistence, async processing, and email verification.
- The architecture is therefore: UI client → gateway/backend → MongoDB/Kafka/SMTP/voice service, with WebSockets for live state propagation.
14. Diagramming summary
- A useful architecture diagram should show:
- the Angular/Tauri client as the user-facing shell,
- the gateway as the edge entrypoint,
- the Spring Boot backend as the domain core,
- MongoDB as persistent storage,
- Kafka as async event bus,
- SMTP for activation mail,
- WebSocket/LiveKit paths for real-time chat and voice.
Main entry points: NullApplication.java Backend App · app Angular UI · api API Client · email Email Service
Components 20
Frontend
Angular client packaged with Tauri for desktop use.
- Angular UI · Primary user-facing application shell and route entry.
null_services_frontend/src/app - Chat Module · Main chat experience with server, DM, member, and voice views.
null_services_frontend/src/app/modules/chat - API Client · Typed client layer for backend endpoints, models, auth, and websocket integration.
null_services_frontend/src/app/services/api - Tauri Shell · Native desktop packaging around the Angular frontend.
null_services_frontend/src-tauri - Auth Pages · Login, register, and account activation entry screens.
null_services_frontend/src/app/pages
Gateway
Edge Spring Boot service for routing and deployment entry.
- Gateway App · Separate Spring Boot gateway used as an edge entrypoint.
null_services_gateway/src/main/java/com/fer/null_services_gateway/NullServicesGatewayApplication.java
Backend
Domain Spring Boot monolith with REST, realtime, and async processing.
- Backend App · Domain core that serves REST APIs, realtime events, and async handlers.
null_services_backend/src/main/java/com/example/demo/NullApplication.java - Security · JWT filter, token service, user details, and security configuration.
null_services_backend/src/main/java/com/example/demo/security - Auth API · Registration, login, and activation workflows.
null_services_backend/src/main/java/com/example/demo/auth - Identity · User, role, token, and status persistence for identity management.
null_services_backend/src/main/java/com/example/demo/user - Chat Domain · Servers, channels, conversations, messages, and friends boundaries.
null_services_backend/src/main/java/com/example/demo/server - Realtime · WebSocket configuration and event listeners for live updates.
null_services_backend/src/main/java/com/example/demo/websocket - Kafka Flow · Producer and consumer for internal decoupling and side effects.
null_services_backend/src/main/java/com/example/demo/kafka - Email Service · HTML template-driven email delivery for account activation and notifications.
null_services_backend/src/main/java/com/example/demo/email - Voice · Voice join, presence, and LiveKit integration for media sessions.
null_services_backend/src/main/java/com/example/demo/voice - API Errors · Centralized business error codes and global exception mapping.
null_services_backend/src/main/java/com/example/demo/handler
Infrastructure
External datastores and side services used by the applications.
- MongoDB · Primary persistence for users, chat state, tokens, and related domain records.
- Kafka · Internal asynchronous message transport.
- SMTP · Outbound email channel for activation and related messages.
- LiveKit · External voice/media transport used by the backend voice subsystem.
Connections 23
- Angular UI → Auth Pages: routes to · Authentication entry screens are part of the UI flow.
- Angular UI → Chat Module: hosts · Main application shell contains the chat workspace.
- Angular UI → API Client: uses · UI calls backend through generated API services and models.
- Angular UI → Tauri Shell: packaged by · Same Angular app can be wrapped for desktop runtime.
- API Client → Gateway App: calls · Client can talk to the gateway as edge entrypoint.
- API Client → Backend App: calls · Client can also talk directly to backend depending on deployment.
- API Client → Realtime: websocket · Frontend websocket client connects for live updates.
- Gateway App → Backend App: routes to · Gateway forwards domain traffic to the backend core.
- Backend App → Security: protects with · Security layer gates API access with JWT validation.
- Backend App → Auth API: exposes · Authentication controller and service handle signup/login/activation.
- Backend App → Identity: manages · User, role, token, and status state are persisted here.
- Backend App → Chat Domain: owns · Servers, channels, conversations, messages, and friends live in the domain core.
- Backend App → Realtime: pushes · WebSocket layer publishes live state changes and events.
- Backend App → Kafka Flow: emits · Domain actions can be handed off to async processing.
- Backend App → Email Service: triggers · Registration and activation flows send mail through this service.
- Backend App → Voice: coordinates · Voice join and presence control are handled separately from text chat.
- Backend App → API Errors: formats errors · Central handler maps business failures into API responses.
- Identity → MongoDB: persists to · Users, roles, and tokens are stored in MongoDB.
- Chat Domain → MongoDB: persists to · Chat and social graph data is stored in MongoDB.
- Auth API → Email Service: sends via · Activation flow relies on email delivery.
- Kafka Flow → Kafka: publishes/consumes · Producer and consumer connect the backend to Kafka.
- Email Service → SMTP: delivers via · Emails are sent through SMTP infrastructure.
- Voice → LiveKit: integrates with · Media transport is handled by an external LiveKit-style service.