How shashikantbadgujarpm/chat-app works
This is a real-time team chat application with a React client and FastAPI backend. The main workflow is sign-in, conversation selection, message submission, persistence, and delivery to connected members; separate workflows cover profiles, presence and typing, read cursors, and scheduled delivery. The backend is organized around domain modules with application services and infrastructure repositories, plus a realtime gateway. Some backend routes and wiring are unsampled, so the graph omits uncertain links rather than inferring call chains.
Main entry points: client.ts REST client · App.tsx App and routes · main.py FastAPI app · ChatSocket.ts WebSocket client
Components 29
React client
- App and routes
frontend/src/App.tsx - Auth UI
frontend/src/features/auth/AuthContext.tsx - Conversation views
frontend/src/features/conversations/ConversationPanel.tsx - Message pane
frontend/src/features/messages/MessagePane.tsx - Presence UI
frontend/src/features/presence/presence.ts - Schedule views
frontend/src/features/scheduled/ScheduledPanel.tsx - Profile and search
frontend/src/features/users/ProfilePages.tsx - REST client
frontend/src/api/client.ts - WebSocket client
frontend/src/ws/ChatSocket.ts
Identity and profiles
- Identity API
backend/app/modules/identity/api/routers.py - Identity services
backend/app/modules/identity/application/services.py - Identity repositories
backend/app/modules/identity/infrastructure/user_repository.py
Conversations and messaging
- Conversation API
backend/app/modules/conversations/api/router.py - Conversation service
backend/app/modules/conversations/application/conversation_service.py - Conversation repository
backend/app/modules/conversations/infrastructure/repository.py - Messaging API
backend/app/modules/messaging/api/routers.py - Messaging service
backend/app/modules/messaging/application/messaging_service.py - Message repository
backend/app/modules/messaging/infrastructure/repository.py
Realtime delivery
- Presence and typing
backend/app/modules/presence/application/presence_service.py - WebSocket gateway
backend/app/realtime/gateway.py - Connection fan-out
backend/app/realtime/connection_manager.py - Outbox listener
backend/app/realtime/outbox_listener.py
Scheduled messages
- Scheduling API
backend/app/modules/scheduling/api/router.py - Scheduling service
backend/app/modules/scheduling/application/scheduling_service.py - Scheduled delivery
backend/app/modules/scheduling/application/delivery_service.py - Scheduled repository
backend/app/modules/scheduling/infrastructure/repository.py
Other components
- Chat user
- FastAPI app
backend/app/main.py - PostgreSQL
Connections 36
- Chat user → App and routes: uses
- App and routes → Auth UI: routes
- App and routes → Conversation views: routes
- App and routes → Schedule views: routes
- App and routes → Profile and search: routes
- Auth UI → REST client: requests
- Conversation views → REST client: requests
- Message pane → REST client: requests
- Presence UI → WebSocket client: signals
- Message pane → WebSocket client: receives events
- Schedule views → REST client: requests
- Profile and search → REST client: requests
- REST client → FastAPI app: HTTP requests
- WebSocket client → WebSocket gateway: opens socket
- FastAPI app → Identity API: mounts routes
- FastAPI app → Conversation API: mounts routes
- FastAPI app → Messaging API: mounts routes
- FastAPI app → Scheduling API: mounts routes
- Identity API → Identity services: invokes
- Identity services → Identity repositories: reads and writes
- Identity repositories → PostgreSQL: persists identity
- Conversation API → Conversation service: invokes
- Conversation service → Conversation repository: reads and writes
- Conversation repository → PostgreSQL: persists membership
- Messaging API → Messaging service: invokes
- Messaging service → Message repository: reads and writes
- Message repository → PostgreSQL: persists messages
- WebSocket gateway → Connection fan-out: manages sockets
- Connection fan-out → Presence and typing: connection callbacks
- Outbox listener → PostgreSQL: reads committed events
- Outbox listener → Connection fan-out: fans out events
- Scheduling API → Scheduling service: invokes
- Scheduling service → Scheduled repository: reads and writes
- Scheduled repository → PostgreSQL: persists schedules
- Scheduled delivery → Scheduled repository: claims due rows
- Scheduled delivery → Messaging service: creates delivered message