How dee-nwanjah/ghost-ai works
Ghost Arc is a collaborative system-architecture planner. Users create or open a project, describe a system to the AI, and watch it build a shared canvas that teammates can refine; they can then generate, store, and download a Markdown specification. The map includes project access/sharing, Liveblocks collaboration, and background AI jobs. Source excerpts verify selected API and orchestration links; README documents key capabilities whose implementation files were not sampled, so those links are dashed where unverified.
Main entry points: prisma.ts Prisma client · project-access.ts Project access · generate-spec.ts Specification generator · editor-workspace-client.tsx Editor workspace
Components 29
Project workspace
- Project browser
components/editor/editor-home-client.tsx - Project actions
hooks/use-project-actions.ts - Project API
app/api/projects/route.ts - Editor workspace
components/editor/editor-workspace-client.tsx - Project operations
app/api/projects/[projectId]/route.ts
Canvas collaboration
- Canvas room
components/editor/canvas/canvas-room.tsx - Canvas editor
components/editor/canvas/canvas-editor.tsx - Canvas autosave
hooks/use-canvas-autosave.ts - Canvas persistence API
app/api/projects/[projectId]/canvas/route.ts - Liveblocks service
- Room authorization
app/api/liveblocks-auth/route.ts - Collaborator sharing
app/api/projects/[projectId]/collaborators/route.ts - Sharing rules
lib/project-collaborators.ts
AI planning
- AI prompt panel
components/editor/ai-sidebar.tsx - Design task API
app/api/ai/design/route.ts - Architecture agent
trigger/design-agent.ts - Trigger.dev
- Gemini model
Specifications
- Spec task API
app/api/ai/spec/route.ts - Specification generator
trigger/generate-spec.ts - Spec management API
app/api/projects/[projectId]/specs/route.ts - Spec detail API
app/api/projects/[projectId]/specs/[specId]/route.ts - Spec download
app/api/projects/[projectId]/specs/[specId]/download/route.ts - Markdown files
Access and storage
- Project access
lib/project-access.ts - PostgreSQL
- Prisma client
lib/prisma.ts - Clerk identity
Other components
- Team member
Connections 41
- Team member → Project browser: opens projects
- Project browser → Project actions: invokes actions
components/editor/editor-home-client.tsx - Project actions → Project API: creates project
hooks/use-project-actions.ts - Project API → Prisma client: persists project
app/api/projects/route.ts - Prisma client → PostgreSQL: queries
- Project actions → Project operations: renames or deletes
hooks/use-project-actions.ts - Team member → Editor workspace: enters workspace
- Editor workspace → Canvas room: renders
components/editor/editor-workspace-client.tsx - Canvas room → Canvas editor: renders
components/editor/canvas/canvas-room.tsx - Editor workspace → AI prompt panel: renders
components/editor/editor-workspace-client.tsx - Canvas room → Canvas autosave: uses
components/editor/canvas/canvas-room.tsx - Canvas autosave → Canvas persistence API: saves canvas
- Canvas persistence API → Project access: checks access
app/api/projects/[projectId]/canvas/route.ts - Canvas persistence API → Prisma client: reads or writes
app/api/projects/[projectId]/canvas/route.ts - Editor workspace → Room authorization: requests room auth
- Room authorization → Project access: validates access
app/api/liveblocks-auth/route.ts - Room authorization → Liveblocks service: authorizes room
app/api/liveblocks-auth/route.ts - Canvas editor → Liveblocks service: syncs canvas
- Team member → Collaborator sharing: manages sharing
- Collaborator sharing → Sharing rules: uses sharing rules
app/api/projects/[projectId]/collaborators/route.ts - Collaborator sharing → Prisma client: stores collaborators
app/api/projects/[projectId]/collaborators/route.ts - AI prompt panel → Design task API: submits prompt
- Design task API → Architecture agent: triggers task
app/api/ai/design/route.ts - Architecture agent → Trigger.dev: runs job
- Architecture agent → Gemini model: generates diagram
- Architecture agent → Liveblocks service: updates shared canvas
trigger/design-agent.ts - Team member → Spec task API: requests specification
- Spec task API → Project access: checks access
app/api/ai/spec/route.ts - Spec task API → Specification generator: triggers task
app/api/ai/spec/route.ts - Specification generator → Trigger.dev: runs job
- Specification generator → Gemini model: writes specification
- Specification generator → Prisma client: stores metadata
trigger/generate-spec.ts - Spec task API → Specification generator: passes graph
app/api/ai/spec/route.ts - Spec management API → Project access: checks access
app/api/projects/[projectId]/specs/route.ts - Spec management API → Prisma client: manages metadata
app/api/projects/[projectId]/specs/route.ts - Spec detail API → Project access: checks access
app/api/projects/[projectId]/specs/[specId]/route.ts - Spec detail API → Prisma client: manages metadata
app/api/projects/[projectId]/specs/[specId]/route.ts - Spec download → Markdown files: reads Markdown
- Project access → Clerk identity: gets identity
lib/project-access.ts - Project access → Prisma client: checks membership
lib/project-access.ts - Prisma client → PostgreSQL: persists records