How lebao1234/bd-sidcorp works
QuanLyHTKH combines team CRM, task/reporting workflows, and internal real-time chat. Users enter through the authenticated React application; its screens and hooks use the API for CRM, tasks, resources, and reports, while chat and mention notifications provide live collaboration. The backend separates HTTP controllers, socket handling, and persistence across PostgreSQL, MongoDB, and Supabase Storage. The excerpts establish selected calls and startup wiring; some documented capabilities have unsampled implementations, so uncertain links are left out or marked unverified.
Main entry points: index.ts HTTP server · api.ts API client · App.tsx App routing · CustomerController.ts Customer management
Components 23
Web application
- App routing
frontend/src/App.tsx - Authentication state
frontend/src/context/AuthContext.tsx - API client
frontend/src/services/api.ts - Task workflows
frontend/src/pages/Tasks/TasksPage.tsx - Task data hook
frontend/src/hooks/useTasks.ts - CRM screens
frontend/src/pages/User/tabs/CustomerTab.tsx - Notes and timeline
frontend/src/pages/Notes/NotesPage.tsx - Chat interface
frontend/src/pages/Chat/ChatPage.tsx - Resource hub
frontend/src/pages/Resources/ResourceHubPage.tsx - Reports dashboard
frontend/src/components/reports/ReportDashboard.tsx
HTTP API
- HTTP server
backend/src/index.ts - Authentication and RBAC
backend/src/controllers/AuthController.ts - Customer management
backend/src/controllers/CustomerController.ts - Task management
backend/src/controllers/TaskController.ts - Assets and attachments
backend/src/controllers/AssetController.ts - Chat history API
backend/src/controllers/ChatController.ts
Live collaboration
- Socket manager
backend/src/sockets/socketManager.ts - Task reminders
backend/src/jobs/taskReminder.ts
Persistence and storage
- PostgreSQL data
backend/src/config/db.ts - Chat message store
backend/src/models/GlobalMessage.ts - Supabase file storage
backend/src/config/supabase.ts - Redis adapter
backend/src/config/redis.ts
Other components
- Team member
Connections 27
- Team member → App routing: uses
README.md - App routing → Authentication state: provides auth
frontend/src/App.tsx - App routing → Task workflows: routes to
frontend/src/App.tsx - App routing → Chat interface: routes to
frontend/src/App.tsx - App routing → Reports dashboard: routes to
frontend/src/App.tsx - Task workflows → Task data hook: uses
frontend/src/pages/Tasks/TasksPage.tsx - Task data hook → API client: requests tasks
frontend/src/hooks/useTasks.ts - CRM screens → API client: uses
- Notes and timeline → API client: uses
- Resource hub → API client: uses
- Reports dashboard → API client: uses
- API client → HTTP server: calls HTTP API
- HTTP server → Authentication and RBAC: mounts routes
- HTTP server → Customer management: mounts routes
- HTTP server → Task management: mounts routes
- HTTP server → Assets and attachments: mounts routes
- HTTP server → Chat history API: mounts routes
- HTTP server → Socket manager: initializes
backend/src/index.ts - HTTP server → Task reminders: starts job
backend/src/index.ts - Customer management → PostgreSQL data: reads and writes
backend/src/controllers/CustomerController.ts - Customer management → Supabase file storage: notifies mentions
- Assets and attachments → PostgreSQL data: reads and writes
backend/src/controllers/AssetController.ts - Assets and attachments → Supabase file storage: uploads files
backend/src/controllers/AssetController.ts - Task management → PostgreSQL data: reads and writes
backend/src/controllers/TaskController.ts - Socket manager → Chat message store: persists messages
backend/src/sockets/socketManager.ts - Socket manager → Redis adapter: configures adapter
backend/src/sockets/socketManager.ts - Chat history API → Chat message store: reads chat history
backend/src/controllers/ChatController.ts