How trinadhgorrela/real-time-chat-app works
ChatApp is a full-stack messaging product. A user enters through the public landing page, registers or logs in, then uses the protected chat workspace to manage contacts and exchange messages and files. The frontend combines REST services with STOMP/WebSocket state; the Spring backend handles authentication, contact and message operations, and file storage. The README documents read receipts, typing, presence, search, and responsive chat features. Some connections below rely on README statements or the source index; unsampled implementation details are not assumed.
Main entry points: ChatController.java REST and chat controllers · ChatApp.jsx Chat workspace · App.jsx App routing · ChatArea.jsx Conversation view
Components 23
React client
- App routing
Frontend/src/App.jsx - Landing page
Frontend/src/components/landing/LandingPage.jsx - Login and register
Frontend/src/components/auth/Login.jsx - Auth state
Frontend/src/context/AuthContext.jsx - Auth API service
Frontend/src/services/authService.js - HTTP client
Frontend/src/services/api.js - Chat workspace
Frontend/src/components/chat/ChatApp.jsx - Conversation view
Frontend/src/components/chat/ChatArea.jsx - Message composer
Frontend/src/components/chat/MessageInput.jsx - Contact management
Frontend/src/components/modals/RequestsModal.jsx - Profile settings
Frontend/src/components/modals/SettingsModal.jsx
Spring backend
- REST and chat controllers
Backend/src/main/java/com/chatapp/controller/ChatController.java - User and contacts
Backend/src/main/java/com/chatapp/service/UserService.java - Message operations
Backend/src/main/java/com/chatapp/service/ChatService.java - File handling
Backend/src/main/java/com/chatapp/service/FileService.java
Persistence and files
- JPA repositories
Backend/src/main/java/com/chatapp/repository/MessageRepository.java - User contact message records
Backend/src/main/java/com/chatapp/entity/Message.java - MySQL database
- File storage
Authentication and transport
- WebSocket client
Frontend/src/context/WebSocketContext.jsx - JWT security
Backend/src/main/java/com/chatapp/security/JwtAuthFilter.java - STOMP broker setup
Backend/src/main/java/com/chatapp/config/WebSocketConfig.java
Other components
- User browser
Connections 29
- User browser → App routing: opens
README.md - App routing → Landing page: routes to
Frontend/src/App.jsx - App routing → Login and register: routes to
Frontend/src/App.jsx - App routing → Chat workspace: guards and routes
Frontend/src/App.jsx - Login and register → Auth state: updates
Frontend/src/components/auth/Login.jsx - Login and register → Auth API service: calls
Frontend/src/components/auth/Login.jsx - Auth API service → HTTP client: sends requests
Frontend/src/services/authService.js - Auth API service → REST and chat controllers: calls auth endpoints
Frontend/src/services/authService.js - Chat workspace → Conversation view: renders
Frontend/src/components/chat/ChatApp.jsx - Chat workspace → Contact management: opens requests
Frontend/src/components/chat/ChatApp.jsx - Chat workspace → Profile settings: opens settings
Frontend/src/components/chat/ChatApp.jsx - Conversation view → Message composer: renders
Frontend/src/components/chat/ChatArea.jsx - Conversation view → WebSocket client: subscribes and sends
Frontend/src/components/chat/ChatArea.jsx - Profile settings → Auth API service: calls profile endpoints
Frontend/src/components/modals/SettingsModal.jsx - Chat workspace → REST and chat controllers: uses contact API
README.md - Conversation view → REST and chat controllers: loads chat data
README.md - WebSocket client → STOMP broker setup: connects by STOMP
README.md - REST and chat controllers → User and contacts: delegates user work
- REST and chat controllers → Message operations: delegates chat work
Backend/src/main/java/com/chatapp/controller/ChatController.java - REST and chat controllers → File handling: delegates file work
- User and contacts → JPA repositories: queries and updates
Backend/src/main/java/com/chatapp/service/UserService.java - Message operations → JPA repositories: stores and reads messages
Backend/src/main/java/com/chatapp/service/ChatService.java - Message operations → File handling: deletes attachments
Backend/src/main/java/com/chatapp/service/ChatService.java - Message operations → STOMP broker setup: publishes events
Backend/src/main/java/com/chatapp/service/ChatService.java - JPA repositories → User contact message records: persists
Backend/src/main/java/com/chatapp/repository/MessageRepository.java - User contact message records → MySQL database: maps records
README.md - File handling → File storage: stores and loads
Backend/src/main/java/com/chatapp/service/FileService.java - JWT security → REST and chat controllers: filters requests
- JWT security → MySQL database: loads user records