How jaiswalbishal/docflow works
DocFlow is a collaborative document workspace. Users register or log in, then manage documents from the dashboard and open them in an editor to edit, share, export, or summarize; public links and search provide additional discovery paths. The backend routes requests through Express controllers to MongoDB models, with Socket.IO supporting real-time presence and collaboration. The README lists the broader feature set; some route/controller and client service implementations were not sampled, so their links are documented at subsystem level where possible.
Main entry points: documentController.js Document operations · Document.js Document records · App.jsx Route application · documentRoutes.js Document routes
Components 28
Workspace client
- Route application
client/src/App.jsx - Login and registration
client/src/pages/Login.jsx - Session state
client/src/contexts/AuthContext.jsx - Document dashboard
client/src/pages/Dashboard.jsx - Document editor
client/src/pages/Editor.jsx - Public document view
client/src/pages/PublicDocument.jsx - Toast and confirmation
client/src/contexts/ToastContext.jsx - Document API client
client/src/services/documentService.js - Authentication client
client/src/services/authService.js - API configuration
client/src/config/api.js
API and domain
- HTTP application
server/src/app.js - Authentication routes
server/src/routes/authRoutes.js - Document routes
server/src/routes/documentRoutes.js - Public routes
server/src/routes/publicRoutes.js - Search routes
server/src/routes/searchRoutes.js - Authentication handlers
server/src/controllers/authController.js - Document operations
server/src/controllers/documentController.js - Document exports
server/src/controllers/exportController.js - Document search
server/src/controllers/searchController.js - User profile
server/src/controllers/userController.js - JWT authorization
server/src/middleware/authMiddleware.js - AI summary service
server/src/services/aiService.js
Live collaboration
- Socket client
client/src/services/socket.js - Socket collaboration
server/src/services/socketService.js
Persistence
- Document records
server/src/models/Document.js - User records
server/src/models/User.js
Other components
- Workspace user
- MongoDB
Connections 37
- Workspace user → Route application: opens
client/src/App.jsx - Route application → Login and registration: routes to
client/src/App.jsx - Route application → Document dashboard: routes to
client/src/App.jsx - Route application → Document editor: routes to
client/src/App.jsx - Route application → Public document view: routes to
client/src/App.jsx - Login and registration → Authentication client: submits credentials
client/src/pages/Login.jsx - Authentication client → API configuration: uses API
- Authentication client → Authentication routes: calls API
- Authentication handlers → User records: reads and writes
server/src/controllers/authController.js - Login and registration → Session state: sets session
client/src/pages/Login.jsx - Document dashboard → Document API client: manages documents
client/src/pages/Dashboard.jsx - Document editor → Document API client: edits and shares
client/src/pages/Editor.jsx - Document API client → API configuration: uses API
client/src/services/documentService.js - Document API client → Document routes: calls API
- Public document view → Public routes: fetches shared view
- Document routes → JWT authorization: requires auth
server/src/routes/documentRoutes.js - Search routes → JWT authorization: requires auth
server/src/routes/searchRoutes.js - Authentication routes → Authentication handlers: dispatches
server/src/routes/authRoutes.js - Document routes → Document operations: dispatches
server/src/routes/documentRoutes.js - Document routes → Document exports: dispatches exports
server/src/routes/documentRoutes.js - Public routes → Document operations: dispatches
server/src/routes/publicRoutes.js - Search routes → Document search: dispatches
server/src/routes/searchRoutes.js - Document operations → Document records: reads and writes
server/src/controllers/documentController.js - Document operations → User records: looks up collaborators
server/src/controllers/documentController.js - Document search → Document records: searches
server/src/controllers/searchController.js - Document exports → Document records: reads documents
server/src/controllers/exportController.js - Document operations → AI summary service: requests summary
server/src/controllers/documentController.js - Document operations → Document records: stores summary
server/src/controllers/documentController.js - HTTP application → Authentication routes: mounts
server/src/app.js - HTTP application → Document routes: mounts
server/src/app.js - HTTP application → Public routes: mounts
server/src/app.js - HTTP application → Search routes: mounts
server/src/app.js - Socket client → Socket collaboration: exchanges events
- Socket collaboration → Document records: uses document data
server/src/services/socketService.js - Document records → MongoDB: persists
- User records → MongoDB: persists
- Toast and confirmation → Document editor: supports actions
client/src/pages/Editor.jsx