How lakshya52/flowdesk works
Purpose and deployable entry points
FlowDesk is a TypeScript internal-operations platform combining project/task management, calendars, CRM/field visits, chat, files, reporting, and backups. The React client starts at client/src/main.tsx and composes routing/application state in client/src/App.tsx. The Node API starts at server/src/index.ts. A separate Electron desktop wrapper is rooted at desktop/src/main.ts, with browser-to-native exposure via desktop/src/preload.ts.
Frontend application shell
The client is a React/Vite single-page application. client/src/components/layout/AppLayout.tsx, client/src/components/layout/Sidebar.tsx, and client/src/components/layout/Header.tsx provide authenticated application chrome around page modules under client/src/pages/. HTTP access is centralized in client/src/lib/api.ts; persisted client concerns are separated into auth, calendar, chat, and theme stores in client/src/store/authStore.ts, client/src/store/calendarStore.ts, and client/src/store/chatStore.ts.
Core workflow domains
Task and assignment work is represented by the task/board/assignment API domain and UI pages: server/src/controllers/taskController.ts, server/src/controllers/assignmentController.ts, server/src/controllers/boardController.ts; corresponding major views include client/src/pages/TasksPage.tsx, client/src/pages/AssignmentsPage.tsx, and client/src/pages/BoardsPage.tsx. Canvas-based assignment planning is a distinct feature boundary via client/src/components/assignments/ProjectCanvas.tsx and server/src/controllers/canvasController.ts.
Calendaring and scheduling
Calendars are a first-class subsystem with separate calendar ownership and event APIs in server/src/routes/calendars.ts, server/src/routes/calendarEvents.ts, and server/src/controllers/calendarEventController.ts. The client supports multiple calendar renderers and event workflows through client/src/pages/CalendarPage.tsx, client/src/components/calendar/CalendarModal.tsx, and client/src/components/calendar/EventModal.tsx. Google Calendar import is exposed as a dedicated backend integration route: server/src/routes/googleCalendarImport.ts.
CRM, field operations, and reporting
CRM covers leads, campaigns, summaries, and field visits, bounded by controllers such as server/src/controllers/leadController.ts, server/src/controllers/campaignController.ts, and server/src/controllers/fieldVisitController.ts. Field activity includes map, routing, check-in/out, expense, and location-tracking interfaces under client/src/components/crm/. Operational reporting is delivered through server/src/controllers/reportController.ts and views including client/src/components/reports/ActivityReport.tsx and client/src/components/reports/EmployeeTrackingReport.tsx.
Backend boundary, persistence, and real time
The API follows routes → controllers → models, with authorization and failure boundaries in server/src/middlewares/auth.ts and server/src/middlewares/errorHandler.ts. Domain persistence is model-based, including tenant/user/task/calendar/CRM entities in server/src/models/Tenant.ts, server/src/models/User.ts, and server/src/models/Task.ts. File handling is mediated by server/src/middlewares/upload.ts and GridFS utility server/src/utils/gridfs.ts. Real-time task, CRM, and field-visit updates are served by server/src/services/taskSocketService.ts, server/src/services/crmSocketService.ts, and server/src/services/fieldVisitSocketService.ts, consumed by matching client socket hooks.
Operations and infrastructure
Node.js is the primary server runtime; the frontend is built with Vite and can be served through Nginx (client/Dockerfile, client/nginx.conf). Dockerized deployment is defined by docker-compose.yml, server/Dockerfile, and client/Dockerfile. Backup scheduling and backup APIs are explicit operational services in server/src/services/backupScheduleService.ts and server/src/controllers/backupController.ts; a Windows backup task/script exists at scripts/flowdesk-backup.ps1. Deployment automation is present in .github/workflows/deployOnWS.yml.
Main entry points: auth.ts Routes and middleware · AppLayout.tsx Authenticated layout · App.tsx App routing and state · api.ts HTTP client
Components 19
React client
- Vite entry
client/src/main.tsx - App routing and state
client/src/App.tsx - Authenticated layout · Layout, sidebar, and header wrap page modules.
client/src/components/layout/AppLayout.tsx - HTTP client
client/src/lib/api.ts - Client stores · Auth, calendar, chat, and theme state.
client/src/store/authStore.ts - Work management UI · Tasks, assignments, boards, and canvas planning.
client/src/pages/TasksPage.tsx - Calendar UI · Calendar views plus calendar and event modals.
client/src/pages/CalendarPage.tsx - CRM and reports UI · CRM field activity and operational reports.
Node API
- API server
server/src/index.ts - Routes and middleware · Authentication, errors, uploads, and route dispatch.
server/src/middlewares/auth.ts - Work and canvas domain · Task, assignment, board, and canvas operations.
server/src/controllers/taskController.ts - Calendar domain · Calendar ownership, events, and Google import.
server/src/routes/calendars.ts - CRM and reporting domain · Leads, campaigns, field visits, and reports.
server/src/controllers/leadController.ts - Domain models · Tenant, user, task, calendar, and CRM entities.
server/src/models/Tenant.ts - Realtime services · Task, CRM, and field-visit updates.
server/src/services/taskSocketService.ts - File storage
server/src/middlewares/upload.ts
Desktop
- Electron wrapper · Native main process and browser bridge.
desktop/src/main.ts
Operations
- Backup services
server/src/services/backupScheduleService.ts - Container deployment · Compose deployment with frontend Nginx and workflow automation.
docker-compose.yml
Connections 24
- Vite entry → App routing and state: boots
- App routing and state → Authenticated layout: renders
- App routing and state → Client stores: uses
- Authenticated layout → Work management UI: hosts
- Authenticated layout → Calendar UI: hosts
- Authenticated layout → CRM and reports UI: hosts
- Work management UI → HTTP client: requests
- Calendar UI → HTTP client: requests
- CRM and reports UI → HTTP client: requests
- HTTP client → API server: HTTP
- API server → Routes and middleware: dispatches
- Routes and middleware → Work and canvas domain: authorizes
- Routes and middleware → Calendar domain: authorizes
- Routes and middleware → CRM and reporting domain: authorizes
- Work and canvas domain → Domain models: persists
- Calendar domain → Domain models: persists
- CRM and reporting domain → Domain models: persists
- Routes and middleware → File storage: uploads
- Work and canvas domain → Realtime services: publishes updates
- CRM and reporting domain → Realtime services: publishes updates
- Backup services → Domain models: backs up
- Electron wrapper → App routing and state: hosts
- Container deployment → API server: deploys
- Container deployment → Vite entry: builds and serves