How axissxs/vellum works
1. Purpose and entry points
Vellum is a self-hostable team-management platform: teams own projects, projects contain Kanban tasks and milestones, and users collaborate through comments, notifications, activity, and optional Telegram/push delivery. The Next.js App Router starts at src/app/page.tsx; login and first-run setup are src/app/login/page.tsx and src/app/setup/page.tsx. Authenticated UI is rooted in src/app/dashboard/layout.tsx.
2. Application and UI boundary
Server-rendered routes and client dashboard views are colocated under src/app. The dashboard is organized by operational domains—overview, tasks, teams, projects, activity, settings, admin, and super-admin—with interactive clients such as src/app/dashboard/projects/[id]/KanbanBoard.tsx, src/app/dashboard/kanban/KanbanBoardClient.tsx, and src/app/dashboard/super-admin/SuperAdminClient.tsx. Shared React state/data-fetching setup enters via src/providers/QueryProvider.tsx; domain hooks bridge browser UI to API endpoints, e.g. src/hooks/useTasks.ts and src/hooks/useProjects.ts.
3. HTTP API and authorization
Route handlers in src/app/api form the primary backend boundary. Core CRUD resources include tasks, projects, teams, users, comments, milestones, activity, stats, and notifications; representative paths are src/app/api/tasks/route.ts, src/app/api/projects/[id]/route.ts, and src/app/api/teams/[id]/members/route.ts. Session lifecycle is handled by src/app/api/auth/login/route.ts, src/app/api/auth/logout/route.ts, and src/lib/auth.ts. The API must enforce the role model (Superadmin/Admin/Member) before exposing tenant/team data or mutations.
4. Work-management data flow
Typical browser flow is: dashboard client/hook → typed API utility → App Router handler → Drizzle database operation → returned resource and refresh/realtime event. Tasks are the central work item, rendered in project and global Kanban views and linked to comments, assignees, priorities, statuses, dates, and milestones. Important UI/API seams are src/app/dashboard/projects/[id]/TaskDetailModal.tsx, src/hooks/useComments.ts, and src/app/api/comments/[id]/route.ts.
5. Persistence, initialization, and deployment
PostgreSQL (including Neon) is the durable system of record, accessed through Drizzle. Schema and connection layer are src/db/schema.ts and src/db/index.ts; request-time/initial bootstrap is src/db/bootstrap.ts. Versioned schema history is committed under drizzle/, with migrations applied through deployment automation at .github/workflows/apply-migrations.yml. The app targets Node.js/Next.js on Vercel, with pooled and direct database URLs required.
6. Collaboration and outbound integrations
Notification state is served from src/app/api/notifications/route.ts; browser push subscription/preferences use src/app/api/push/subscribe/route.ts and src/lib/push.ts, with service-worker support in public/sw.js. Realtime architecture is backed by Pusher adapters in src/lib/pusher.ts and src/lib/pusher-broadcast.ts, consumed by src/hooks/useRealtime.ts. Telegram pairing, webhook ingestion, and delivery/configuration are isolated behind src/app/api/telegram/webhook/route.ts, src/app/api/telegram/pairing-code/route.ts, and src/lib/telegram.ts.
7. Governance and privileged operations
Activity/audit recording is a cross-cutting concern represented by src/lib/audit.ts and user-facing activity APIs. Super-admin routes segregate sensitive operations—users, session revocation, audit export, health, permission management, restore/trash, and Telegram administration—under src/app/api/super-admin/. Key control-plane endpoints include src/app/api/super-admin/audit/export/route.ts, src/app/api/super-admin/sessions/[id]/route.ts, and src/app/api/super-admin/restore/route.ts.
Main entry points: tasks/route.ts Resource route handlers · QueryProvider.tsx Query state & domain hooks · index.ts Drizzle persistence · export/route.ts Super-admin control plane
Components 16
Next.js UI
- Public entry & setup · Landing, login, and first-run setup.
src/app/page.tsx - Dashboard shell · Root for operational dashboard domains.
src/app/dashboard/layout.tsx - Kanban & task detail · Project and global task workflows.
src/app/dashboard/projects/[id]/KanbanBoard.tsx - Query state & domain hooks · Hooks connect dashboard views to typed API calls.
src/providers/QueryProvider.tsx
Application API
- Resource route handlers · CRUD for tasks, projects, teams, comments, milestones, activity, stats, and notifications.
src/app/api/tasks/route.ts - Session auth & roles · Enforces Superadmin, Admin, and Member access.
src/lib/auth.ts - Tasks & comments · Central work items link assignees, status, priority, dates, milestones, and comments.
src/app/api/comments/[id]/route.ts
Data & deployment
- Drizzle persistence · Schema, connection, and request-time bootstrap.
src/db/index.ts - PostgreSQL / Neon
- Schema migrations · Versioned migrations are applied by GitHub Actions.
.github/workflows/apply-migrations.yml - Vercel Node runtime · Runs the Next.js application.
Collaboration
- Notifications & push · Stores notification state and manages browser subscriptions.
src/app/api/notifications/route.ts - Pusher realtime · Broadcast adapters feed dashboard realtime hooks.
src/lib/pusher-broadcast.ts - Telegram integration · Handles pairing, webhook ingestion, and Telegram delivery.
src/app/api/telegram/webhook/route.ts
Governance
- Audit activity · Records governance-relevant activity.
src/lib/audit.ts - Super-admin control plane · Manages users, sessions, permissions, restore, health, audit export, and Telegram administration.
src/app/api/super-admin/audit/export/route.ts
Connections 22
- Public entry & setup → Dashboard shell: authenticated access
- Dashboard shell → Kanban & task detail: renders
- Dashboard shell → Query state & domain hooks: provides query state
- Kanban & task detail → Query state & domain hooks: uses task data
- Query state & domain hooks → Resource route handlers: typed HTTP calls
- Resource route handlers → Session auth & roles: authorizes requests
- Resource route handlers → Tasks & comments: routes work operations
- Resource route handlers → Drizzle persistence: reads and mutates
- Tasks & comments → Drizzle persistence: persists work data
- Drizzle persistence → PostgreSQL / Neon: Drizzle queries
- Schema migrations → PostgreSQL / Neon: applies schema history
- Resource route handlers → Notifications & push: serves notification state
- Resource route handlers → Pusher realtime: publishes refresh events
- Pusher realtime → Query state & domain hooks: triggers client refresh
- Notifications & push → Pusher realtime: broadcasts updates
- Resource route handlers → Telegram integration: integration endpoints
- Resource route handlers → Audit activity: records activity
- Super-admin control plane → Session auth & roles: requires superadmin role
- Super-admin control plane → Drizzle persistence: administeres data
- Super-admin control plane → Audit activity: exports and reviews
- Vercel Node runtime → Public entry & setup: hosts
- Vercel Node runtime → Resource route handlers: runs handlers