How aryan9787/syncat works
Syncat is a full-stack real-time chat application. A user enters through authentication, then uses the chat interface to find contacts, start direct conversations or create channels, and exchange messages and files. The client also provides profile management; the server handles authenticated REST requests and Socket.io communication, with MongoDB-backed user, channel, and message data. The README documents file/media sharing and online status. Some client-to-server wiring is not visible in the excerpts, so those links are shown as unverified where appropriate.
Main entry points: App.jsx App and routes · api-client.js API client · models User, channel, message models · index.js Express routes
Components 23
React client
- App and routes
client/src/App.jsx - Authentication UI
client/src/pages/auth/index.jsx - Profile UI
client/src/pages/profile/index.jsx - Chat workspace
client/src/pages/chat/index.jsx - Contact and channel panels
client/src/pages/chat/components/contacts-container - Message and file UI
client/src/pages/chat/components/chat-container - Client state
client/src/store/slices - API client
client/src/lib/api-client.js - Socket context
client/src/context/SocketContext.jsx
API and realtime server
- Express routes
server/index.js - Auth routes
server/routes/AuthRoutes.js - Contact routes
server/routes/ContactRoutes.js - Channel routes
server/routes/ChannelRoutes.js - Message routes
server/routes/MessagesRoutes.js - Identity and profiles
server/controllers/AuthController.js - Contact discovery
server/controllers/ContactController.js - Channel management
server/controllers/ChannelController.js - Message history and uploads
server/controllers/MessagesController.js - JWT authorization
server/middlewares/AuthMiddleware.js - Socket engine
server/socket.js
Chat data
- User, channel, message models
server/models
Other components
- Chat user
- MongoDB
Connections 35
- Chat user → App and routes: uses
client/src/App.jsx - App and routes → Authentication UI: routes to
client/src/App.jsx - App and routes → Chat workspace: routes to
client/src/App.jsx - App and routes → Profile UI: routes to
client/src/App.jsx - App and routes → API client: checks session
client/src/App.jsx - App and routes → Client state: reads session
client/src/App.jsx - Chat workspace → Contact and channel panels: renders
- Chat workspace → Message and file UI: renders
- Contact and channel panels → Client state: uses
- Message and file UI → Client state: uses
- Authentication UI → API client: calls REST
- Profile UI → API client: calls REST
- Contact and channel panels → API client: calls REST
- Message and file UI → API client: calls REST
- Socket context → Socket engine: exchanges events
- API client → Express routes: sends REST requests
- Express routes → Auth routes: mounts
server/index.js - Express routes → Contact routes: mounts
server/index.js - Express routes → Channel routes: mounts
server/index.js - Express routes → Message routes: mounts
server/index.js - Auth routes → JWT authorization: applies
server/routes/AuthRoutes.js - Contact routes → JWT authorization: applies
server/routes/ContactRoutes.js - Channel routes → JWT authorization: applies
server/routes/ChannelRoutes.js - Message routes → JWT authorization: applies
server/routes/MessagesRoutes.js - Auth routes → Identity and profiles: dispatches
server/routes/AuthRoutes.js - Contact routes → Contact discovery: dispatches
server/routes/ContactRoutes.js - Channel routes → Channel management: dispatches
server/routes/ChannelRoutes.js - Message routes → Message history and uploads: dispatches
server/routes/MessagesRoutes.js - Identity and profiles → User, channel, message models: reads and writes
server/controllers/AuthController.js - Contact discovery → User, channel, message models: queries
server/controllers/ContactController.js - Channel management → User, channel, message models: reads and writes
server/controllers/ChannelController.js - Message history and uploads → User, channel, message models: queries
server/controllers/MessagesController.js - Socket engine → User, channel, message models: uses message and channel data
server/socket.js - User, channel, message models → MongoDB: persists data
- Chat user → Socket context: connects for live chat