# davidgg00/trelloclone architecture

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

- Interactive diagram: https://gitdiagram.com/davidgg00/trelloclone
- Repository: https://github.com/davidgg00/trelloclone

## Overview

##### Project Type and Purpose
- This is a full-stack application designed to clone Trello’s functionality. It supports boards, lists, tasks, user management, and board permissions – features typically seen in project management and task tracking applications.
- The backend is built using NestJS with clearly defined modules (boards, lists, tasks, users, board-permission, auth, etc.) while the frontend appears to use a modern framework (Vue.js, as evidenced by .vue files) along with Vite as the build tool.

##### Key Architectural Components
a. Frontend:
- Located under the “front” directory.
- Contains essential files such as App.vue, main.ts, and routing and state management configurations.
- Handles the user interface with components (e.g., BoardList.vue, List.vue, Task.vue) and manages client-side routing and API calls (using Axios configured in the “api” subdirectory).
- Dockerfile and Docker/Nginx configurations hint at containerized deployment and static file serving.

b. Backend:
- Found under the “back” directory, using NestJS.
- Pattern organized by modules representing domain features: boards, lists, tasks, users, board-permission, and auth.
- Includes controllers, services, and DTOs for various functionalities, demonstrating separation of concerns.
- An events gateway is also present for real-time features (likely using websockets), as indicated by the “events” directory.
- Testing is integrated through spec files for controllers and services.
- The existence of Dockerfile and configuration files (.env.copy, tsconfig, etc.) suggests a containerized and type-safe Node.js server.

c. Database & Persistence (Implicit):
- Although no explicit database configuration files are seen, the entity files (e.g., board.entity.ts, list.entity.ts) imply use of an ORM for database interactions.

d. External Services/Deployment & CI/CD:
- GitHub workflows (in .github) point to automatic deployments.
- docker-compose.yml is used to orchestrate containerized services (including likely front-end, back-end, and possibly database containers).

##### Diagramming the Interactions
- Frontend Application: Mark as “Frontend – Vue.js & Vite” with subcomponents like “UI Components”, “Router”, “Store”, and “API module”.
- Backend Application: Mark as “Backend – NestJS” showing modules for Boards, Lists, Tasks, Users, Auth, Board-Permissions, and Events (Websocket Gateway). Indicate inclusion of testing and middleware/authentication (e.g., JWT in users/jwt-auth).
- External Integration: Optionally add “GitHub Actions” for CI/CD, and “Docker” environment (via docker-compose) elements showing container orchestration.

- API calls from the Frontend to the Backend (HTTP requests).
- Data flow from the Backend to the Database.
- Real-time communications between the Frontend and the Events (WebSocket Gateway on the backend).

##### Architectural Patterns/Principles to Highlight
- Modularity: Each domain (boards, lists, tasks, etc.) is organized into its own module with controllers, services, DTOs, and entity definitions (Backend side).
- Separation of Concerns: Clear division between UI (Frontend) and business logic (Backend).
- Containerization: Both the frontend and backend have Docker setups, suggesting they are deployed in separate containers.
- Real-Time Communication: The events module is built using a gateway for websockets.
- Testing/Quality Assurance: Presence of extensive test files indicates a strong testing culture.

##### Additional Detail
- For the frontend, indicate key modules doing API communication and UI state management.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend Layer"
        FEApp("Frontend – Vue.js & Vite"):::frontend
        FE_UI("UI Components"):::frontend
        FE_Router("Router"):::frontend
        FE_Store("State Management"):::frontend
        FE_API("API Module"):::frontend
        FEApp --> FE_UI
        FEApp --> FE_Router
        FEApp --> FE_Store
        FEApp --> FE_API
    end

    subgraph "Backend Layer"
        BEApp("Backend – NestJS"):::backend
        BE_Boards("Board Module"):::backend
        BE_Lists("List Module"):::backend
        BE_Tasks("Task Module"):::backend
        BE_Users("User Module"):::backend
        BE_BoardPermission("Board-Permission Module"):::backend
        BE_Events("Events Gateway"):::backend
        BEApp --> BE_Boards
        BEApp --> BE_Lists
        BEApp --> BE_Tasks
        BEApp --> BE_Users
        BEApp --> BE_BoardPermission
        BEApp --> BE_Events
    end

    DB("Database"):::database

    CI("CI/CD (GitHub Actions)"):::external
    Docker("Docker Compose & Containerization"):::external

    FEApp -->|"HTTP_calls"| BEApp
    BEApp -->|"Data_Persistence"| DB
    FEApp <-->|"Websocket"| BE_Events
    CI -->|"Deploys"| Docker
    Docker -->|"Containers"| FEApp
    Docker -->|"Containers"| BEApp

    click FEApp "https://github.com/davidgg00/trelloclone/tree/main/front/"
    click FE_API "https://github.com/davidgg00/trelloclone/tree/main/front/src/api"
    click FE_UI "https://github.com/davidgg00/trelloclone/tree/main/front/src/components"
    click FE_Router "https://github.com/davidgg00/trelloclone/tree/main/front/src/router"
    click FE_Store "https://github.com/davidgg00/trelloclone/tree/main/front/src/stores"

    click BEApp "https://github.com/davidgg00/trelloclone/tree/main/back/"
    click BE_Boards "https://github.com/davidgg00/trelloclone/tree/main/back/src/boards"
    click BE_Lists "https://github.com/davidgg00/trelloclone/tree/main/back/src/list"
    click BE_Tasks "https://github.com/davidgg00/trelloclone/tree/main/back/src/tasks"
    click BE_Users "https://github.com/davidgg00/trelloclone/tree/main/back/src/users"
    click BE_BoardPermission "https://github.com/davidgg00/trelloclone/tree/main/back/src/board-permission"
    click BE_Events "https://github.com/davidgg00/trelloclone/tree/main/back/src/events"

    click CI "https://github.com/davidgg00/trelloclone/tree/main/.github/workflows"
    click Docker "https://github.com/davidgg00/trelloclone/blob/main/docker-compose.yml"
    click FEApp "https://github.com/davidgg00/trelloclone/blob/main/front/.docker"
    click BEApp "https://github.com/davidgg00/trelloclone/tree/main/back/Dockerfile"

    classDef frontend fill:#cce5ff,stroke:#1b75bb,stroke-width:2px;
    classDef backend fill:#d4edda,stroke:#28a745,stroke-width:2px;
    classDef database fill:#fff3cd,stroke:#ffc107,stroke-width:2px;
    classDef external fill:#f8d7da,stroke:#dc3545,stroke-width:2px;
```
