How ananyapt2005/chatapp works
Connect is a browser-based direct and group chat application. Users restore or create a session, browse people and conversations, open or create a chat, load message history, and exchange live messages over a WebSocket. The frontend also exposes authenticated HTTP operations for users, conversations, and messages. Backend controllers, services, persistence, and Redis/WebSocket components are represented from the repository tree, but their internal wiring is not shown in the supplied excerpts; those relationships are therefore omitted.
Main entry points: App.jsx Application shell · useChat.js Chat state · client.js HTTP client · Sidebar.jsx Conversation sidebar
Components 26
Chat interface
- Application shell
frontend/src/App.jsx - Authentication screen
frontend/src/components/AuthScreen.jsx - Conversation sidebar
frontend/src/components/Sidebar.jsx - Group creation form
frontend/src/components/GroupCreateForm.jsx - Chat window
frontend/src/components/ChatWindow.jsx
Frontend state and API
- Authentication state
frontend/src/hooks/useAuth.js - Chat state
frontend/src/hooks/useChat.js - Authentication API
frontend/src/api/auth.js - Conversation API
frontend/src/api/conversations.js - Message history API
frontend/src/api/messages.js - User directory API
frontend/src/api/users.js - HTTP client
frontend/src/api/client.js
Backend application
- Authentication endpoints
src/main/java/com/example/chatApp/controller/AuthController.java - Conversation endpoints
src/main/java/com/example/chatApp/controller/ConversationController.java - Message endpoints
src/main/java/com/example/chatApp/controller/ChatMessageController.java - User endpoints
src/main/java/com/example/chatApp/controller/UserController.java - Authentication service
src/main/java/com/example/chatApp/service/AuthService.java - Conversation service
src/main/java/com/example/chatApp/service/ConversationService.java - Message service
src/main/java/com/example/chatApp/service/ChatMessageService.java
Persistence and realtime
- WebSocket handler
src/main/java/com/example/chatApp/service/ChatWebSocketHandler.java - Redis chat publisher
src/main/java/com/example/chatApp/service/RedisChatPublisher.java - Redis chat subscriber
src/main/java/com/example/chatApp/service/RedisChatSubscriber.java - User repository
src/main/java/com/example/chatApp/repository/UserRepository.java - Conversation repositories
src/main/java/com/example/chatApp/repository/ConversationRepository.java - Message repository
src/main/java/com/example/chatApp/repository/ChatMessageRepository.java
Other components
- Chat user
Connections 15
- Chat user → Application shell: uses
- Application shell → Authentication state: initializes
frontend/src/App.jsx - Application shell → Chat state: initializes
frontend/src/App.jsx - Application shell → Authentication screen: renders
frontend/src/App.jsx - Application shell → Conversation sidebar: renders
frontend/src/App.jsx - Application shell → Chat window: renders
frontend/src/App.jsx - Conversation sidebar → Group creation form: renders
frontend/src/components/Sidebar.jsx - Authentication state → Authentication API: calls
frontend/src/hooks/useAuth.js - Chat state → User directory API: loads users
frontend/src/hooks/useChat.js - Chat state → Conversation API: loads conversations
frontend/src/hooks/useChat.js - Chat state → Message history API: loads history
frontend/src/hooks/useChat.js - Authentication API → HTTP client: requests
frontend/src/api/auth.js - Conversation API → HTTP client: requests
frontend/src/api/conversations.js - Message history API → HTTP client: requests
frontend/src/api/messages.js - User directory API → HTTP client: requests
frontend/src/api/users.js