How mdsohail07/nexuspad works
NexusPad is a collaborative document editor. Users authenticate, manage documents from a searchable dashboard, open a document in the editor, and collaborate through Liveblocks; owners can also create view-only share links. PostgreSQL stores document metadata and share snapshots, while Liveblocks handles live editing and presence. The graph preserves these separate state paths. Several editor and sharing details are documented but their implementation files were not sampled, so those connections rely on README evidence; unsampled internals are not inferred.
Main entry points: documents.ts Document actions · route.ts Room authorization · auth.ts Auth.js · prisma.ts Prisma client
Components 24
Identity
- Sign-in pages
app/login/page.tsx - Auth forms
components/auth - Auth actions
app/actions/auth.ts - Auth.js
auth.ts
Document workspace
- Dashboard route
app/page.tsx - Dashboard view
components/dashboard/dashboard-view.tsx - Document grid
components/dashboard/document-grid.tsx - Document cards
components/dashboard/document-card.tsx - Document cache
lib/hooks/use-documents.ts - Document actions
app/actions/documents.ts
Editing and collaboration
- Document route
app/documents/[id]/page.tsx - Collaboration room
components/editor/document-room.tsx - Editor interface
components/editor/editor-shell.tsx - Editor controls
components/editor/editor-toolbar.tsx - Editor commands
components/editor/editor-commands.ts - Presence display
components/editor/presence-avatars.tsx - Room authorization
app/api/liveblocks-auth/route.ts
Public sharing
- Shared document route
app/share/[token]/page.tsx - Read-only view
components/editor/shared-document-view.tsx
Persistence and services
- PostgreSQL
- Prisma client
lib/prisma.ts
Other components
- User
- Google OAuth
- Liveblocks
Connections 30
- User → Sign-in pages: opens
app/login/page.tsx - Sign-in pages → Auth forms: renders
app/login/page.tsx - Auth forms → Auth actions: submits to
components/auth/login-form.tsx - Auth actions → Auth.js: signs in
app/actions/auth.ts - Auth.js → Prisma client: looks up users
auth.ts - Auth.js → Google OAuth: supports OAuth
auth.ts - User → Dashboard route: opens
app/page.tsx - Dashboard route → Dashboard view: renders
app/page.tsx - Dashboard view → Document grid: renders
components/dashboard/dashboard-view.tsx - Document grid → Document cache: uses
components/dashboard/document-grid.tsx - Document grid → Document cards: renders
components/dashboard/document-grid.tsx - Document cache → Document actions: requests documents
lib/hooks/use-documents.ts - Document actions → Prisma client: reads and writes
app/actions/documents.ts - Prisma client → PostgreSQL: persists metadata
- User → Document route: opens document
app/documents/[id]/page.tsx - Document route → Document actions: loads document
app/documents/[id]/page.tsx - Document route → Collaboration room: renders room
app/documents/[id]/page.tsx - Collaboration room → Editor interface: renders editor
components/editor/document-room.tsx - Editor interface → Editor controls: provides controls
components/editor/editor-toolbar.tsx - Editor controls → Editor commands: invokes
components/editor/editor-toolbar.tsx - Collaboration room → Room authorization: requests room access
- Room authorization → Auth.js: checks session
app/api/liveblocks-auth/route.ts - Room authorization → Prisma client: checks ownership
app/api/liveblocks-auth/route.ts - Room authorization → Liveblocks: authorizes room
app/api/liveblocks-auth/route.ts - Editor interface → Liveblocks: syncs edits
- Liveblocks → Presence display: provides presence
- User → Shared document route: opens link
- Shared document route → Document actions: loads shared snapshot
app/share/[token]/page.tsx - Shared document route → Read-only view: renders snapshot
app/share/[token]/page.tsx - Document actions → PostgreSQL: stores snapshots