System Architecture Overview
OmniNet follows a microservices architecture where each domain is independently deployable, communicating via gRPC (synchronous RPC), Apache Kafka (asynchronous events), and WebSocket (real-time messaging).
High-Level System Diagram
Request Lifecycle — REST / SSE
Request Lifecycle — WebSocket Chat
Design Principles
Database-per-Service
Each service owns its own isolated PostgreSQL database. No direct cross-service DB queries.
| Service | Language | Database |
|---|---|---|
| auth-service | Java | omninet_auth |
| storage-service | Java | omninet_storage |
| notes-service | Java | omninet_notes |
| ai-service | Java | omninet_ai |
| chat-service | Go | omninet_chat |
Dual Entry Points
| Traffic Type | Entry Point | Auth Method |
|---|---|---|
| HTTP / SSE / REST | API Gateway :8080 | JWT validated by Gateway → header enrichment |
| WebSocket | Chat Service :8085 | JWT validated directly by Chat Service |
Synchronous — gRPC
Low-latency service-to-service calls (file ops, user lookup) use gRPC with Protobuf contracts.
Asynchronous — Kafka
USER_CREATED → Storage provisions folders + Notes provisions categories. File/note/todo lifecycle events.
Real-Time — WebSocket + Redis Pub/Sub
Chat messages delivered locally; Redis Pub/Sub fans out across multiple Chat Service instances for horizontal scaling.