How revaldo007/real-time works
Rivo is a real-time chat product with a React client and FastAPI backend. Users authenticate, then access chats, manage groups and messages, and communicate over a WebSocket; the client also exposes profile and appearance settings. The graph follows the visible client routing and API calls into backend routers, services, and persisted domain models. Some routes and integrations are listed but not excerpted, so uncertain runtime connections are omitted.
Main entry points: main.py FastAPI application · api.js HTTP API client · auth.py Auth routes · App.jsx Application routes
Components 22
Web client
- Application routes
frontend/src/App.jsx - Appearance settings
frontend/src/context/ThemeContext.jsx - HTTP API client
frontend/src/services/api.js
Identity and profile
- Auth state
frontend/src/context/AuthContext.jsx - Auth routes
backend/app/routers/auth.py - User routes
backend/app/routers/users.py - Authentication service
backend/app/services/auth_service.py - Email OTP service
backend/app/services/otp_service.py
Chat and messaging
- Chat state
frontend/src/context/ChatContext.jsx - Chat interface
frontend/src/pages/Chat.jsx - Chat routes
backend/app/routers/chats.py - Group routes
backend/app/routers/groups.py - Message routes
backend/app/routers/messages.py - Chat service
backend/app/services/chat_service.py - Message service
backend/app/services/message_service.py - WebSocket manager
backend/app/websocket/chat_socket.py
Backend API
- FastAPI application
backend/app/main.py - Media routes
backend/app/routers/media.py - Request and response schemas
backend/app/schemas
Persistence
- Domain models
backend/app/models - SQL database
backend/app/database/connection.py
Other components
- Chat user
Connections 34
- Chat user → Application routes: uses
- Application routes → Auth state: provides
frontend/src/App.jsx - Application routes → Appearance settings: provides
frontend/src/App.jsx - Application routes → Chat interface: routes to
frontend/src/App.jsx - Auth state → HTTP API client: requests
frontend/src/context/AuthContext.jsx - Chat state → HTTP API client: requests
frontend/src/context/ChatContext.jsx - Chat interface → Chat state: uses
frontend/src/pages/Chat.jsx - Chat user → Auth state: authenticates
- HTTP API client → Auth routes: calls
frontend/src/services/api.js - HTTP API client → User routes: calls
frontend/src/services/api.js - HTTP API client → Chat routes: calls
frontend/src/services/api.js - HTTP API client → Group routes: calls
frontend/src/services/api.js - HTTP API client → Message routes: calls
frontend/src/services/api.js - HTTP API client → Media routes: calls
frontend/src/services/api.js - FastAPI application → Auth routes: registers
backend/app/main.py - FastAPI application → User routes: registers
backend/app/main.py - FastAPI application → Chat routes: registers
backend/app/main.py - FastAPI application → Group routes: registers
backend/app/main.py - FastAPI application → Message routes: registers
backend/app/main.py - FastAPI application → Media routes: registers
backend/app/main.py - Auth routes → Authentication service: delegates
backend/app/routers/auth.py - Auth routes → Email OTP service: requests OTP
backend/app/routers/auth.py - Chat routes → Chat service: delegates
backend/app/routers/chats.py - Group routes → Chat service: delegates
backend/app/routers/groups.py - Message routes → Message service: delegates
backend/app/routers/messages.py - FastAPI application → WebSocket manager: dispatches events
backend/app/main.py - Authentication service → Domain models: queries users
backend/app/services/auth_service.py - Chat service → Domain models: manages chats
backend/app/services/chat_service.py - Message service → Domain models: manages messages
backend/app/services/message_service.py - Auth routes → Request and response schemas: validates
backend/app/routers/auth.py - Chat routes → Request and response schemas: validates
backend/app/routers/chats.py - Message routes → Request and response schemas: validates
backend/app/routers/messages.py - SQL database → Domain models: registers tables
backend/app/database/connection.py - FastAPI application → SQL database: opens sessions
backend/app/main.py