How riju-pradhanang/kurakani works
Kurakani is a real-time messaging application. Users register or log in, complete a profile, find and add friends, then exchange messages and media; they can also create group conversations and place voice or video calls. The frontend routes pages and coordinates UI, state, HTTP services, sockets, and WebRTC. The backend exposes authenticated REST routes, persists domain records in MongoDB, and relays real-time events through Socket.io. The README documents capabilities and API/events; sampled source confirms selected routes, persistence, socket dispatch, and call handling, but not every UI-to-service interaction.
Main entry points: Dashboard.tsx Dashboard · socketService.ts Socket client · User.js User records · App.tsx App routing
Components 29
Web client
- App routing
frontend/src/App.tsx - Dashboard
frontend/src/pages/Dashboard.tsx - Login and register
frontend/src/pages/Login.tsx - Profile setup
frontend/src/pages/ProfileSetup.tsx - Auth state
frontend/src/stores/useAuthStore.ts - Direct chat UI
frontend/src/components/ChatWindow.tsx - Group chat UI
frontend/src/components/GroupChatWindow.tsx - Auth service
frontend/src/services/authService.ts - Friend service
frontend/src/services/friendService.ts - Group service
frontend/src/services/groupService.ts - Message service
frontend/src/services/messageService.ts
Identity and social
- Auth routes
backend/routes/auth.js - Auth controller
backend/controllers/authController.js - Friend operations
backend/controllers/friendController.js - User operations
backend/controllers/userController.js
Conversations
- Message routes
backend/routes/messages.js - Message operations
backend/controllers/messageController.js - Group operations
backend/controllers/groupController.js
Realtime and calls
- Socket client
frontend/src/services/socketService.ts - WebRTC service
frontend/src/services/webrtcService.ts - Call interface
frontend/src/components/CallModal.tsx
API and persistence
- Express and Socket.IO
backend/server.js - MongoDB connection
backend/config/db.js - User records
backend/models/User.js - Friend requests
backend/models/FriendRequest.js - Message records
backend/models/Message.js - Group records
backend/models/Group.js - Call logs
backend/models/CallLog.js
Other components
- User
Connections 38
- User → App routing: opens
- App routing → Login and register: routes to
frontend/src/App.tsx - App routing → Profile setup: routes to
frontend/src/App.tsx - App routing → Dashboard: routes to
frontend/src/App.tsx - Login and register → Auth service: authenticates via
frontend/src/pages/Login.tsx - Auth service → Auth routes: requests auth
- Auth routes → Auth controller: dispatches to
backend/routes/auth.js - Auth controller → User records: reads/writes
backend/controllers/authController.js - Auth state → User records: caches profile
- Profile setup → Auth state: updates state
frontend/src/pages/ProfileSetup.tsx - Dashboard → Friend service: uses
frontend/src/pages/Dashboard.tsx - Dashboard → Group service: uses
frontend/src/pages/Dashboard.tsx - Dashboard → Message service: uses
frontend/src/pages/Dashboard.tsx - Dashboard → Direct chat UI: renders
frontend/src/pages/Dashboard.tsx - Dashboard → Group chat UI: renders
frontend/src/pages/Dashboard.tsx - Friend service → Friend operations: requests friends
- Friend operations → Friend requests: reads/writes
backend/controllers/friendController.js - Friend operations → User records: updates friendships
backend/controllers/friendController.js - Group service → Group operations: requests groups
- Group operations → Group records: reads/writes
backend/controllers/groupController.js - Group operations → Message records: creates group messages
backend/controllers/groupController.js - Message service → Message routes: requests messages
- Message routes → Message operations: dispatches to
backend/routes/messages.js - Message operations → Message records: reads/writes
backend/controllers/messageController.js - Message operations → User records: queries users
backend/controllers/messageController.js - Direct chat UI → Socket client: uses events
- Group chat UI → Socket client: uses events
- Dashboard → Socket client: uses
frontend/src/pages/Dashboard.tsx - Socket client → Express and Socket.IO: sends events
- Express and Socket.IO → Socket client: relays events
backend/server.js - Express and Socket.IO → User records: updates presence
backend/server.js - Express and Socket.IO → Message records: marks read
backend/server.js - App routing → Call interface: shows calls
frontend/src/App.tsx - Call interface → Socket client: signals calls
frontend/src/components/CallModal.tsx - Call interface → WebRTC service: controls media
frontend/src/components/CallModal.tsx - WebRTC service → Socket client: exchanges candidates
frontend/src/services/webrtcService.ts - Express and Socket.IO → MongoDB connection: connects
backend/server.js - Auth controller → User records: reads/writes
backend/controllers/authController.js