# txdtt/bankan architecture

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

- Interactive diagram: https://gitdiagram.com/txdtt/bankan
- Repository: https://github.com/txdtt/bankan

## Overview

##### Main Components

Frontend Layer:
- Components Module (columnRenderer, taskRenderer)
- Models (columnModel, taskModel)
- Services (columnService, taskService)
- Utils (dragAndDrop)
- Static Assets (HTML, CSS)

Backend Layer:
- Controllers (columnController, taskController)
- Services (columnService, taskService)
- Models (columnModel, taskModel)
- Routes (columnRoutes, taskRoutes)
- Config (database configuration)

Database Layer:
- MongoDB as the database system (indicated by the database.ts config file)

##### Component Relationships

- Frontend Components → Frontend Services
- Frontend Services → Backend API Routes (HTTP requests)
- Backend Routes → Controllers
- Controllers → Services
- Services → Models
- Models → MongoDB

##### Architectural Patterns to Highlight

The project follows several clear patterns that should be represented:
- MVC Pattern in the backend (Models, Controllers, Routes as the interface)
- Service Layer pattern in both frontend and backend
- Component-based architecture in the frontend
- RESTful API structure (implied by the routes organization)

##### Specific Implementation Details

- Blue containers for Frontend components
- Green containers for Backend components
- Purple container for Database
- Yellow containers for Shared Models/Interfaces

##### Technical Stack Indicators

Badges or labels for:
- TypeScript (both frontend and backend)
- MongoDB
- Node.js
- Webpack (for bundling)

##### Additional Elements

A section showing:
- Drag and Drop functionality interaction flow
- Column and Task data structure relationship
- API endpoints structure

Styling Guidelines:

Level of Detail:

Remember to maintain visual clarity while showing the relationship between all components, particularly emphasizing how the frontend and backend services coordinate to provide the Kanban board functionality.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
    end

    subgraph Frontend["Frontend Layer"]
        direction TB
        StaticAssets["Static Assets"]
        
        subgraph FE_Components["Components"]
            TaskRenderer["Task Renderer"]:::component
            ColumnRenderer["Column Renderer"]:::component
            DragDrop["Drag & Drop"]:::utility
        end
        
        subgraph FE_Models["Models"]
            FE_TaskModel["Task Model"]:::model
            FE_ColumnModel["Column Model"]:::model
        end
        
        subgraph FE_Services["Services"]
            FE_TaskService["Task Service"]:::service
            FE_ColumnService["Column Service"]:::service
        end
    end

    subgraph Backend["Backend Layer"]
        direction TB
        subgraph API_Routes["API Routes"]
            TaskRoutes["Task Routes"]:::api
            ColumnRoutes["Column Routes"]:::api
        end
        
        subgraph Controllers["Controllers"]
            TaskController["Task Controller"]:::controller
            ColumnController["Column Controller"]:::controller
        end
        
        subgraph BE_Services["Services"]
            BE_TaskService["Task Service"]:::service
            BE_ColumnService["Column Service"]:::service
        end
        
        subgraph BE_Models["Models"]
            BE_TaskModel["Task Model"]:::model
            BE_ColumnModel["Column Model"]:::model
        end
    end

    subgraph DB["Database Layer"]
        MongoDB[(MongoDB)]:::database
        DBConfig["Database Config"]:::config
    end

    %% Connections
    Browser --> StaticAssets
    StaticAssets --> FE_Components
    
    TaskRenderer --> FE_TaskService
    ColumnRenderer --> FE_ColumnService
    DragDrop --> TaskRenderer
    DragDrop --> ColumnRenderer
    
    FE_TaskService --> FE_TaskModel
    FE_ColumnService --> FE_ColumnModel
    
    FE_TaskService --> TaskRoutes
    FE_ColumnService --> ColumnRoutes
    
    TaskRoutes --> TaskController
    ColumnRoutes --> ColumnController
    
    TaskController --> BE_TaskService
    ColumnController --> BE_ColumnService
    
    BE_TaskService --> BE_TaskModel
    BE_ColumnService --> BE_ColumnModel
    
    BE_TaskModel --> MongoDB
    BE_ColumnModel --> MongoDB
    DBConfig --> MongoDB

    %% Click Events
    click TaskRenderer "https://github.com/txdtt/bankan/blob/main/frontend/public/scripts/components/taskRenderer.ts"
    click ColumnRenderer "https://github.com/txdtt/bankan/blob/main/frontend/public/scripts/components/columnRenderer.ts"
    click DragDrop "https://github.com/txdtt/bankan/blob/main/frontend/public/scripts/utils/dragAndDrop.ts"
    click FE_TaskModel "https://github.com/txdtt/bankan/blob/main/frontend/public/scripts/models/taskModel.ts"
    click FE_ColumnModel "https://github.com/txdtt/bankan/blob/main/frontend/public/scripts/models/columnModel.ts"
    click FE_TaskService "https://github.com/txdtt/bankan/blob/main/frontend/public/scripts/services/taskService.ts"
    click FE_ColumnService "https://github.com/txdtt/bankan/blob/main/frontend/public/scripts/services/columnService.ts"
    click TaskController "https://github.com/txdtt/bankan/blob/main/backend/src/controllers/taskController.ts"
    click ColumnController "https://github.com/txdtt/bankan/blob/main/backend/src/controllers/columnController.ts"
    click BE_TaskService "https://github.com/txdtt/bankan/blob/main/backend/src/services/taskService.ts"
    click BE_ColumnService "https://github.com/txdtt/bankan/blob/main/backend/src/services/columnService.ts"
    click BE_TaskModel "https://github.com/txdtt/bankan/blob/main/backend/src/models/taskModel.ts"
    click BE_ColumnModel "https://github.com/txdtt/bankan/blob/main/backend/src/models/columnModel.ts"
    click DBConfig "https://github.com/txdtt/bankan/blob/main/backend/src/config/database.ts"
    click TaskRoutes "https://github.com/txdtt/bankan/blob/main/backend/src/routes/taskRoutes.ts"
    click ColumnRoutes "https://github.com/txdtt/bankan/blob/main/backend/src/routes/columnRoutes.ts"

    %% Styling
    classDef component fill:#3498db,stroke:#2980b9,color:white
    classDef model fill:#9b59b6,stroke:#8e44ad,color:white
    classDef service fill:#f1c40f,stroke:#f39c12,color:black
    classDef controller fill:#2ecc71,stroke:#27ae60,color:white
    classDef api fill:#e74c3c,stroke:#c0392b,color:white
    classDef database fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef utility fill:#e67e22,stroke:#d35400,color:white
    classDef config fill:#1abc9c,stroke:#16a085,color:white

    %% Legend
    subgraph Legend
        L_Component["Component"]:::component
        L_Model["Model"]:::model
        L_Service["Service"]:::service
        L_Controller["Controller"]:::controller
        L_API["API Route"]:::api
        L_Database["Database"]:::database
        L_Utility["Utility"]:::utility
        L_Config["Config"]:::config
    end
```
