How ilyesbelahsen/projet-chat works
Cloud Chat is a real-time messaging product: users sign in, enter the general room or manage private rooms and members, then exchange messages over WebSocket. The React client calls separate NestJS identity and chat services; AWS can use a WebSocket Lambda with DynamoDB connection tracking, while local development has a WebSocket service. The README documents the service/database architecture and capabilities; sampled source confirms key auth, room, message, and WebSocket operations. Several frontend and infrastructure links are documented rather than verified in sampled implementation.
Main entry points: auth.service.ts Auth workflows · App.tsx React application · services Chat API clients · rooms.controller.ts Room endpoints
Components 23
User application
- React application
frontend/src/App.tsx - Auth context
frontend/src/context/AuthProvider.tsx - Auth API client
frontend/src/services/authService.ts - Room pages
frontend/src/pages - Chat API clients
frontend/src/services
Identity service
- Auth endpoints
auth-service/src/auth/auth.controller.ts - Auth workflows
auth-service/src/auth/auth.service.ts - User endpoints
auth-service/src/users/users.controller.ts - User management
auth-service/src/users/users.service.ts - Reset email
auth-service/src/email/email.service.ts
Chat service
- Room endpoints
chat-service/src/rooms/rooms.controller.ts - Room management
chat-service/src/rooms/rooms.service.ts - Message endpoints
chat-service/src/messages/messages.controller.ts - Message management
chat-service/src/messages/messages.service.ts - Remote auth client
chat-service/src/auth-client/auth-client.service.ts
Realtime delivery
- Internal WS handler
chat-service/src/ws-internal/ws-internal.controller.ts - Local WS server
ws-local-service/src/index.ts - AWS WS Lambda
tf-chat-ecs/lambda/src/handler.ts
Application state
- Connection registry
tf-chat-ecs/lambda/src/dynamo.ts - Auth MySQL
auth-service/src/database/database.module.ts - Chat MySQL
chat-service/src/database/database.module.ts
Other components
- User
- AWS SES
Connections 27
- User → React application: uses
README.md - React application → Auth context: provides
frontend/src/App.tsx - React application → Room pages: routes to
frontend/src/App.tsx - Auth context → Auth API client: calls
frontend/src/context/AuthProvider.tsx - Auth API client → Auth endpoints: sends auth requests
frontend/src/services/authService.ts - Room pages → Chat API clients: uses
- Chat API clients → Room endpoints: calls
README.md - Chat API clients → Message endpoints: calls
README.md - Auth endpoints → Auth workflows: delegates to
auth-service/src/auth/auth.controller.ts - Auth workflows → User management: looks up users
auth-service/src/auth/auth.service.ts - User endpoints → User management: delegates to
auth-service/src/users/users.controller.ts - Auth workflows → Reset email: sends reset email
auth-service/src/auth/auth.service.ts - Auth workflows → Auth MySQL: stores tokens
README.md - User management → Auth MySQL: stores users
README.md - Room endpoints → Room management: delegates to
chat-service/src/rooms/rooms.controller.ts - Room endpoints → Remote auth client: looks up invitee
chat-service/src/rooms/rooms.controller.ts - Message endpoints → Message management: delegates to
chat-service/src/messages/messages.controller.ts - Room management → Chat MySQL: stores rooms and members
README.md - Message management → Chat MySQL: stores messages
README.md - Remote auth client → Auth endpoints: introspects token
chat-service/src/auth-client/auth-client.service.ts - Internal WS handler → Remote auth client: validates connection
chat-service/src/ws-internal/ws-internal.controller.ts - Internal WS handler → Chat MySQL: checks membership and saves
chat-service/src/ws-internal/ws-internal.controller.ts - User → Local WS server: connects locally
README.md - User → AWS WS Lambda: connects on AWS
README.md - AWS WS Lambda → Connection registry: tracks connections
- AWS WS Lambda → Internal WS handler: posts messages
README.md - Reset email → AWS SES: sends email
README.md