How sentrionic/valkyrie works
Main Components
a. Client-Side (Web Application):
• React Frontend (Primary UI)
• State Management Layer (React Query & Zustand)
• WebSocket Clients (Multiple socket connections for different features)
• API Client Layer (Axios)
b. Server-Side:
• Gin HTTP Server
• WebSocket Hub/Rooms
• Service Layer
• Repository Layer
• Authentication Middleware
c. External Services:
• PostgreSQL Database
• Redis Cache
• AWS S3
• Gmail Service
Key Relationships to Highlight
a. Client-Server Communication:
• HTTP REST APIs (for CRUD operations)
• WebSocket connections (for real-time features)
• File upload pipeline to S3
b. Server-Database Interactions:
• GORM ORM layer between services and PostgreSQL
• Redis for session management and reset tokens
• S3 for file storage
• Frontend | --> | Backend | --> | Databases |
• (React) | | (Go) | | & External |
Detailed Component Breakdown
Frontend Layer:
• React UI |
• Components | |
• State Stores | |
• API Clients | |
• WS Clients | |
Backend Layer:
• Gin Server |
• Handlers | |
• Services | |
• Repositories | |
• WebSocket Hub | |
Important Flows to Illustrate
a. Authentication Flow:
Client -> Auth Handler -> User Service -> Redis/PostgreSQL
b. Real-time Communication:
Client WS -> WS Hub -> Room -> Multiple Clients
c. File Upload:
Client -> Handler -> S3 -> Database Reference