How nofcngway/chat-app works
Hexlet Chat is a React/Redux real-time chat SPA. Users sign up or log in, then load channels and messages, choose a channel, and exchange messages; channel creation, renaming, and removal are additional workflows. The graph separates page orchestration, chat UI, state, and network integrations. API and event relationships are shown where the excerpts or source index establish them; backend internals are outside this repository.
Main entry points: MainPage.jsx Chat page · ChannelsList.jsx Channel list · chatSlice.js Chat state · App.jsx App routes
Components 25
Application
- App routes
frontend/src/App.jsx - Login
frontend/src/pages/LoginPage.jsx - Sign up
frontend/src/pages/SignupPage.jsx - Chat page
frontend/src/pages/MainPage.jsx - Header
frontend/src/components/Header/Header.jsx - Form validation
frontend/src/schemas/validationSchema.js
Chat experience
- Channel list
frontend/src/components/Channels/ChannelsList.jsx - Channel item
frontend/src/components/Channels/ChannelItem.jsx - Add channel
frontend/src/components/Modals/AddChannelModal.jsx - Rename channel
frontend/src/components/Modals/EditChannelModal.jsx - Remove channel
frontend/src/components/Modals/RemoveChannelModal.jsx - Message list
frontend/src/components/Messages/MessagesList.jsx - Message item
frontend/src/components/Messages/MessageItem.jsx - Message composer
frontend/src/components/Messages/MessageForm.jsx - Text cleaning
frontend/src/utils/profanity.js
Client state
- Auth state
frontend/src/store/slices/authSlice.js - Chat state
frontend/src/store/slices/chatSlice.js - Redux store
frontend/src/store/store.js
Network services
- Auth API
frontend/src/api/auth.js - Channel API
frontend/src/api/channels.js - Message API
frontend/src/api/messages.js - REST client
frontend/src/api/index.js - Socket client
frontend/src/socket.js
Other components
- Chat user
- Chat backend
Connections 44
- Chat user → App routes: uses
README.md - App routes → Login: routes to
frontend/src/App.jsx - App routes → Sign up: routes to
frontend/src/App.jsx - App routes → Chat page: routes to
frontend/src/App.jsx - App routes → Header: renders
frontend/src/App.jsx - Login → Auth API: authenticates via
frontend/src/pages/LoginPage.jsx - Sign up → Auth API: registers via
frontend/src/pages/SignupPage.jsx - Login → Form validation: validates with
frontend/src/pages/LoginPage.jsx - Sign up → Form validation: validates with
frontend/src/pages/SignupPage.jsx - Login → Auth state: dispatches credentials
frontend/src/pages/LoginPage.jsx - Sign up → Auth state: dispatches credentials
frontend/src/pages/SignupPage.jsx - Redux store → Auth state: registers reducer
frontend/src/store/store.js - Redux store → Chat state: registers reducer
frontend/src/store/store.js - Chat page → Auth state: checks access
frontend/src/pages/MainPage.jsx - Chat page → Channel API: loads channels
frontend/src/pages/MainPage.jsx - Chat page → Message API: loads messages
frontend/src/pages/MainPage.jsx - Chat page → Chat state: dispatches chat data
frontend/src/pages/MainPage.jsx - Chat page → Socket client: connects and listens
frontend/src/pages/MainPage.jsx - Chat page → Channel list: renders
frontend/src/pages/MainPage.jsx - Chat page → Message list: renders
frontend/src/pages/MainPage.jsx - Chat page → Message composer: renders
frontend/src/pages/MainPage.jsx - Channel list → Chat state: reads channels
frontend/src/components/Channels/ChannelsList.jsx - Channel list → Channel item: renders
frontend/src/components/Channels/ChannelsList.jsx - Channel list → Add channel: opens
frontend/src/components/Channels/ChannelsList.jsx - Channel list → Rename channel: opens
frontend/src/components/Channels/ChannelsList.jsx - Channel list → Remove channel: opens
frontend/src/components/Channels/ChannelsList.jsx - Add channel → Channel API: creates channel
frontend/src/components/Modals/AddChannelModal.jsx - Add channel → Chat state: updates state
frontend/src/components/Modals/AddChannelModal.jsx - Add channel → Form validation: validates with
frontend/src/components/Modals/AddChannelModal.jsx - Add channel → Text cleaning: cleans text
frontend/src/components/Modals/AddChannelModal.jsx - Rename channel → Channel API: renames channel
frontend/src/components/Modals/EditChannelModal.jsx - Rename channel → Chat state: updates state
frontend/src/components/Modals/EditChannelModal.jsx - Rename channel → Form validation: validates with
frontend/src/components/Modals/EditChannelModal.jsx - Rename channel → Text cleaning: cleans text
frontend/src/components/Modals/EditChannelModal.jsx - Remove channel → Channel API: deletes channel
frontend/src/components/Modals/RemoveChannelModal.jsx - Remove channel → Chat state: updates state
frontend/src/components/Modals/RemoveChannelModal.jsx - Message list → Message item: renders
frontend/src/components/Messages/MessagesList.jsx - Message composer → Message API: sends message
frontend/src/components/Messages/MessageForm.jsx - Message composer → Text cleaning: cleans text
frontend/src/components/Messages/MessageForm.jsx - Auth API → REST client: uses client
frontend/src/api/auth.js - Channel API → REST client: uses client
frontend/src/api/channels.js - Message API → REST client: uses client
frontend/src/api/messages.js - REST client → Chat backend: sends REST requests
- Socket client → Chat backend: exchanges events