# chopbong/kanbask architecture

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

- Interactive diagram: https://gitdiagram.com/chopbong/kanbask
- Repository: https://github.com/chopbong/kanbask

## Overview

##### Main Components
- Frontend Client: Located in the "client" directory. This is built with Next.js (a React framework) and styled with Tailwind CSS. It handles user interactions, visualizations (like Kanban boards and chat interfaces), and routing.
- Backend Server: Found in the "server" directory. This is an Express.js application that serves APIs, handles authentication (using JWT), and manages business logic. It also integrates real-time communication via Socket.IO.
- Database: The README indicates NeonDB (a serverless Postgres database) is used for persistent data storage. This component stores user data, project documents, task data, chat history, etc.
- External Services & Infrastructure:
- Authentication: Implemented with JWT, used within backend API processing.
- Real-time Communication: Socket.IO integration to support chat (both personal and group) and live data updates.
- Containerization: Docker is used for server deployment (evidenced by the Dockerfile) ensuring consistency across environments.
- Deployment Infrastructure: There’s mention of deployment to Contabo and usage of GitLab for CI/CD, which can be represented externally.

##### Detailing Component Relationships and Data Flow
- The Client (Frontend) communicates with the Server (Backend) via RESTful API calls. This includes tasks like managing projects, tasks, and profile operations.
- The Server handles incoming API requests, processes authentication (JWT), and performs business logic before interacting with the Database (NeonDB) for CRUD operations.
- For real-time features (e.g., chats), the Client establishes a Socket.IO connection with the Server which in turn manages real-time interactions among users.
- Docker containerization for the backend means that the server is deployed within a container (or multiple containers) to ensure isolated and reproducible environments.

##### Architectural Patterns / Design Principles
- Real-time Communication: Highlight a dedicated channel (e.g., a separate “Real-time” component) managed by Socket.IO that facilitates chat and notifications.
- Containerization & Deployment: Show how the backend is packaged using Docker, which is then deployed on a container hosting service such as Contabo, with CI/CD flows possibly pulling from GitLab.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Frontend Layer"
        F1("Next.js Frontend (React & Tailwind)"):::frontend
    end

    subgraph "Backend Layer"
        D1("Docker Container"):::container
        B1("Express.js Backend"):::backend
        A1("JWT Authentication"):::backend
        S1("Socket.IO Real-time"):::backend
        B1 -->|"integrates"| A1
        B1 -->|"integrates"| S1
    end

    DB("NeonDB Database"):::database
    DI("Deployment Infrastructure"):::external

    F1 -->|"REST_API"| B1
    S1 <-->|"real-time"| F1
    B1 -->|"CRUD"| DB
    DI -->|"CI/CD"| D1
    D1 -->|"runs"| B1

    click F1 "https://github.com/chopbong/kanbask/tree/main/client/"
    click B1 "https://github.com/chopbong/kanbask/blob/main/server/src/server.js"
    click D1 "https://github.com/chopbong/kanbask/tree/main/server/Dockerfile"

    classDef frontend fill:#a8d0e6,stroke:#333,stroke-width:2px;
    classDef backend fill:#f76c6c,stroke:#333,stroke-width:2px;
    classDef database fill:#f9f871,stroke:#333,stroke-width:2px;
    classDef container fill:#b5e3a4,stroke:#333,stroke-width:2px;
    classDef external fill:#d3d3d3,stroke:#333,stroke-width:2px;
```
