# snilth/dobspace architecture

> Architecture diagram of the GitHub repository snilth/dobspace, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/snilth/dobspace
- Repository: https://github.com/snilth/dobspace

## Overview

DevMind (also identified as DobSpace in the server startup message) is a collaborative workspace for projects, tasks, courses, and assignments. Its main domain workflow is task management: authenticated project members create and update tasks, assign work, move tasks through review states, and receive activity and notification updates. Courses and assignment planning, calendars, reminders, workspace settings, and an AI chat are additional product areas. The sampled task router and AI endpoint show their persistence and integration paths; UI-to-router wiring and several unsampled router details are not asserted.

Main entry points: [`app/api/ai/chat/route.ts`](https://github.com/snilth/dobspace/blob/main/app/api/ai/chat/route.ts) (AI chat endpoint), [`lib/db/prisma.ts`](https://github.com/snilth/dobspace/blob/main/lib/db/prisma.ts) (PostgreSQL data), [`lib/trpc/routers/tasks.ts`](https://github.com/snilth/dobspace/blob/main/lib/trpc/routers/tasks.ts) (Task operations), [`lib/auth/index.ts`](https://github.com/snilth/dobspace/blob/main/lib/auth/index.ts) (Auth service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and workspace"]
  node_auth_pages["Sign-in and registration<br/>[page.tsx]"]
  node_auth_api["Authentication API<br/>[route.ts]"]
  node_auth_service["Auth service<br/>[index.ts]"]
  node_dashboard["Workspace dashboard<br/>[page.tsx]"]
  node_settings["Workspace settings<br/>[page.tsx]"]
end

subgraph group_projects["Project task workflow"]
  node_projects_ui["Project workspace<br/>[page.tsx]"]
  node_kanban["Task board<br/>[kanban-board.tsx]"]
  node_task_router["Task operations<br/>[tasks.ts]"]
  node_project_router["Project operations<br/>[projects.ts]"]
  node_activity_router["Activity history<br/>[activityLog.ts]"]
end

subgraph group_learning["Courses and planning"]
  node_courses_ui["Course workspace<br/>[page.tsx]"]
  node_assignment_ui["Assignment board"]
  node_courses_router["Course operations<br/>[courses.ts]"]
  node_assignments_router["Assignment operations<br/>[assignments.ts]"]
  node_calendar["Calendar views"]
  node_calendar_router["Calendar data<br/>[calendar.ts]"]
end

subgraph group_engagement["Updates and assistance"]
  node_notifications_ui["Notifications<br/>[page.tsx]"]
  node_notification_router["Notification operations<br/>[notifications.ts]"]
  node_reminder_router["Reminders<br/>[reminders.ts]"]
  node_chat_ui["AI chat panel<br/>[chat-panel.tsx]"]
  node_ai_route["AI chat endpoint<br/>[route.ts]"]
  node_ai_context["Workspace context builder<br/>[context-builder.ts]"]
  node_ai_prompt["AI prompt builder<br/>[prompts.ts]"]
end

subgraph group_platform["Runtime services"]
  node_trpc_route["tRPC endpoint<br/>[route.ts]"]
  node_trpc_router["Application router<br/>[router.ts]"]
  node_trpc_context["Request context<br/>[init.ts]"]
  node_auth_guard["Project permission checks<br/>[guards.ts]"]
  node_database[("PostgreSQL data<br/>[prisma.ts]")]
  node_redis[("Redis<br/>[redis.ts]")]
  node_realtime["Realtime event publisher<br/>[server.ts]"]
  node_jobs["Deadline and reminder jobs<br/>[reminder-check.ts]"]
end

node_member(("Workspace member"))
node_anthropic{{"Anthropic API"}}

node_member -->|"signs in"| node_auth_pages
node_auth_pages -->|"submits credentials"| node_auth_api
node_auth_api -->|"handles auth"| node_auth_service
node_auth_service -->|"persists accounts"| node_database
node_auth_service -->|"creates workspace"| node_database
node_member -->|"manages projects"| node_projects_ui
node_task_router -->|"checks permissions"| node_auth_guard
node_task_router -->|"reads and writes tasks"| node_database
node_task_router -->|"records activity"| node_database
node_task_router -->|"emits task events"| node_realtime
node_task_router -->|"creates notifications"| node_database
node_member -->|"plans coursework"| node_courses_ui
node_member -->|"views schedule"| node_calendar
node_member -->|"asks workspace questions"| node_chat_ui
node_chat_ui -->|"sends chat"| node_ai_route
node_ai_route -->|"checks workspace access"| node_database
node_ai_route -->|"limits requests"| node_redis
node_ai_route -->|"builds context"| node_ai_context
node_ai_route -->|"builds system prompt"| node_ai_prompt
node_ai_route -->|"streams response"| node_anthropic
node_trpc_route -->|"dispatches procedures"| node_trpc_router
node_trpc_route -->|"creates context"| node_trpc_context
node_jobs -->|"checks reminders"| node_database

click node_auth_pages "https://github.com/snilth/dobspace/blob/main/app/(auth)/login/page.tsx"
click node_auth_api "https://github.com/snilth/dobspace/blob/main/app/api/auth/%5B...all%5D/route.ts"
click node_auth_service "https://github.com/snilth/dobspace/blob/main/lib/auth/index.ts"
click node_dashboard "https://github.com/snilth/dobspace/blob/main/app/(dashboard)/dashboard/page.tsx"
click node_settings "https://github.com/snilth/dobspace/blob/main/app/(dashboard)/settings/page.tsx"
click node_projects_ui "https://github.com/snilth/dobspace/blob/main/app/(dashboard)/projects/%5Bid%5D/page.tsx"
click node_kanban "https://github.com/snilth/dobspace/blob/main/components/kanban/kanban-board.tsx"
click node_task_router "https://github.com/snilth/dobspace/blob/main/lib/trpc/routers/tasks.ts"
click node_project_router "https://github.com/snilth/dobspace/blob/main/lib/trpc/routers/projects.ts"
click node_activity_router "https://github.com/snilth/dobspace/blob/main/lib/trpc/routers/activityLog.ts"
click node_courses_ui "https://github.com/snilth/dobspace/blob/main/app/(dashboard)/courses/%5Bid%5D/page.tsx"
click node_assignment_ui "https://github.com/snilth/dobspace/blob/main/app/(dashboard)/courses/%5Bid%5D/assignment-board.tsx"
click node_courses_router "https://github.com/snilth/dobspace/blob/main/lib/trpc/routers/courses.ts"
click node_assignments_router "https://github.com/snilth/dobspace/blob/main/lib/trpc/routers/assignments.ts"
click node_calendar "https://github.com/snilth/dobspace/blob/main/components/calendar/calendar-page-client.tsx"
click node_calendar_router "https://github.com/snilth/dobspace/blob/main/lib/trpc/routers/calendar.ts"
click node_notifications_ui "https://github.com/snilth/dobspace/blob/main/app/(dashboard)/notifications/page.tsx"
click node_notification_router "https://github.com/snilth/dobspace/blob/main/lib/trpc/routers/notifications.ts"
click node_reminder_router "https://github.com/snilth/dobspace/blob/main/lib/trpc/routers/reminders.ts"
click node_chat_ui "https://github.com/snilth/dobspace/blob/main/components/chat/chat-panel.tsx"
click node_ai_route "https://github.com/snilth/dobspace/blob/main/app/api/ai/chat/route.ts"
click node_ai_context "https://github.com/snilth/dobspace/blob/main/lib/ai/context-builder.ts"
click node_ai_prompt "https://github.com/snilth/dobspace/blob/main/lib/ai/prompts.ts"
click node_trpc_route "https://github.com/snilth/dobspace/blob/main/app/api/trpc/%5Btrpc%5D/route.ts"
click node_trpc_router "https://github.com/snilth/dobspace/blob/main/lib/trpc/router.ts"
click node_trpc_context "https://github.com/snilth/dobspace/blob/main/lib/trpc/init.ts"
click node_auth_guard "https://github.com/snilth/dobspace/blob/main/lib/trpc/guards.ts"
click node_database "https://github.com/snilth/dobspace/blob/main/lib/db/prisma.ts"
click node_redis "https://github.com/snilth/dobspace/blob/main/lib/db/redis.ts"
click node_realtime "https://github.com/snilth/dobspace/blob/main/lib/pusher/server.ts"
click node_jobs "https://github.com/snilth/dobspace/blob/main/lib/jobs/reminder-check.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_auth_pages,node_auth_api,node_auth_service,node_dashboard,node_settings toneBlue
class node_projects_ui,node_kanban,node_task_router,node_project_router,node_activity_router toneAmber
class node_courses_ui,node_assignment_ui,node_courses_router,node_assignments_router,node_calendar,node_calendar_router,node_anthropic toneMint
class node_notifications_ui,node_notification_router,node_reminder_router,node_chat_ui,node_ai_route,node_ai_context,node_ai_prompt toneRose
class node_trpc_route,node_trpc_router,node_trpc_context,node_auth_guard,node_database,node_redis,node_realtime,node_jobs,node_member toneIndigo
```

## Components

### Access and workspace

- [Sign-in and registration](https://github.com/snilth/dobspace/blob/main/app/(auth)/login/page.tsx): `app/(auth)/login/page.tsx`
- [Authentication API](https://github.com/snilth/dobspace/blob/main/app/api/auth/%5B...all%5D/route.ts): `app/api/auth/[...all]/route.ts`
- [Auth service](https://github.com/snilth/dobspace/blob/main/lib/auth/index.ts): `lib/auth/index.ts`
- [Workspace dashboard](https://github.com/snilth/dobspace/blob/main/app/(dashboard)/dashboard/page.tsx): `app/(dashboard)/dashboard/page.tsx`
- [Workspace settings](https://github.com/snilth/dobspace/blob/main/app/(dashboard)/settings/page.tsx): `app/(dashboard)/settings/page.tsx`

### Project task workflow

- [Project workspace](https://github.com/snilth/dobspace/blob/main/app/(dashboard)/projects/%5Bid%5D/page.tsx): `app/(dashboard)/projects/[id]/page.tsx`
- [Task board](https://github.com/snilth/dobspace/blob/main/components/kanban/kanban-board.tsx): `components/kanban/kanban-board.tsx`
- [Task operations](https://github.com/snilth/dobspace/blob/main/lib/trpc/routers/tasks.ts): `lib/trpc/routers/tasks.ts`
- [Project operations](https://github.com/snilth/dobspace/blob/main/lib/trpc/routers/projects.ts): `lib/trpc/routers/projects.ts`
- [Activity history](https://github.com/snilth/dobspace/blob/main/lib/trpc/routers/activityLog.ts): `lib/trpc/routers/activityLog.ts`

### Courses and planning

- [Course workspace](https://github.com/snilth/dobspace/blob/main/app/(dashboard)/courses/%5Bid%5D/page.tsx): `app/(dashboard)/courses/[id]/page.tsx`
- [Assignment board](https://github.com/snilth/dobspace/blob/main/app/(dashboard)/courses/%5Bid%5D/assignment-board.tsx): `app/(dashboard)/courses/[id]/assignment-board.tsx`
- [Course operations](https://github.com/snilth/dobspace/blob/main/lib/trpc/routers/courses.ts): `lib/trpc/routers/courses.ts`
- [Assignment operations](https://github.com/snilth/dobspace/blob/main/lib/trpc/routers/assignments.ts): `lib/trpc/routers/assignments.ts`
- [Calendar views](https://github.com/snilth/dobspace/blob/main/components/calendar/calendar-page-client.tsx): `components/calendar/calendar-page-client.tsx`
- [Calendar data](https://github.com/snilth/dobspace/blob/main/lib/trpc/routers/calendar.ts): `lib/trpc/routers/calendar.ts`

### Updates and assistance

- [Notifications](https://github.com/snilth/dobspace/blob/main/app/(dashboard)/notifications/page.tsx): `app/(dashboard)/notifications/page.tsx`
- [Notification operations](https://github.com/snilth/dobspace/blob/main/lib/trpc/routers/notifications.ts): `lib/trpc/routers/notifications.ts`
- [Reminders](https://github.com/snilth/dobspace/blob/main/lib/trpc/routers/reminders.ts): `lib/trpc/routers/reminders.ts`
- [AI chat panel](https://github.com/snilth/dobspace/blob/main/components/chat/chat-panel.tsx): `components/chat/chat-panel.tsx`
- [AI chat endpoint](https://github.com/snilth/dobspace/blob/main/app/api/ai/chat/route.ts): `app/api/ai/chat/route.ts`
- [Workspace context builder](https://github.com/snilth/dobspace/blob/main/lib/ai/context-builder.ts): `lib/ai/context-builder.ts`
- [AI prompt builder](https://github.com/snilth/dobspace/blob/main/lib/ai/prompts.ts): `lib/ai/prompts.ts`

### Runtime services

- [tRPC endpoint](https://github.com/snilth/dobspace/blob/main/app/api/trpc/%5Btrpc%5D/route.ts): `app/api/trpc/[trpc]/route.ts`
- [Application router](https://github.com/snilth/dobspace/blob/main/lib/trpc/router.ts): `lib/trpc/router.ts`
- [Request context](https://github.com/snilth/dobspace/blob/main/lib/trpc/init.ts): `lib/trpc/init.ts`
- [Project permission checks](https://github.com/snilth/dobspace/blob/main/lib/trpc/guards.ts): `lib/trpc/guards.ts`
- [PostgreSQL data](https://github.com/snilth/dobspace/blob/main/lib/db/prisma.ts): `lib/db/prisma.ts`
- [Redis](https://github.com/snilth/dobspace/blob/main/lib/db/redis.ts): `lib/db/redis.ts`
- [Realtime event publisher](https://github.com/snilth/dobspace/blob/main/lib/pusher/server.ts): `lib/pusher/server.ts`
- [Deadline and reminder jobs](https://github.com/snilth/dobspace/blob/main/lib/jobs/reminder-check.ts): `lib/jobs/reminder-check.ts`

### Other components

- **Workspace member**
- **Anthropic API**

## Connections

- Workspace member → Sign-in and registration: signs in
- Sign-in and registration → Authentication API: submits credentials
- Authentication API → Auth service: handles auth
- Auth service → PostgreSQL data: persists accounts
- Auth service → PostgreSQL data: creates workspace
- Workspace member → Project workspace: manages projects
- Task operations → Project permission checks: checks permissions
- Task operations → PostgreSQL data: reads and writes tasks
- Task operations → PostgreSQL data: records activity
- Task operations → Realtime event publisher: emits task events
- Task operations → PostgreSQL data: creates notifications
- Workspace member → Course workspace: plans coursework
- Workspace member → Calendar views: views schedule
- Workspace member → AI chat panel: asks workspace questions
- AI chat panel → AI chat endpoint: sends chat
- AI chat endpoint → PostgreSQL data: checks workspace access
- AI chat endpoint → Redis: limits requests
- AI chat endpoint → Workspace context builder: builds context
- AI chat endpoint → AI prompt builder: builds system prompt
- AI chat endpoint → Anthropic API: streams response
- tRPC endpoint → Application router: dispatches procedures
- tRPC endpoint → Request context: creates context
- Deadline and reminder jobs → PostgreSQL data: checks reminders
