How abhisheksrikanth/saturchat-frontend works
Project Type and Purpose
• Type: React/Vite frontend for a real‐time chat platform.
• Purpose: Provide users with a responsive UI for messaging, group management, user profiles, and AI bot integration.
File Structure
• Top‐level:
– index.html + public/: Static entry point and assets.
– src/: All React logic (components/, layouts/, pages/, services/, context/, hooks/).
– vite.config.js: Build/dev config.
– Dockerfile, GitHub Actions: Deployment pipelines.
• Key subdirectories:
– components/: UI building blocks (chat bubbles, modals, sidebars).
– services/: HTTP client (axios.js), auth.js, chat.js.
– hooks/: WebSocket hooks (useChatSocket, useUserSocket).
– context/: JWT‐based AuthProvider & hooks.
– layouts/ + pages/: Route‐based pages (Login, Register, Chat, Profile, Error).
Extract Insights from README
• Tech stack: React 19, Vite, TailwindCSS.
• Real‐time messaging via WebSockets (VITE_WS_BASE_URL).
• HTTP API calls to a JWT‐secured backend (VITE_API_BASE_URL).
• Integration with AI bots for automated responses.
• Deployment: serve index.html via NGINX; CORS/proxy for API + WS.
Main Components & Their Relationships
a. Browser & Static Hosting
– Vite Dev Server (dev mode) or NGINX (prod) serves index.html + JS/CSS.
b. React Application
– UI Layer: pages → layouts → components
– State Management: AuthContext (JWT storage), custom hooks
– Service Layer: axios HTTP client for REST; WebSocket wrappers
c. Backend Services (external to this repo)
– REST API (Auth, Users, Conversations, AI)
– WebSocket Server (real-time chat streams)
– AI Bot Service (internal or third-party)
– Database (users, messages, conversation metadata)