# nimalansivakumar/theboard architecture

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

- Interactive diagram: https://gitdiagram.com/nimalansivakumar/theboard
- Repository: https://github.com/nimalansivakumar/theboard

## Overview

TheBoard is a workspace collaboration app: users sign in, join or create a space, then work with boards and documents. The tree also indicates teams, calendar views, settings, Gmail integration, and an AI endpoint. The graph preserves these product areas, but several UI and domain implementations were not excerpted; those relationships are omitted rather than inferred. Supabase provides the persistence and session layer, with typed schema and client setup.

Main entry points: [`supabase/service/supabase-client-ops.ts`](https://github.com/nimalansivakumar/theboard/blob/master/supabase/service/supabase-client-ops.ts) (Supabase operations), [`app/login/page.tsx`](https://github.com/nimalansivakumar/theboard/blob/master/app/login/page.tsx) (Sign in), [`app/api/gsync/route.ts`](https://github.com/nimalansivakumar/theboard/blob/master/app/api/gsync/route.ts) (Gmail sync API), [`app/space/[org]/page.tsx`](https://github.com/nimalansivakumar/theboard/blob/master/app/space/%5Borg%5D/page.tsx) (Space entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and setup"]
  node_login["Sign in<br/>[page.tsx]"]
  node_authcontext["Auth context<br/>[AuthContext.tsx]"]
  node_onboarding["Space onboarding<br/>[page.tsx]"]
  node_signup["Sign up<br/>[page.tsx]"]
  node_settings["Profile and settings<br/>[page.tsx]"]
end

subgraph group_workspace["Workspace collaboration"]
  node_spacepage["Space entry<br/>[page.tsx]"]
  node_space["Workspace shell<br/>[Space.tsx]"]
  node_boards["Boards and calendar"]
  node_teams["Teams<br/>[teams.tsx]"]
  node_documents["Documents editor<br/>[Editor.ts]"]
  node_editorcontroller["Editor toolbar"]
end

subgraph group_integrations["Integrations"]
  node_gmailroutes["Gmail sync API<br/>[route.ts]"]
  node_gmailreader["Email reader<br/>[gmail-reader.ts]"]
  node_gauth["Google authorization<br/>[gauth-util.ts]"]
  node_aiendpoint["AI endpoint<br/>[route.ts]"]
  node_pipeline["Text pipeline<br/>[pipeline.ts]"]
  node_hf["Hugging Face adapter<br/>[huggingface.ts]"]
end

subgraph group_platform["Data and shared UI"]
  node_dbops["Supabase operations"]
  node_serverops["Server operations"]
  node_browserclient["Browser client<br/>[client.ts]"]
  node_serverclient["Server client<br/>[server.ts]"]
  node_schema[("Database schema<br/>[supabase.ts]")]
  node_rowtypes["Row types<br/>[row-types.ts]"]
  node_dbtypes["Database types<br/>[database.types.ts]"]
  node_uicomponents["Shared UI primitives"]
end

node_user(("User"))

node_user -->|"signs in"| node_login
node_login -->|"authenticates"| node_dbops
node_login -->|"sets session"| node_authcontext
node_login -->|"routes new users"| node_onboarding
node_login -->|"routes members"| node_spacepage
node_user -->|"creates workspace"| node_onboarding
node_onboarding -->|"creates space and account"| node_dbops
node_user -.->|"registers"| node_signup
node_spacepage -->|"creates server session client"| node_serverclient
node_spacepage -->|"loads workspace data"| node_serverops
node_spacepage -->|"renders"| node_space
node_space -.->|"shows boards"| node_boards
node_space -.->|"shows teams"| node_teams
node_space -.->|"opens documents"| node_documents
node_user -.->|"updates profile"| node_settings
node_settings -->|"updates profile data"| node_dbops
node_editorcontroller -->|"controls editor"| node_documents
node_gmailroutes -->|"reads messages"| node_gmailreader
node_gmailroutes -->|"refreshes authorization"| node_gauth
node_gmailroutes -->|"reads board details"| node_dbops
node_gmailroutes -->|"stores imported items"| node_dbops
node_user -.->|"requests email import"| node_gmailroutes
node_aiendpoint -->|"uses pipeline"| node_pipeline
node_aiendpoint -->|"uses adapter"| node_hf
node_dbops -->|"creates client"| node_browserclient
node_browserclient -->|"types client"| node_schema
node_serverclient -->|"types client"| node_schema
node_rowtypes -->|"derives row types"| node_dbtypes
node_dbops -->|"uses database types"| node_dbtypes
node_dbops -.->|"queries Supabase"| node_schema
node_login -->|"renders controls"| node_uicomponents
node_onboarding -->|"renders controls"| node_uicomponents

click node_login "https://github.com/nimalansivakumar/theboard/blob/master/app/login/page.tsx"
click node_authcontext "https://github.com/nimalansivakumar/theboard/blob/master/app/context/AuthContext.tsx"
click node_onboarding "https://github.com/nimalansivakumar/theboard/blob/master/app/onboarding/page.tsx"
click node_signup "https://github.com/nimalansivakumar/theboard/blob/master/app/signup/page.tsx"
click node_spacepage "https://github.com/nimalansivakumar/theboard/blob/master/app/space/%5Borg%5D/page.tsx"
click node_space "https://github.com/nimalansivakumar/theboard/blob/master/app/space/%5Borg%5D/Space.tsx"
click node_boards "https://github.com/nimalansivakumar/theboard/tree/master/app/space/%5Borg%5D/board"
click node_teams "https://github.com/nimalansivakumar/theboard/blob/master/app/space/%5Borg%5D/teams/teams.tsx"
click node_documents "https://github.com/nimalansivakumar/theboard/blob/master/app/space/%5Borg%5D/mydocs/Editor.ts"
click node_settings "https://github.com/nimalansivakumar/theboard/blob/master/app/settings/page.tsx"
click node_gmailroutes "https://github.com/nimalansivakumar/theboard/blob/master/app/api/gsync/route.ts"
click node_gmailreader "https://github.com/nimalansivakumar/theboard/blob/master/app/api/gsync/gmail-reader.ts"
click node_gauth "https://github.com/nimalansivakumar/theboard/blob/master/app/api/gauth/gauth-util.ts"
click node_aiendpoint "https://github.com/nimalansivakumar/theboard/blob/master/app/api/runai/route.ts"
click node_pipeline "https://github.com/nimalansivakumar/theboard/blob/master/app/api/transformers/pipeline.ts"
click node_hf "https://github.com/nimalansivakumar/theboard/blob/master/app/api/transformers/huggingface.ts"
click node_dbops "https://github.com/nimalansivakumar/theboard/blob/master/supabase/service/supabase-client-ops.ts"
click node_serverops "https://github.com/nimalansivakumar/theboard/blob/master/supabase/service/serveroperations.ts"
click node_browserclient "https://github.com/nimalansivakumar/theboard/blob/master/supabase/client.ts"
click node_serverclient "https://github.com/nimalansivakumar/theboard/blob/master/supabase/server.ts"
click node_schema "https://github.com/nimalansivakumar/theboard/blob/master/supabase/schema/supabase.ts"
click node_rowtypes "https://github.com/nimalansivakumar/theboard/blob/master/supabase/schema/row-types.ts"
click node_dbtypes "https://github.com/nimalansivakumar/theboard/blob/master/database.types.ts"
click node_uicomponents "https://github.com/nimalansivakumar/theboard/tree/master/components/ui"
click node_editorcontroller "https://github.com/nimalansivakumar/theboard/blob/master/components/EditorComponents/EditorController.tsx"

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_login,node_authcontext,node_onboarding,node_signup,node_settings,node_user toneBlue
class node_spacepage,node_space,node_boards,node_teams,node_documents,node_editorcontroller toneAmber
class node_gmailroutes,node_gmailreader,node_gauth,node_aiendpoint,node_pipeline,node_hf toneMint
class node_dbops,node_serverops,node_browserclient,node_serverclient,node_schema,node_rowtypes,node_dbtypes,node_uicomponents toneRose
```

## Components

### Identity and setup

- [Sign in](https://github.com/nimalansivakumar/theboard/blob/master/app/login/page.tsx): `app/login/page.tsx`
- [Auth context](https://github.com/nimalansivakumar/theboard/blob/master/app/context/AuthContext.tsx): `app/context/AuthContext.tsx`
- [Space onboarding](https://github.com/nimalansivakumar/theboard/blob/master/app/onboarding/page.tsx): `app/onboarding/page.tsx`
- [Sign up](https://github.com/nimalansivakumar/theboard/blob/master/app/signup/page.tsx): `app/signup/page.tsx`
- [Profile and settings](https://github.com/nimalansivakumar/theboard/blob/master/app/settings/page.tsx): `app/settings/page.tsx`

### Workspace collaboration

- [Space entry](https://github.com/nimalansivakumar/theboard/blob/master/app/space/%5Borg%5D/page.tsx): `app/space/[org]/page.tsx`
- [Workspace shell](https://github.com/nimalansivakumar/theboard/blob/master/app/space/%5Borg%5D/Space.tsx): `app/space/[org]/Space.tsx`
- [Boards and calendar](https://github.com/nimalansivakumar/theboard/tree/master/app/space/%5Borg%5D/board): `app/space/[org]/board`
- [Teams](https://github.com/nimalansivakumar/theboard/blob/master/app/space/%5Borg%5D/teams/teams.tsx): `app/space/[org]/teams/teams.tsx`
- [Documents editor](https://github.com/nimalansivakumar/theboard/blob/master/app/space/%5Borg%5D/mydocs/Editor.ts): `app/space/[org]/mydocs/Editor.ts`
- [Editor toolbar](https://github.com/nimalansivakumar/theboard/blob/master/components/EditorComponents/EditorController.tsx): `components/EditorComponents/EditorController.tsx`

### Integrations

- [Gmail sync API](https://github.com/nimalansivakumar/theboard/blob/master/app/api/gsync/route.ts): `app/api/gsync/route.ts`
- [Email reader](https://github.com/nimalansivakumar/theboard/blob/master/app/api/gsync/gmail-reader.ts): `app/api/gsync/gmail-reader.ts`
- [Google authorization](https://github.com/nimalansivakumar/theboard/blob/master/app/api/gauth/gauth-util.ts): `app/api/gauth/gauth-util.ts`
- [AI endpoint](https://github.com/nimalansivakumar/theboard/blob/master/app/api/runai/route.ts): `app/api/runai/route.ts`
- [Text pipeline](https://github.com/nimalansivakumar/theboard/blob/master/app/api/transformers/pipeline.ts): `app/api/transformers/pipeline.ts`
- [Hugging Face adapter](https://github.com/nimalansivakumar/theboard/blob/master/app/api/transformers/huggingface.ts): `app/api/transformers/huggingface.ts`

### Data and shared UI

- [Supabase operations](https://github.com/nimalansivakumar/theboard/blob/master/supabase/service/supabase-client-ops.ts): `supabase/service/supabase-client-ops.ts`
- [Server operations](https://github.com/nimalansivakumar/theboard/blob/master/supabase/service/serveroperations.ts): `supabase/service/serveroperations.ts`
- [Browser client](https://github.com/nimalansivakumar/theboard/blob/master/supabase/client.ts): `supabase/client.ts`
- [Server client](https://github.com/nimalansivakumar/theboard/blob/master/supabase/server.ts): `supabase/server.ts`
- [Database schema](https://github.com/nimalansivakumar/theboard/blob/master/supabase/schema/supabase.ts): `supabase/schema/supabase.ts`
- [Row types](https://github.com/nimalansivakumar/theboard/blob/master/supabase/schema/row-types.ts): `supabase/schema/row-types.ts`
- [Database types](https://github.com/nimalansivakumar/theboard/blob/master/database.types.ts): `database.types.ts`
- [Shared UI primitives](https://github.com/nimalansivakumar/theboard/tree/master/components/ui): `components/ui`

### Other components

- **User**

## Connections

- User → Sign in: signs in (evidence: `app/login/page.tsx`)
- Sign in → Supabase operations: authenticates (evidence: `app/login/page.tsx`)
- Sign in → Auth context: sets session (evidence: `app/login/page.tsx`)
- Sign in → Space onboarding: routes new users (evidence: `app/login/page.tsx`)
- Sign in → Space entry: routes members (evidence: `app/login/page.tsx`)
- User → Space onboarding: creates workspace (evidence: `app/onboarding/page.tsx`)
- Space onboarding → Supabase operations: creates space and account (evidence: `app/onboarding/page.tsx`)
- User → Sign up: registers
- Space entry → Server client: creates server session client (evidence: `app/space/[org]/page.tsx`)
- Space entry → Server operations: loads workspace data (evidence: `app/space/[org]/page.tsx`)
- Space entry → Workspace shell: renders (evidence: `app/space/[org]/page.tsx`)
- Workspace shell → Boards and calendar: shows boards
- Workspace shell → Teams: shows teams
- Workspace shell → Documents editor: opens documents
- User → Profile and settings: updates profile
- Profile and settings → Supabase operations: updates profile data
- Editor toolbar → Documents editor: controls editor (evidence: `components/EditorComponents/EditorController.tsx`)
- Gmail sync API → Email reader: reads messages (evidence: `app/api/gsync/route.ts`)
- Gmail sync API → Google authorization: refreshes authorization (evidence: `app/api/gsync/route.ts`)
- Gmail sync API → Supabase operations: reads board details (evidence: `app/api/gsync/route.ts`)
- Gmail sync API → Supabase operations: stores imported items (evidence: `app/api/gsync/route.ts`)
- User → Gmail sync API: requests email import
- AI endpoint → Text pipeline: uses pipeline (evidence: `app/api/runai/route.ts`)
- AI endpoint → Hugging Face adapter: uses adapter (evidence: `app/api/runai/route.ts`)
- Supabase operations → Browser client: creates client (evidence: `supabase/service/supabase-client-ops.ts`)
- Browser client → Database schema: types client (evidence: `supabase/client.ts`)
- Server client → Database schema: types client (evidence: `supabase/server.ts`)
- Row types → Database types: derives row types (evidence: `supabase/schema/row-types.ts`)
- Supabase operations → Database types: uses database types (evidence: `supabase/service/supabase-client-ops.ts`)
- Supabase operations → Database schema: queries Supabase
- Sign in → Shared UI primitives: renders controls (evidence: `app/login/page.tsx`)
- Space onboarding → Shared UI primitives: renders controls (evidence: `app/onboarding/page.tsx`)
