# mumukim0212/mykanban_be architecture

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

- Interactive diagram: https://gitdiagram.com/mumukim0212/mykanban_be
- Repository: https://github.com/mumukim0212/mykanban_be

## Overview

##### Main Components Identification

a) API Layer
- Entry point through Express.js (implied by the typical Node.js/TypeScript backend structure)
- Routes layer (/src/routes)
- Controllers layer (/src/controllers)

b) Database Layer
- Prisma ORM integration
- PostgreSQL database (implied by Prisma usage)

c) Core Domain Models
- Board model
- Card model

##### Component Relationships

- Client Requests → API Routes → Controllers → Prisma ORM → Database

##### Detailed Component Breakdown

a) API Layer (Top Level):
- Create two sub-components for routes:
- Board Routes (/board.routes.ts)
- Card Routes (/card.routes.ts)

b) Controller Layer (Middle Level):
- Board Controller
- Card Controller
- Direct connections to routes

c) Data Layer (Bottom Level):
- Main entities (Board, Card, Label)

##### Additional Architectural Details

Specific elements:
- Environment configuration (.env)
- TypeScript compilation flow
- Prisma migration system

- [Client Layer]
- ↓
- [API Routes Layer]
- ↓
- [Controllers Layer]
- ↓
- [Prisma ORM Layer]
- ↓
- [Database Layer]

##### Technical Specifications to Note

- TypeScript as the primary language
- Prisma as the ORM
- Database type (PostgreSQL)
- Node.js runtime

##### Key Relationships to Highlight

- RESTful nature of the API
- MVC-like pattern being used
- Separation of concerns between routes and controllers
- Data flow from API to database

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        CL[Client Application]
    end

    subgraph "API Layer"
        APP["Express App"]:::api
        BR["Board Routes"]:::api
        CR["Card Routes"]:::api
        APP --> BR
        APP --> CR
    end

    subgraph "Controller Layer"
        BC["Board Controller"]:::controller
        CC["Card Controller"]:::controller
        BR --> BC
        CR --> CC
    end

    subgraph "Data Layer"
        PRS["Prisma ORM"]:::data
        DB[(PostgreSQL)]:::database
        BC --> PRS
        CC --> PRS
        PRS --> DB
    end

    subgraph "Configuration"
        ENV["Environment Config"]:::config
        TS["TypeScript Config"]:::config
        SCHEMA["Database Schema"]:::config
        MIG["Database Migrations"]:::config
    end

    CL --> APP
    ENV -.-> APP
    TS -.-> APP
    SCHEMA -.-> PRS
    MIG -.-> DB

    %% Styling
    classDef api fill:#2196F3,stroke:#1565C0,color:white
    classDef controller fill:#4CAF50,stroke:#2E7D32,color:white
    classDef data fill:#FFC107,stroke:#FFA000,color:black
    classDef database fill:#FF9800,stroke:#F57C00,color:white
    classDef config fill:#9C27B0,stroke:#7B1FA2,color:white

    %% Click events
    click APP "https://github.com/MumuKim0212/MyKanban_BE/blob/main/src/app.ts"
    click BR "https://github.com/MumuKim0212/MyKanban_BE/blob/main/src/routes/board.routes.ts"
    click CR "https://github.com/MumuKim0212/MyKanban_BE/blob/main/src/routes/card.routes.ts"
    click BC "https://github.com/MumuKim0212/MyKanban_BE/blob/main/src/controllers/board.controller.ts"
    click CC "https://github.com/MumuKim0212/MyKanban_BE/blob/main/src/controllers/card.controller.ts"
    click SCHEMA "https://github.com/MumuKim0212/MyKanban_BE/blob/main/prisma/schema.prisma"
    click MIG "https://github.com/MumuKim0212/MyKanban_BE/tree/main/prisma/migrations/20250123051911_add_label_model"
    click ENV "https://github.com/MumuKim0212/MyKanban_BE/blob/main/.env"
    click TS "https://github.com/MumuKim0212/MyKanban_BE/blob/main/tsconfig.json"

    %% Legend
    subgraph Legend
        L1["API Component"]:::api
        L2["Controller"]:::controller
        L3["Data Layer"]:::data
        L4["Database"]:::database
        L5["Configuration"]:::config
    end
```
