How raushan291/messaging-platform works
Messaging-platform provides account registration and token-based authentication alongside conversations, persistent messages, WebSocket chat, and message search/indexing. Users enter through the frontend; auth and messaging are separate backend services. Messaging publishes message events to Kafka, whose consumer broadcasts them to connected clients and indexes them for search. The excerpts show these backend paths, but not detailed frontend component wiring or the search-query implementation, so those links are limited. Redis and Elasticsearch roles are documented or referenced, but some integration details are unsampled.
Main entry points: auth_routes.py Auth routes · auth_service.py Auth operations · kafka.py Kafka events · main.py Messaging app
Components 24
Web client
- Web app
frontend/app/chat/page.tsx - API client
frontend/lib/api.ts - WebSocket client
frontend/lib/websocket.ts
Authentication
- Auth routes
backend/services/auth-service/app/api/v1/auth_routes.py - Auth operations
backend/services/auth-service/app/services/auth_service.py - User repository
backend/services/auth-service/app/repositories/user_repo.py - Refresh-token repository
backend/services/auth-service/app/repositories/refresh_token_repo.py - Password security
backend/services/auth-service/app/core/security.py - JWT handling
backend/services/auth-service/app/core/jwt.py
Messaging
- Messaging app
backend/services/messaging-service/app/main.py - Conversations
backend/services/messaging-service/app/api/v1/conversation_routes.py - Message HTTP API
backend/services/messaging-service/app/api/v1/message_routes.py - WebSocket chat
backend/services/messaging-service/app/api/v1/ws_routes.py - Room broadcasts
backend/services/messaging-service/app/services/websocket_manager.py - Search API
backend/services/messaging-service/app/api/v1/search_routes.py - Message indexer
backend/services/messaging-service/app/services/search_service.py
Data and events
- Auth database
backend/services/auth-service/app/db/session.py - Messaging database
backend/services/messaging-service/app/db/session.py - Kafka events
backend/services/messaging-service/app/core/kafka.py - PostgreSQL
- Redis
- Kafka broker
- Elasticsearch
Other components
- User
Connections 30
- User → Web app: uses
README.md - Web app → API client: requests
- Web app → WebSocket client: opens chat
- API client → Auth routes: calls auth API
README.md - API client → Conversations: calls messaging API
README.md - WebSocket client → WebSocket chat: connects
README.md - Auth routes → Auth operations: invokes
backend/services/auth-service/app/api/v1/auth_routes.py - Auth routes → Refresh-token repository: revokes tokens
backend/services/auth-service/app/api/v1/auth_routes.py - Auth routes → User repository: looks up users
backend/services/auth-service/app/api/v1/auth_routes.py - Auth operations → User repository: looks up
backend/services/auth-service/app/services/auth_service.py - Auth operations → Refresh-token repository: stores tokens
backend/services/auth-service/app/services/auth_service.py - Auth operations → Password security: hashes passwords
backend/services/auth-service/app/services/auth_service.py - Auth operations → JWT handling: creates tokens
backend/services/auth-service/app/services/auth_service.py - Auth routes → Auth database: opens sessions
backend/services/auth-service/app/api/v1/auth_routes.py - Auth database → PostgreSQL: connects
backend/services/auth-service/app/db/session.py - Messaging app → Conversations: mounts routes
backend/services/messaging-service/app/main.py - Messaging app → Message HTTP API: mounts routes
- Messaging app → WebSocket chat: mounts routes
backend/services/messaging-service/app/main.py - Conversations → Messaging database: reads and writes
backend/services/messaging-service/app/api/v1/conversation_routes.py - Message HTTP API → Messaging database: reads and writes
backend/services/messaging-service/app/api/v1/message_routes.py - WebSocket chat → Messaging database: writes messages
backend/services/messaging-service/app/api/v1/ws_routes.py - Message HTTP API → Kafka events: publishes events
backend/services/messaging-service/app/api/v1/message_routes.py - WebSocket chat → Kafka events: publishes events
backend/services/messaging-service/app/api/v1/ws_routes.py - Kafka events → Room broadcasts: broadcasts events
backend/services/messaging-service/app/core/kafka.py - Kafka events → Message indexer: indexes events
backend/services/messaging-service/app/core/kafka.py - Search API → Message indexer: queries search
- Messaging database → PostgreSQL: connects
README.md - Messaging app → Redis: connects
backend/services/messaging-service/app/main.py - Kafka events → Kafka broker: connects
backend/services/messaging-service/app/core/kafka.py - Message indexer → Elasticsearch: indexes documents
backend/services/messaging-service/app/services/search_service.py