How shubhmhatre940/doc-clone-using-mern works
This is a Google Docs-style collaborative writing application. Users sign in, browse or organize documents, and open an editor to create, import, edit, and autosave content; they can then collaborate through live sync, comments, sharing, history, and activity features. The graph emphasizes documented frontend routing, document/version controller calls, and server registration. Several feature branches are documented in the README or route registration, but their internal implementation paths are unsampled, so those connections are left broad or unverified.
Main entry points: EditorPage.jsx Editor workspace · documentRoutes.js Document routes · documentController.js Document operations · versionController.js Version history
Components 27
Client experience
- App routes
client/src/App.jsx - Auth context
client/src/context/AuthContext.jsx - Document dashboard
client/src/pages/DashboardPage.jsx - Editor workspace
client/src/pages/EditorPage.jsx - Rich text editor
client/src/components/editor/TiptapEditor.jsx - Autosave
client/src/hooks/useAutosave.js - Document API client
client/src/api/documents.js
API and access
- Express application
server/server.js - Document routes
server/routes/documentRoutes.js - JWT authentication
server/middleware/auth.js - Document permissions
server/middleware/permissions.js
Document services
- Document operations
server/controllers/documentController.js - Import and export
server/controllers/exportController.js - Version history
server/controllers/versionController.js
Collaboration
- Live collaboration
server/services/collabServer.js - Comments and mentions
server/controllers/commentController.js - Sharing and roles
server/controllers/shareController.js - Activity log
server/services/activityService.js - Notifications
server/services/notificationService.js
Persistent state
- Documents
server/models/Document.js - Document versions
server/models/DocumentVersion.js - Comments
server/models/Comment.js - Activity records
server/models/ActivityLog.js - Notification records
server/models/Notification.js - User records
server/models/User.js
Other components
- Writer
- MongoDB
Connections 48
- Writer → App routes: uses
client/src/App.jsx - App routes → Auth context: provides auth
client/src/App.jsx - App routes → Document dashboard: routes to
client/src/App.jsx - App routes → Editor workspace: routes to
client/src/App.jsx - Editor workspace → Rich text editor: renders
client/src/pages/EditorPage.jsx - Editor workspace → Autosave: uses
client/src/pages/EditorPage.jsx - Autosave → Document API client: saves through
client/src/hooks/useAutosave.js - Document dashboard → Document API client: loads documents
client/src/pages/DashboardPage.jsx - Document API client → Express application: HTTP requests
- Express application → Document routes: mounts
server/server.js - Express application → Live collaboration: initializes
server/server.js - Document routes → JWT authentication: protects routes
server/routes/documentRoutes.js - Document routes → Document permissions: checks access
server/routes/documentRoutes.js - Document routes → Document operations: routes requests
server/routes/documentRoutes.js - Document routes → Import and export: routes exports
server/routes/documentRoutes.js - Document routes → Sharing and roles: routes sharing
server/routes/documentRoutes.js - Document routes → Activity log: routes activity
server/routes/documentRoutes.js - JWT authentication → User records: loads user
server/middleware/auth.js - Document permissions → Documents: checks document
server/middleware/permissions.js - Document operations → Documents: reads and writes
server/controllers/documentController.js - Document operations → Version history: creates snapshots
server/controllers/documentController.js - Document operations → Activity log: records actions
server/controllers/documentController.js - Document operations → MongoDB: persists
- Version history → Document versions: reads and writes
server/controllers/versionController.js - Version history → Documents: restores document
server/controllers/versionController.js - Version history → Live collaboration: broadcasts restore
server/controllers/versionController.js - Version history → Activity log: records restore
server/controllers/versionController.js - Activity log → Activity records: writes entries
server/services/activityService.js - Comments and mentions → Comments: reads and writes
server/controllers/commentController.js - Comments and mentions → Documents: loads document
server/controllers/commentController.js - Comments and mentions → Notifications: creates alerts
server/controllers/commentController.js - Comments and mentions → Live collaboration: broadcasts changes
server/controllers/commentController.js - Notifications → Notification records: writes records
server/services/notificationService.js - Sharing and roles → Documents: updates sharing
server/controllers/shareController.js - Sharing and roles → User records: looks up users
server/controllers/shareController.js - Sharing and roles → Notifications: notifies collaborators
server/controllers/shareController.js - Documents → MongoDB: stores data
- Document versions → MongoDB: stores snapshots
- Comments → MongoDB: stores threads
- Activity records → MongoDB: stores entries
- Notification records → MongoDB: stores alerts
- User records → MongoDB: stores users
- Editor workspace → Live collaboration: syncs live
- Editor workspace → Comments and mentions: manages comments
- Editor workspace → Version history: views history
- Editor workspace → Sharing and roles: manages access
- Editor workspace → Import and export: exports content
- Document dashboard → Document operations: organizes files