How niranjan20069019-pixel/chatsphere works
ChatSphere is a username-based real-time messaging platform. Users register or sign in, connect with friends, exchange direct or group messages and media, then manage profiles, notifications, and account settings. The web app reaches the Express API through its API client; Socket.IO supports live communication and call signaling. The backend controllers implement domain operations and persist state through Prisma to PostgreSQL. The README documents calls, browser notifications, and Cloudinary as product capabilities, but their detailed wiring is not fully visible in the sampled source; those links are shown at subsystem level.
Main entry points: api.ts API routes · database.ts Prisma client · app Web pages · auth.controller.ts Authentication
Components 25
Web experience
- Web pages
apps/web/src/app - Chat interface
apps/web/src/components/chat - Call overlay
apps/web/src/components/call/CallOverlay.tsx - API client
apps/web/src/lib/api.ts - Socket client
apps/web/src/lib/socket.ts - Socket provider
apps/web/src/components/providers/SocketProvider.tsx
Identity and social
- Authentication
apps/server/src/controllers/auth.controller.ts - Profiles and settings
apps/server/src/controllers/user.controller.ts - Friends and reports
apps/server/src/controllers/friends.controller.ts
Messaging and calls
- Direct messages
apps/server/src/controllers/messages.controller.ts - Groups and messages
apps/server/src/controllers/groups.controller.ts - Media uploads
apps/server/src/controllers/upload.controller.ts - Realtime events
apps/server/src/sockets/index.ts - Notifications
apps/server/src/controllers/notifications.controller.ts
Server platform
- Administration
apps/server/src/controllers/admin.controller.ts - API routes
apps/server/src/routes/api.ts - Express server
apps/server/src/index.ts - Email service
apps/server/src/services/email.service.ts
Persistence and integrations
- Prisma client
apps/server/src/config/database.ts - PostgreSQL
- Cloudinary storage
- SMTP email
- Browser notifications
- WebRTC peers
Other components
- ChatSphere user
Connections 29
- ChatSphere user → Web pages: uses
- Web pages → API client: requests data
- Chat interface → API client: requests chats
- Call overlay → Socket provider: uses signaling
- Socket provider → Socket client: connects through
- API client → Express server: sends HTTP
- Socket client → Realtime events: connects to
- Express server → API routes: dispatches API
- API routes → Authentication: dispatches auth
- API routes → Profiles and settings: dispatches profile
- API routes → Friends and reports: dispatches friends
- API routes → Direct messages: dispatches messages
- API routes → Groups and messages: dispatches groups
- API routes → Media uploads: dispatches uploads
- API routes → Notifications: dispatches notifications
- API routes → Administration: dispatches admin
- Authentication → Prisma client: reads and writes
- Authentication → Email service: sends account email
- Profiles and settings → Prisma client: reads and writes
- Friends and reports → Prisma client: reads and writes
- Direct messages → Prisma client: reads and writes
- Groups and messages → Prisma client: reads and writes
- Media uploads → Cloudinary storage: stores media
- Notifications → Prisma client: reads and writes
- Administration → Prisma client: reads and writes
- Prisma client → PostgreSQL: queries
- Email service → SMTP email: sends email
- Realtime events → WebRTC peers: signals calls
- Web pages → Browser notifications: shows notifications