How harshpatel2414/chat-assist works
This is a Next.js assistance-chat application with Google sign-in, an admin chat workspace, and a user-facing support assistant. The main workflow is sign-in and role-based routing, then chat selection and live conversation; messages can include uploaded images or videos. The tree and sampled code show Firebase Auth, Firestore, and Storage integrations, plus message translation. ChatContext and several chat components are present but their implementations were not sampled, so uncertain wiring between them is omitted.
Main entry points: chat.js Chat service · ChatContainer.jsx Conversation view · ChatInput.jsx Message composer · page.js Sign-in page
Components 21
Identity and routing
- Sign-in page
src/app/page.js - Auth context
src/context/AuthContext.js - Support page
src/app/support/page.jsx - Admin chat route
src/app/admin/chat/page.jsx
Admin workspace
- Chat layout
src/app/admin/chat/layout.jsx - Chat sidebar
src/components/sidebar/Sidebar.jsx - User search
src/components/sidebar/Searchbar.jsx - Chat list
src/components/sidebar/Chats.jsx - Chat profile
src/components/chat/Profile.jsx - Chat tagging
src/components/chat/TagModal.jsx
Chat and messaging
- Support assistant
src/components/assistant/Assistant.jsx - Assistant message
src/components/assistant/AssistantMessage.jsx - Conversation view
src/components/chat/ChatContainer.jsx - Message composer
src/components/chat/ChatInput.jsx - Chat state
src/context/ChatContext.js
Firebase services
- Firebase Auth
- Chat service
src/firebase/chat.js - Cloud Firestore
src/firebase/firebaseConfig.js - Firebase Storage
src/firebase/firebaseConfig.js
Other components
- User
- Translation API
Connections 22
- User → Sign-in page: signs in
- Sign-in page → Firebase Auth: Google sign-in
- Firebase Auth → Auth context: auth state
- Auth context → Admin chat route: routes admin
- Auth context → Support page: routes user
- Sign-in page → Cloud Firestore: creates or updates user
- Support page → Support assistant: opens assistant
- Assistant message → Translation API: requests translation
- Chat layout → Chat sidebar: renders
- Chat sidebar → User search: renders
- User search → Cloud Firestore: searches users
- User search → Chat service: adds selected user
- Chat sidebar → Chat list: renders
- Admin chat route → Conversation view: renders conversation
- Conversation view → Chat state: uses chat state
- Message composer → Chat state: reads selected chat
- Message composer → Chat service: sends messages
- Message composer → Chat service: uploads media
- Chat service → Cloud Firestore: reads and writes chats
- Chat service → Firebase Storage: uploads media
- Conversation view → Chat profile: shows profile
- Conversation view → Chat tagging: opens tagging