How nicrepository/nchat works
NChat is a corporate internal chat product, with separate employee and administrative web applications backed by Go services. The main employee workflow is composing and viewing conversations, with HTTP and realtime chat behavior, plus supporting file, search, identity, notification, and call capabilities. Administration provides a separate console for operational tasks. The README documents the broad stack and product boundaries; sampled source and the SOURCE INDEX support only some internal links, so uncertain service-to-service and UI-to-service connections are omitted or dashed.
Main entry points: app.go Chat service · AppShell.tsx Conversation UI · App.tsx Chat web app · chatApi.ts Chat API client
Components 24
Chat and collaboration
- Chat web app
apps/web/src/App.tsx - Conversation UI
apps/web/src/chat/AppShell.tsx - Chat API client
apps/web/src/chat/chatApi.ts - Chat realtime
apps/web/src/chat/useChatWebSocket.ts - File client
apps/web/src/chat/filesApi.ts - Global search
apps/web/src/search/useGlobalSearch.ts
Identity and calling
- Sign-in UI
apps/web/src/auth/LoginPage.tsx - Authentication
services/auth-service/internal/http/auth_handler.go - Call media
apps/web/src/chat/useCallMedia.ts
Backend services
- Chat service
services/chat-service/internal/app/app.go - Message handling
services/chat-service/internal/service/message_service.go - File previews
services/file-service/internal/service/preview_service.go - Search service
services/search-service/internal/server/search_handler.go - Media service
services/media-service/internal/app/app.go - Notifications
services/notification-service/internal/app/app.go - Admin service
services/admin-service/internal/http/routes.go
Administration
- Admin console
apps/admin-web/src/App.tsx - Admin session
apps/admin-web/src/session/AdminSessionProvider.tsx - Admin API client
apps/admin-web/src/api/client.ts
Other components
- Employee
- PostgreSQL
- Valkey
- SeaweedFS
- LiveKit
Connections 21
- Employee → Chat web app: uses
README.md - Chat web app → Conversation UI: presents
- Conversation UI → Chat API client: loads conversations
- Conversation UI → Chat realtime: receives updates
- Chat API client → Chat service: HTTP requests
- Chat realtime → Chat service: WebSocket updates
- Chat service → Message handling: builds services
services/chat-service/internal/app/app.go - Chat service → Valkey: uses cache and bus
README.md - Chat service → PostgreSQL: uses database
README.md - File client → File previews: requests previews
- File previews → SeaweedFS: stores files
- Global search → Search service: search requests
- Sign-in UI → Authentication: sign-in requests
- Employee → Sign-in UI: signs in
- Call media → Media service: requests call tokens
- Media service → LiveKit: issues call tokens
- Chat service → Notifications: notification events
- Admin console → Admin session: manages session
- Admin session → Admin API client: loads session
- Admin API client → Admin service: admin requests
- Admin service → PostgreSQL: uses database