# antiwork/gumboard architecture

> Architecture diagram of the GitHub repository antiwork/gumboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/antiwork/gumboard
- Repository: https://github.com/antiwork/gumboard

## Overview

##### Project type and purpose
- This is a full-stack, team to-do board web application (“Gumboard”) built on Next.js 13’s App Router.
- It provides user authentication (NextAuth) with Google and GitHub, boards with sticky-note style to-dos, organization invites, Slack notifications, and a PostgreSQL database via Prisma ORM.

##### File structure
- Top-level “app” folder contains both frontend React pages/components and Next.js API route handlers under `app/api/`.
- “components” holds shared UI primitives.
- “lib” contains utility functions (DB connector, Slack integration, environment config).
- “prisma” defines the database schema and migration history.
- Config files: `docker-compose.yml` for local Postgres, `next.config.ts`, CI workflows, lint/test configs.

##### README for additional insights
- The README confirms Docker Compose for Postgres, use of Prisma for schema migrations, NextAuth for auth, and OAuth setup steps for Google/GitHub.
- Mentions local dev server, database management commands, and Vercel deployment.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        Pages["App Router Pages"]:::frontend
        UIComp["Shared UI Components"]:::frontend
        UserCtx["UserContext"]:::frontend
    end

    %% API Layer
    subgraph "API Layer"
        direction TB
        APIRoutes["Next.js API Routes"]:::backend
        AuthConfig["NextAuth Configuration"]:::backend
        Middleware["Request Middleware"]:::backend
    end

    %% Prisma & Utils
    subgraph "Prisma & Utilities"
        direction TB
        DBConn["DB Connector (lib/db.ts)"]:::backend
        EnvCfg["Environment Config (lib/env.ts)"]:::backend
        GeneralUtil["General Utilities (lib/utils.ts, lib/constants.ts)"]:::backend
        SlackUtil["Slack Integration Utility"]:::backend
        PrismaORM["Prisma ORM"]:::db
    end

    %% Database
    Postgres["PostgreSQL Database"]:::db

    %% External Services
    subgraph "External Services"
        direction TB
        OAuth["OAuth Providers (Google, GitHub)"]:::external
        SlackExt["Slack Incoming Webhook"]:::external
    end

    %% CI/CD
    CIPipeline["CI/CD (GitHub Actions)"]:::ci
    Vercel["Vercel Deployment"]:::ci

    %% Connections
    Browser["Web Browser"]:::external
    Browser --> Pages
    Pages --> APIRoutes
    Pages --> UIComp
    Pages --> UserCtx

    APIRoutes --> DBConn
    DBConn --> PrismaORM
    PrismaORM --> Postgres
    APIRoutes --> SlackUtil
    SlackUtil --> SlackExt

    APIRoutes --> AuthConfig
    AuthConfig --> OAuth

    APIRoutes --> Middleware
    Middleware --> AuthConfig

    EnvCfg --> Pages
    EnvCfg --> APIRoutes
    EnvCfg --> DBConn
    EnvCfg --> AuthConfig

    CIPipeline -.-> Vercel

    %% Click Events
    click Pages "https://github.com/antiwork/gumboard/blob/main/app/page.tsx"
    click UIComp "https://github.com/antiwork/gumboard/tree/main/components/"
    click UIComp "https://github.com/antiwork/gumboard/tree/main/components/ui/"
    click UserCtx "https://github.com/antiwork/gumboard/blob/main/app/contexts/UserContext.tsx"
    click APIRoutes "https://github.com/antiwork/gumboard/blob/main/app/api/boards/route.ts"
    click AuthConfig "https://github.com/antiwork/gumboard/blob/main/app/api/auth/[...nextauth]/route.ts"
    click Middleware "https://github.com/antiwork/gumboard/blob/main/middleware.ts"
    click DBConn "https://github.com/antiwork/gumboard/blob/main/lib/db.ts"
    click EnvCfg "https://github.com/antiwork/gumboard/blob/main/lib/env.ts"
    click GeneralUtil "https://github.com/antiwork/gumboard/blob/main/lib/utils.ts"
    click SlackUtil "https://github.com/antiwork/gumboard/blob/main/lib/slack.ts"
    click PrismaORM "https://github.com/antiwork/gumboard/blob/main/prisma/schema.prisma"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef backend fill:#90EE90,stroke:#333,stroke-width:1px
    classDef db fill:#F4A460,stroke:#333,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef ci stroke-dasharray: 5 5,fill:#FFFFFF,stroke:#333,stroke-width:1px
```
