Modern React + Vite chat client for Synkro.
This app provides the user-facing chat experience for Synkro, including:
- Authentication flow (login, signup, verify email, reset password)
- Real-time one-to-one and group conversations
- Message send/edit/delete/reactions
- Delivery and seen status
- Typing indicators and online presence
- User profile and settings
- Mobile-friendly chat/sidebar behavior
- React 19
- Vite 8
- React Router 7
- Zustand (state management + persistence)
- Axios (API client)
- Socket.IO Client (real-time updates)
- Tailwind CSS 4
- Lucide React icons
- Frimousse emoji picker
- Node.js 18+
- npm 9+
- Running Synkro backend (default: http://localhost:3000)
- Install dependencies
npm install- Configure environment
Create a .env file in the frontend root:
VITE_API_URL=http://localhost:3000/apiIf omitted, the app falls back to http://localhost:3000/api.
- Start development server
npm run dev- Open in browser
http://localhost:5173
npm run dev- Start Vite development servernpm run build- Build production bundlenpm run preview- Preview production build locallynpm run lint- Run ESLint checks
src/
components/
chat/
sidebar/
ui/
hooks/
layouts/
lib/
pages/
routes/
services/
store/
- Axios base URL is read from
VITE_API_URL. - JWT is read from persisted Zustand auth state (
synkro-auth) and attached asAuthorization: Bearer <token>. - On
401, auth storage is cleared and user is redirected to/login.
- Socket connection is initialized for authenticated sessions.
- Conversation room join/leave is handled by chat route changes.
- Incoming events update local state for:
- new messages
- message updates
- reactions
- seen/delivered state
- typing and presence
- Message search with result navigation
- Frimousse-based emoji picker in message input
- Mobile sidebar drawer with open/close behavior
- Chat header controls (search, close chat, user info)
- Ensure backend is running on the expected host/port.
- Verify
VITE_API_URLin.env.
- Token may be expired/invalid.
- Re-login to regenerate valid auth token.
- Check backend socket server is active.
- Confirm client is authenticated and connected.
npm run lint
npm run buildFix reported errors/warnings and rerun.
This frontend is part of the Synkro project and follows the repository license.