How vindyang/mono works
Purpose and Runtime
Mono is a multi-workspace project-management platform for projects, tasks, collaboration, scheduling, and reporting. It is a TypeScript Next.js 16 App Router application using React 19; Bun is the primary development/package runtime. The top-level application shell and root entry route are app/layout.tsx and app/page.tsx.
Route Segmentation and Application Shell
The App Router separates anonymous and authenticated experiences. Public login/signup routes live under app/(public)/login/page.tsx and app/(public)/signup/page.tsx; authenticated pages share app/(authenticated)/layout.tsx, which is the principal protected UI boundary. The authenticated area exposes dashboard, projects, tasks, team, calendar, analytics, and settings, with navigation centralized in components/app-sidebar.tsx.
Identity, Sessions, and Access Boundaries
Better Auth is integrated through server and client auth modules: lib/auth.ts, lib/auth/auth-client.ts, and the catch-all handler app/api/auth/[...all]/route.ts. Login-related checks and verification/update behavior are exposed separately by app/api/auth/login-with-check/route.ts and app/api/auth/verify-and-update/route.ts. Authorization must protect workspace-scoped operations and role-based membership; workspace/member relationships are persisted in the Prisma schema at prisma/schema.prisma.
Workspace, Project, and Team Collaboration
Projects belong to workspaces and have project-specific membership workflows. Project list/detail entry points are app/(authenticated)/projects/page.tsx and app/(authenticated)/projects/[id]/page.tsx; mutations are grouped in adjacent server-action modules such as app/(authenticated)/projects/componentsaction/actions.ts and app/(authenticated)/projects/[id]/componentsaction/actions.ts. Team management, invitation visibility, and roles are routed through app/(authenticated)/team/page.tsx, app/(authenticated)/team/invitations/page.tsx, and app/(authenticated)/team/roles/page.tsx.
Invitation acceptance is a public-to-authenticated boundary: invite links resolve at app/invite/[id]/page.tsx, while acceptance is handled by app/api/invite/accept/route.ts. Invitation creation/domain logic is shared through lib/invitations.ts, with outbound email integration in lib/email/send.ts.
Task Lifecycle, Attachments, and Scheduling
Task management is centered on app/(authenticated)/tasks/page.tsx and per-task detail at app/(authenticated)/tasks/[id]/page.tsx. Task mutations are concentrated in app/(authenticated)/tasks/componentsaction/actions.ts; interactive client-side workflow includes the drag-and-drop board at app/(authenticated)/tasks/components/kanban-board.tsx and details UI at app/(authenticated)/tasks/[id]/task-details-client.tsx. This stage governs status, priority, assignment, comments/activity implied by the domain schema, and attached files.
Uploads cross an API/storage boundary: general and avatar upload handlers are app/api/upload/route.ts and app/api/upload/avatar/route.ts; file retrieval is served from app/api/serve/[id]/route.ts. Storage integration modules are lib/upload.ts, lib/supabase/client.ts, and lib/supabase/server.ts.
Reporting and Calendar Projections
Analytics and calendar are read-oriented projections over workspace/project/task data. Page entry points are app/(authenticated)/analytics/page.tsx and app/(authenticated)/calendar/page.tsx; their data actions are in their respective componentsaction/actions.ts modules. Analytics visualization is implemented through chart components such as components/analytics/charts/burndown-chart.tsx and components/analytics/charts/activity-trend-chart.tsx, while task scheduling is rendered by app/(authenticated)/calendar/components/calendar-view.tsx.
Persistence and External Infrastructure
PostgreSQL is the system of record, accessed through Prisma via lib/prisma.ts; entity definitions and relational constraints are in prisma/schema.prisma, with evolvable schema history in prisma/migrations/. Brevo supplies invitation email delivery through lib/email/send.ts. Optional GitHub and Google OAuth providers are supported by the Better Auth configuration described by the repository. Supabase is materially present for upload/storage access, distinct from Prisma/PostgreSQL persistence.
Main entry points: app-sidebar.tsx Workspace navigation · prisma.ts Prisma data access · actions.ts Task mutations · schema.prisma Workspace membership
Components 22
App Router UI
Public and protected user experiences.
- Application shell
app/layout.tsx - Login and signup
app/(public)/login/page.tsx - Authenticated shell · Principal boundary for signed-in pages.
app/(authenticated)/layout.tsx - Workspace navigation
components/app-sidebar.tsx - Calendar projection
app/(authenticated)/calendar/page.tsx - Analytics projection
app/(authenticated)/analytics/page.tsx
Collaboration workflows
Workspace-scoped project and task operations.
- Workspace membership · Roles and membership scope protected operations.
prisma/schema.prisma - Projects
app/(authenticated)/projects/page.tsx - Project mutations
app/(authenticated)/projects/componentsaction/actions.ts - Team and roles · Manages members, invitations, and roles.
app/(authenticated)/team/page.tsx - Invitation workflow · Public invite resolution and authenticated acceptance.
lib/invitations.ts - Accept invitation
app/api/invite/accept/route.ts - Tasks
app/(authenticated)/tasks/page.tsx - Task mutations
app/(authenticated)/tasks/componentsaction/actions.ts - Kanban workflow · Drag-and-drop task status workflow.
app/(authenticated)/tasks/components/kanban-board.tsx
Platform services
Identity, persistence, storage, and delivery integrations.
- Better Auth handler
app/api/auth/[...all]/route.ts - Auth clients and config
lib/auth.ts - Upload API · Handles general and avatar uploads.
app/api/upload/route.ts - Supabase Storage · Attachment and avatar storage access.
lib/supabase/server.ts - Prisma data access
lib/prisma.ts - PostgreSQL
prisma/schema.prisma - Brevo email delivery · Delivers workspace invitations.
lib/email/send.ts
Connections 27
- Application shell → Login and signup: renders anonymous routes
- Application shell → Authenticated shell: renders signed-in routes
- Authenticated shell → Workspace navigation: includes
- Login and signup → Better Auth handler: authenticates through
- Authenticated shell → Auth clients and config: checks session
- Auth clients and config → Better Auth handler: configures
- Better Auth handler → Workspace membership: establishes identity for
- Workspace navigation → Projects: navigates to
- Workspace navigation → Tasks: navigates to
- Workspace navigation → Calendar projection: navigates to
- Workspace navigation → Analytics projection: navigates to
- Projects → Project mutations: mutates via
- Project mutations → Workspace membership: authorizes against
- Team and roles → Invitation workflow: creates and manages
- Invitation workflow → Accept invitation: acceptance endpoint
- Invitation workflow → Brevo email delivery: sends via
- Tasks → Task mutations: mutates via
- Tasks → Kanban workflow: renders board
- Task mutations → Workspace membership: authorizes against
- Task mutations → Upload API: attaches files through
- Upload API → Supabase Storage: stores files
- Calendar projection → Prisma data access: reads scheduled tasks
- Analytics projection → Prisma data access: reads reporting data
- Project mutations → Prisma data access: persists through
- Task mutations → Prisma data access: persists through
- Prisma data access → PostgreSQL: queries
- Workspace membership → PostgreSQL: defines relations for