# viswaksena-j/boardify architecture

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

- Interactive diagram: https://gitdiagram.com/viswaksena-j/boardify
- Repository: https://github.com/viswaksena-j/boardify

## Overview

##### Main Components

A. Frontend Layer:
- Marketing Section (`app/(marketing)`)
- Platform Section (`app/(platform)`)
- Authentication (Clerk integration)
- Dashboard
- Board Management
- Organization Management
- UI Components (`components/`)
- Client-side State Management (React Query via `query-provider.tsx`)

B. Backend Layer:
- API Routes (`app/api/`)
- Database Layer (Prisma ORM)
- Authentication Service (Clerk)
- External Services:
- Stripe Integration
- Unsplash Integration

C. Action Layer:
- Board Actions
- Card Actions
- Actions

**[Client Layer]**
- ↑↓
**[Next.js App Router]**
- ↑↓
**[Server Components/Actions]**
- ↑↓
**[External Services] ← → [Database]**

##### Key Relationships to Highlight

a. Client-Server Flow:
- How the app router handles different routes
- Server component rendering
- API endpoint connections

b. Data Flow:
- Database interactions through Prisma
- Server actions implementation
- Real-time updates and state management

c. Authentication Flow:
- Clerk integration points
- Protected routes and middleware
- Organization selection flow

##### Important Architectural Patterns to Emphasize

- Next.js App Router Architecture
- Server Components usage
- Action-based state management
- Feature-based folder structure
- API route organization

##### Specific Implementation Details

a. Board Management:
**[Board UI] → [Board Actions] → [Database]**
- ↑↓
**[List Management] ← → [Card Management]**

b. Organization Flow:
**[Org Selection] → [Dashboard] → [Board List]**
- ↑↓
**[Activity Tracking] ← → [Settings]**

##### Additional Elements

- Error handling flows
- Form validation patterns
- Modal system architecture
- Activity logging system

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        UI[UI Components]
        Forms[Form Components]
        Modals[Modal System]
        State[State Management]
    end

    subgraph "App Router"
        Marketing[Marketing Section]
        Platform[Platform Section]
        
        subgraph "Platform Features"
            Auth[Authentication]
            Dashboard[Dashboard]
            Board[Board Management]
            Org[Organization Management]
            Activity[Activity Tracking]
            Settings[Settings Management]
        end
    end

    subgraph "Server Layer"
        API[API Routes]
        
        subgraph "Actions"
            BoardActions[Board Actions]
            CardActions[Card Actions]
            ListActions[List Actions]
        end
        
        DB[(Database)]
    end

    subgraph "External Services"
        Clerk[Clerk Auth]
        Stripe[Stripe]
        Unsplash[Unsplash]
    end

    %% Relationships
    UI --> Platform
    Forms --> Platform
    Modals --> Platform
    State --> Platform

    Marketing --> API
    Platform --> API
    
    API --> DB
    API --> Clerk
    API --> Stripe
    API --> Unsplash

    BoardActions --> DB
    CardActions --> DB
    ListActions --> DB

    Auth --> Clerk

    %% Styling
    classDef frontend fill:#a8d5ff
    classDef backend fill:#98ff98
    classDef database fill:#dda0dd
    classDef external fill:#ffeb99
    classDef actions fill:#ffa07a

    class UI,Forms,Modals,State frontend
    class API,Platform,Marketing backend
    class DB database
    class Clerk,Stripe,Unsplash external
    class BoardActions,CardActions,ListActions actions

    %% Click Events
    click UI "https://github.com/Viswaksena-J/Boardify/tree/main/components/ui/"
    click Forms "https://github.com/Viswaksena-J/Boardify/tree/main/components/form/"
    click Modals "https://github.com/Viswaksena-J/Boardify/tree/main/components/modals/"
    click State "https://github.com/Viswaksena-J/Boardify/blob/main/components/providers/query-provider.tsx"
    click Marketing "https://github.com/Viswaksena-J/Boardify/tree/main/app/(marketing)/"
    click Dashboard "https://github.com/Viswaksena-J/Boardify/tree/main/app/(platform)/(dashboard)/"
    click Auth "https://github.com/Viswaksena-J/Boardify/tree/main/app/(platform)/(clerk)/"
    click Board "https://github.com/Viswaksena-J/Boardify/tree/main/app/(platform)/(dashboard)/board/"
    click Org "https://github.com/Viswaksena-J/Boardify/tree/main/app/(platform)/(dashboard)/organization/"
    click Activity "https://github.com/Viswaksena-J/Boardify/tree/main/app/(platform)/(dashboard)/organization/[organizationId]/activity/"
    click Settings "https://github.com/Viswaksena-J/Boardify/tree/main/app/(platform)/(dashboard)/organization/[organizationId]/settings/"
    click API "https://github.com/Viswaksena-J/Boardify/tree/main/app/api/"
    click DB "https://github.com/Viswaksena-J/Boardify/blob/main/prisma/schema.prisma"
    click BoardActions "https://github.com/Viswaksena-J/Boardify/tree/main/actions/create-board/"
    click CardActions "https://github.com/Viswaksena-J/Boardify/tree/main/actions/create-card/"
    click ListActions "https://github.com/Viswaksena-J/Boardify/tree/main/actions/create-list/"
    click Stripe "https://github.com/Viswaksena-J/Boardify/blob/main/lib/stripe.ts"
    click Unsplash "https://github.com/Viswaksena-J/Boardify/blob/main/lib/unspalsh.ts"
```
