How sanjeevandev/team-chat-app works
Team Chat App is a privacy-focused collaboration app for team and project communication. Users register or log in, discover or create teams, join channels, and exchange real-time channel or direct messages; they can also manage friends, profile settings, and notifications. The frontend routes through authenticated pages and uses stores for client state, while the Express server dispatches API routes and Socket.IO events to service modules backed by PostgreSQL. Team membership, conversations, uploads, and presence are distinct supporting domains. README and sampled files establish the broad workflow; unsampled route and UI wiring is represented only where the tree supports it.
Main entry points: server.js HTTP and socket server · App.jsx App routes · DashboardPage.jsx Team dashboard · socketService.js Socket events
Components 34
Web client
- App routes
frontend/src/App.jsx - Login and register
frontend/src/pages/LoginPage.jsx - Team dashboard
frontend/src/pages/DashboardPage.jsx - Chat page
frontend/src/pages/ChatPage.jsx - Friends view
frontend/src/components/FriendsView.jsx - Discover teams
frontend/src/components/DiscoverTeamsView.jsx - Settings
frontend/src/pages/SettingsPage.jsx - Auth state
frontend/src/store/authStore.js - Team state
frontend/src/store/teamStore.js - Channel state
frontend/src/store/channelStore.js - Message state
frontend/src/store/messageStore.js - Friend state
frontend/src/store/friendStore.js - Notification state
frontend/src/store/notificationStore.js
API and realtime
- HTTP and socket server
backend/src/server.js - Auth routes
backend/src/routes/auth.js - JWT middleware
backend/src/middleware/auth.js - Team routes
backend/src/routes/teams.js - Message routes
backend/src/routes/messages.js - Friend routes
backend/src/routes/friends.js - Conversation routes
backend/src/routes/conversations.js - Notification routes
backend/src/routes/notifications.js - Upload routes
backend/src/routes/upload.js - User routes
backend/src/routes/users.js - Socket events
backend/src/services/socketService.js
Collaboration services
- Authentication
backend/src/services/authService.js - Team membership
backend/src/services/teamService.js - Channel management
backend/src/services/channelService.js - Channel messages
backend/src/services/messageService.js - Direct conversations
backend/src/services/conversationService.js - Friend network
backend/src/services/friendService.js - Notifications
backend/src/services/notificationService.js - User profiles
backend/src/services/userService.js - File upload
backend/src/services/uploadService.js
Other components
- Team member
Connections 46
- Team member → App routes: uses
- App routes → Login and register: routes
- App routes → Team dashboard: routes
- App routes → Chat page: routes
- App routes → Settings: routes
- Team dashboard → Discover teams: opens
- Team dashboard → Friends view: opens
- Login and register → Auth state: authenticates
- Settings → Auth state: updates profile
- Team dashboard → Team state: loads teams
- Discover teams → Team state: browses teams
- Chat page → Channel state: loads channels
- Chat page → Message state: handles messages
- Friends view → Friend state: manages friends
- Team dashboard → Notification state: shows alerts
- Auth state → HTTP and socket server: HTTP requests
- Team state → HTTP and socket server: HTTP requests
- Channel state → HTTP and socket server: HTTP requests
- Message state → HTTP and socket server: HTTP requests
- Friend state → HTTP and socket server: HTTP requests
- Notification state → HTTP and socket server: HTTP requests
- HTTP and socket server → Auth routes: dispatches
- HTTP and socket server → Team routes: dispatches
- HTTP and socket server → Message routes: dispatches
- HTTP and socket server → Friend routes: dispatches
- HTTP and socket server → Conversation routes: dispatches
- HTTP and socket server → Notification routes: dispatches
- HTTP and socket server → Upload routes: dispatches
- HTTP and socket server → User routes: dispatches
- HTTP and socket server → Socket events: sets up
- Auth routes → Authentication: calls
- Team routes → Team membership: calls
- Message routes → Channel messages: calls
- Friend routes → Friend network: calls
- Conversation routes → Direct conversations: calls
- Notification routes → Notifications: calls
- Upload routes → File upload: calls
- User routes → User profiles: calls
- Auth routes → JWT middleware: validates via
- Socket events → Channel messages: saves messages
- Socket events → Direct conversations: saves messages
- Socket events → Notifications: creates alerts
- Socket events → User profiles: updates presence
- Team membership → Channel management: creates default
- Team membership → Notifications: notifies members
- Friend network → Notifications: notifies users