# polkboban/teamsync architecture

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

- Interactive diagram: https://gitdiagram.com/polkboban/teamsync
- Repository: https://github.com/polkboban/teamsync

## Overview

TeamSync is a real-time collaborative project-management workspace. Users register or sign in, enter workspaces and boards, manage lists and tasks, and collaborate through comments, checklists, presence, and notifications. The graph follows the documented route and task flows; workspace and board API details are only partly sampled, so uncertain client-to-server links are omitted. PostgreSQL, Redis, and Socket.IO capabilities are documented in the README, but not every implementation detail is shown.

Main entry points: [`frontend/src/App.tsx`](https://github.com/polkboban/teamsync/blob/main/frontend/src/App.tsx) (Route shell), [`frontend/src/pages/BoardPage.tsx`](https://github.com/polkboban/teamsync/blob/main/frontend/src/pages/BoardPage.tsx) (Board workspace), [`ts-backend/src/middleware/auth.ts`](https://github.com/polkboban/teamsync/blob/main/ts-backend/src/middleware/auth.ts) (Token authentication), [`ts-backend/src/index.ts`](https://github.com/polkboban/teamsync/blob/main/ts-backend/src/index.ts) (Express route registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["Route shell<br/>[App.tsx]"]
  node_authui["Session context<br/>[AuthContext.tsx]"]
  node_authpages["Sign-in and registration<br/>[LoginPage.tsx]"]
  node_landing["Landing page<br/>[LandingPage.tsx]"]
  node_palette["Command palette<br/>[CommandPalette.tsx]"]
  node_http["HTTP client<br/>[client.ts]"]
end

subgraph group_domain["Workspace and tasks"]
  node_workspaceui["Workspace directory<br/>[WorkspacesPage.tsx]"]
  node_boardui["Board workspace<br/>[BoardPage.tsx]"]
  node_taskdetail["Task inspector"]
  node_taskapi["Task API client<br/>[tasks.ts]"]
  node_workcontroller["Workspace handlers"]
  node_taskcontroller["Task handlers<br/>[taskController.ts]"]
end

subgraph group_server["API and identity"]
  node_routes["Express route registration<br/>[index.ts]"]
  node_authroutes["Authentication routes<br/>[authRoutes.ts]"]
  node_workroutes["Workspace routes<br/>[workspaceRoutes.ts]"]
  node_taskroutes["Task routes<br/>[taskRoutes.ts]"]
  node_authcontroller["Authentication handlers<br/>[authController.ts]"]
  node_authmw["Token authentication<br/>[auth.ts]"]
  node_jwt["JWT utilities<br/>[jwt.ts]"]
end

subgraph group_realtime["Live collaboration"]
  node_socketui["Socket context<br/>[SocketContext.tsx]"]
  node_socketserver["Socket server<br/>[socket.ts]"]
  node_redisconfig["Redis connection<br/>[redis.ts]"]
end

node_user(("Team member"))
node_postgres[("PostgreSQL database")]
node_redis[("Redis Pub/Sub and cache")]

node_user -->|"uses"| node_app
node_app -->|"provides"| node_authui
node_app -->|"routes"| node_authpages
node_app -->|"routes"| node_landing
node_app -->|"routes"| node_workspaceui
node_app -->|"routes"| node_boardui
node_authpages -->|"calls"| node_authui
node_boardui -->|"calls"| node_taskapi
node_boardui -->|"renders"| node_taskdetail
node_boardui -->|"renders"| node_palette
node_taskdetail -->|"calls"| node_taskapi
node_taskapi -->|"sends requests"| node_http
node_app -->|"provides"| node_socketui
node_routes -->|"mounts"| node_authroutes
node_routes -->|"mounts"| node_workroutes
node_routes -->|"mounts"| node_taskroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_workroutes -->|"dispatches"| node_workcontroller
node_taskroutes -->|"dispatches"| node_taskcontroller
node_authroutes -->|"authenticates"| node_authmw
node_workroutes -->|"authenticates"| node_authmw
node_taskroutes -->|"authenticates"| node_authmw
node_authmw -->|"verifies token"| node_jwt
node_taskcontroller -->|"reads and writes"| node_postgres
node_workcontroller -->|"reads and writes"| node_postgres
node_workcontroller -->|"uses"| node_redisconfig
node_redisconfig -->|"connects"| node_redis
node_taskcontroller -->|"emits updates"| node_socketserver
node_socketui -->|"exchanges events"| node_socketserver
node_socketserver -->|"uses"| node_redisconfig

click node_app "https://github.com/polkboban/teamsync/blob/main/frontend/src/App.tsx"
click node_authui "https://github.com/polkboban/teamsync/blob/main/frontend/src/context/AuthContext.tsx"
click node_authpages "https://github.com/polkboban/teamsync/blob/main/frontend/src/pages/LoginPage.tsx"
click node_landing "https://github.com/polkboban/teamsync/blob/main/frontend/src/pages/LandingPage.tsx"
click node_workspaceui "https://github.com/polkboban/teamsync/blob/main/frontend/src/pages/WorkspacesPage.tsx"
click node_boardui "https://github.com/polkboban/teamsync/blob/main/frontend/src/pages/BoardPage.tsx"
click node_taskdetail "https://github.com/polkboban/teamsync/blob/main/frontend/src/components/TaskDetailsDrawer.tsx"
click node_palette "https://github.com/polkboban/teamsync/blob/main/frontend/src/components/CommandPalette.tsx"
click node_taskapi "https://github.com/polkboban/teamsync/blob/main/frontend/src/api/tasks.ts"
click node_http "https://github.com/polkboban/teamsync/blob/main/frontend/src/api/client.ts"
click node_socketui "https://github.com/polkboban/teamsync/blob/main/frontend/src/context/SocketContext.tsx"
click node_routes "https://github.com/polkboban/teamsync/blob/main/ts-backend/src/index.ts"
click node_authroutes "https://github.com/polkboban/teamsync/blob/main/ts-backend/src/routes/authRoutes.ts"
click node_workroutes "https://github.com/polkboban/teamsync/blob/main/ts-backend/src/routes/workspaceRoutes.ts"
click node_taskroutes "https://github.com/polkboban/teamsync/blob/main/ts-backend/src/routes/taskRoutes.ts"
click node_authcontroller "https://github.com/polkboban/teamsync/blob/main/ts-backend/src/controllers/authController.ts"
click node_workcontroller "https://github.com/polkboban/teamsync/blob/main/ts-backend/src/controllers/workspaceController.ts"
click node_taskcontroller "https://github.com/polkboban/teamsync/blob/main/ts-backend/src/controllers/taskController.ts"
click node_authmw "https://github.com/polkboban/teamsync/blob/main/ts-backend/src/middleware/auth.ts"
click node_jwt "https://github.com/polkboban/teamsync/blob/main/ts-backend/src/utils/jwt.ts"
click node_socketserver "https://github.com/polkboban/teamsync/blob/main/ts-backend/src/socket.ts"
click node_redisconfig "https://github.com/polkboban/teamsync/blob/main/ts-backend/src/config/redis.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_app,node_authui,node_authpages,node_landing,node_palette,node_http toneBlue
class node_workspaceui,node_boardui,node_taskdetail,node_taskapi,node_workcontroller,node_taskcontroller,node_postgres,node_redis toneAmber
class node_routes,node_authroutes,node_workroutes,node_taskroutes,node_authcontroller,node_authmw,node_jwt toneMint
class node_socketui,node_socketserver,node_redisconfig toneRose
class node_user toneIndigo
```

## Components

### Web application

- [Route shell](https://github.com/polkboban/teamsync/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Session context](https://github.com/polkboban/teamsync/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [Sign-in and registration](https://github.com/polkboban/teamsync/blob/main/frontend/src/pages/LoginPage.tsx): `frontend/src/pages/LoginPage.tsx`
- [Landing page](https://github.com/polkboban/teamsync/blob/main/frontend/src/pages/LandingPage.tsx): `frontend/src/pages/LandingPage.tsx`
- [Command palette](https://github.com/polkboban/teamsync/blob/main/frontend/src/components/CommandPalette.tsx): `frontend/src/components/CommandPalette.tsx`
- [HTTP client](https://github.com/polkboban/teamsync/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### Workspace and tasks

- [Workspace directory](https://github.com/polkboban/teamsync/blob/main/frontend/src/pages/WorkspacesPage.tsx): `frontend/src/pages/WorkspacesPage.tsx`
- [Board workspace](https://github.com/polkboban/teamsync/blob/main/frontend/src/pages/BoardPage.tsx): `frontend/src/pages/BoardPage.tsx`
- [Task inspector](https://github.com/polkboban/teamsync/blob/main/frontend/src/components/TaskDetailsDrawer.tsx): `frontend/src/components/TaskDetailsDrawer.tsx`
- [Task API client](https://github.com/polkboban/teamsync/blob/main/frontend/src/api/tasks.ts): `frontend/src/api/tasks.ts`
- [Workspace handlers](https://github.com/polkboban/teamsync/blob/main/ts-backend/src/controllers/workspaceController.ts): `ts-backend/src/controllers/workspaceController.ts`
- [Task handlers](https://github.com/polkboban/teamsync/blob/main/ts-backend/src/controllers/taskController.ts): `ts-backend/src/controllers/taskController.ts`

### API and identity

- [Express route registration](https://github.com/polkboban/teamsync/blob/main/ts-backend/src/index.ts): `ts-backend/src/index.ts`
- [Authentication routes](https://github.com/polkboban/teamsync/blob/main/ts-backend/src/routes/authRoutes.ts): `ts-backend/src/routes/authRoutes.ts`
- [Workspace routes](https://github.com/polkboban/teamsync/blob/main/ts-backend/src/routes/workspaceRoutes.ts): `ts-backend/src/routes/workspaceRoutes.ts`
- [Task routes](https://github.com/polkboban/teamsync/blob/main/ts-backend/src/routes/taskRoutes.ts): `ts-backend/src/routes/taskRoutes.ts`
- [Authentication handlers](https://github.com/polkboban/teamsync/blob/main/ts-backend/src/controllers/authController.ts): `ts-backend/src/controllers/authController.ts`
- [Token authentication](https://github.com/polkboban/teamsync/blob/main/ts-backend/src/middleware/auth.ts): `ts-backend/src/middleware/auth.ts`
- [JWT utilities](https://github.com/polkboban/teamsync/blob/main/ts-backend/src/utils/jwt.ts): `ts-backend/src/utils/jwt.ts`

### Live collaboration

- [Socket context](https://github.com/polkboban/teamsync/blob/main/frontend/src/context/SocketContext.tsx): `frontend/src/context/SocketContext.tsx`
- [Socket server](https://github.com/polkboban/teamsync/blob/main/ts-backend/src/socket.ts): `ts-backend/src/socket.ts`
- [Redis connection](https://github.com/polkboban/teamsync/blob/main/ts-backend/src/config/redis.ts): `ts-backend/src/config/redis.ts`

### Other components

- **Team member**
- **PostgreSQL database**
- **Redis Pub/Sub and cache**

## Connections

- Team member → Route shell: uses
- Route shell → Session context: provides (evidence: `frontend/src/App.tsx`)
- Route shell → Sign-in and registration: routes (evidence: `frontend/src/App.tsx`)
- Route shell → Landing page: routes (evidence: `frontend/src/App.tsx`)
- Route shell → Workspace directory: routes (evidence: `frontend/src/App.tsx`)
- Route shell → Board workspace: routes (evidence: `frontend/src/App.tsx`)
- Sign-in and registration → Session context: calls (evidence: `frontend/src/pages/LoginPage.tsx`)
- Board workspace → Task API client: calls (evidence: `frontend/src/pages/BoardPage.tsx`)
- Board workspace → Task inspector: renders (evidence: `frontend/src/pages/BoardPage.tsx`)
- Board workspace → Command palette: renders (evidence: `frontend/src/pages/BoardPage.tsx`)
- Task inspector → Task API client: calls (evidence: `frontend/src/components/TaskDetailsDrawer.tsx`)
- Task API client → HTTP client: sends requests (evidence: `frontend/src/api/tasks.ts`)
- Route shell → Socket context: provides (evidence: `frontend/src/App.tsx`)
- Express route registration → Authentication routes: mounts (evidence: `ts-backend/src/index.ts`)
- Express route registration → Workspace routes: mounts (evidence: `ts-backend/src/index.ts`)
- Express route registration → Task routes: mounts (evidence: `ts-backend/src/index.ts`)
- Authentication routes → Authentication handlers: dispatches (evidence: `ts-backend/src/routes/authRoutes.ts`)
- Workspace routes → Workspace handlers: dispatches (evidence: `ts-backend/src/routes/workspaceRoutes.ts`)
- Task routes → Task handlers: dispatches (evidence: `ts-backend/src/routes/taskRoutes.ts`)
- Authentication routes → Token authentication: authenticates (evidence: `ts-backend/src/routes/authRoutes.ts`)
- Workspace routes → Token authentication: authenticates (evidence: `ts-backend/src/routes/workspaceRoutes.ts`)
- Task routes → Token authentication: authenticates (evidence: `ts-backend/src/routes/taskRoutes.ts`)
- Token authentication → JWT utilities: verifies token (evidence: `ts-backend/src/middleware/auth.ts`)
- Task handlers → PostgreSQL database: reads and writes (evidence: `ts-backend/src/controllers/taskController.ts`)
- Workspace handlers → PostgreSQL database: reads and writes (evidence: `ts-backend/src/controllers/workspaceController.ts`)
- Workspace handlers → Redis connection: uses (evidence: `ts-backend/src/controllers/workspaceController.ts`)
- Redis connection → Redis Pub/Sub and cache: connects (evidence: `ts-backend/src/config/redis.ts`)
- Task handlers → Socket server: emits updates (evidence: `ts-backend/src/controllers/taskController.ts`)
- Socket context → Socket server: exchanges events
- Socket server → Redis connection: uses (evidence: `ts-backend/src/socket.ts`)
