# fredericosferreira/kanban-flex architecture

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

- Interactive diagram: https://gitdiagram.com/fredericosferreira/kanban-flex
- Repository: https://github.com/fredericosferreira/kanban-flex

## Overview

##### Project type and purpose
- KanbanFlex is a full-stack, open-source web application for sprint retrospectives (“boards” + “cards” + votes).
- Frontend: Vue 3 SPA built with Vite.
- Backend: Node.js/Express REST API with MongoDB, containerized via Docker.

##### File structure
- Top-level “src”, “public”, “index.html” → Vue/Vite app.
- “backend/” → Node.js service (Dockerfile, docker-compose.yml, .env.sample).
- “backend/modules/{auth,boards}/controllers,routes” → MVC pattern.
- “backend/cloud/” → serverless function(s) (e.g., email notifications).
- docker-compose.yml spins up MongoDB for local dev.
- migrate-mongo config + migrations folder → database versioning.
- “templates/emails” + email.js → transactional email subsystem.

##### README
- Describes features (anonymous access, likes/dislikes, hide mode).
- Tech stack: Node.js, Vue, Typescript, MongoDB.
- Deployment hints: frontend on Netlify, backend via Docker.
- External services: SMTP/email provider, possibly cloud functions.

a. Main components:
- User’s Browser (SPA)
- CDN / Static Host (Netlify)
- API Gateway / Load Balancer (optional)
- Backend Service (Node.js/Express)
- MongoDB Database
- Email Service (SMTP or third-party)
- Cloud Function(s) (in backend/cloud)
b. Relationships & data flow:
1. Browser → CDN/Netlify → serves static assets (JavaScript/CSS).
2. SPA → HTTP(S) → Backend REST API.
3. Backend → MongoDB → data storage for boards, users, votes.
4. Backend → triggers Cloud Function → sends templated emails via SMTP.
5. Cloud Function → External Email Provider.
c. Architectural patterns & principles:
- MVC in backend: controllers, routes, services.
- Single Page Application front/back separation.
- Infrastructure as code: Docker Compose for local dev.
- Database migrations for schema/version management.
- Serverless for decoupled email tasks.
d. Key technologies:
- Frontend: Vue 3, Vite, TypeScript, Pinia (stores), Vue Router.
- Backend: Node.js, Express, migrate-mongo, dotenv.
- Database: MongoDB (Docker container or Atlas).
- CI/CD: Netlify for frontend, Docker build for backend.
- Email: email.js + HTML templates.

##### Detailed component breakdown
- SPA Layer:
- App.vue → core layout
- Components & Views → UI flows (BoardView, Auth)
- Stores (Pinia) → state management
- Utils/api.ts → HTTP client
- API Layer:
- index.js → server bootstrap
- modules/auth & modules/boards → feature modules
- utils.js → shared helpers
- Data Layer:
- Migrations → schema/indexes
- migrate-mongo-config → DB connection settings
- Infra:
- docker-compose.yml → local Mongo + API
- Dockerfile → backend container
- .env files → config

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["User Browser"]:::compute
    Netlify["Netlify/CDN"]:::cloud
    Browser -->|"GET assets"| Netlify
    Netlify -->|"serves index.html"| SPA["Vue 3 SPA"]:::compute

    subgraph "Frontend (Vue SPA)"
        html["index.html"]:::compute
        vite["vite.config.ts"]:::compute
        app["App.vue"]:::compute
        router["router/index.ts"]:::compute
        authStore["stores/auth.ts"]:::compute
        apiUtil["utils/api.ts"]:::compute

        subgraph Views
            home["HomeView.vue"]:::compute
            board["BoardView.vue"]:::compute
            boardV2["BoardV2View.vue"]:::compute
            stats["BoardStatistics.vue"]:::compute
            myBoard["MyBoardView.vue"]:::compute
            login["auth/Login.vue"]:::compute
            register["auth/Register.vue"]:::compute
        end

        subgraph Components
            createModal["CreateBoardModal.vue"]:::compute
            icons["components/icons"]:::compute
        end

        subgraph Utils
            templates["utils/templates.ts"]:::compute
            validate["utils/validate.js"]:::compute
            uuid["utils/uuid.ts"]:::compute
            swal["utils/swal.ts"]:::compute
        end

        assets["public/, assets/main.css"]:::compute
    end

    SPA -->|"HTTP API"| API["Express API"]:::compute

    subgraph "Backend (Docker)"
        APIEntry["index.js"]:::compute
        dockerfile["Dockerfile"]:::compute
        compose["docker-compose.yml"]:::compute
        envRoot[".env.sample"]:::compute
        envBackend[".env.sample"]:::compute
        utilsBackend["utils.js"]:::compute

        subgraph "Auth Module"
            authRoutes["modules/auth/routes/auth-routes.js"]:::compute
            authController["modules/auth/controllers/auth-controller.js"]:::compute
        end

        subgraph "Boards Module"
            boardsRoutes["modules/boards/routes/boards-routes.js"]:::compute
            boardsController["modules/boards/controllers/boards-controller.js"]:::compute
        end

        subgraph "Migrations"
            migrateConfig["migrate-mongo-config.js"]:::compute
            migrations["migrations/"]:::compute
        end

        emailSender["email.js"]:::compute
        emailTemplates["templates/emails/index.html"]:::compute
        packageBackend["package.json"]:::compute
    end

    API -->|"DB read/write"| Mongo["MongoDB"]:::db
    API -->|"trigger"| CF["Email Cloud Function"]:::compute
    CF -->|"SMTP"| EmailProv["Email Provider"]:::cloud

    classDef compute fill:#D0E6FF,stroke:#0366d6
    classDef db fill:#FFE0B2,stroke:#d2691e
    classDef cloud fill:#E0BBE4,stroke:#800080

    click html "https://github.com/fredericosferreira/kanban-flex/blob/main/index.html"
    click vite "https://github.com/fredericosferreira/kanban-flex/blob/main/vite.config.ts"
    click app "https://github.com/fredericosferreira/kanban-flex/blob/main/src/App.vue"
    click router "https://github.com/fredericosferreira/kanban-flex/blob/main/src/router/index.ts"
    click authStore "https://github.com/fredericosferreira/kanban-flex/blob/main/src/stores/auth.ts"
    click apiUtil "https://github.com/fredericosferreira/kanban-flex/blob/main/src/utils/api.ts"
    click home "https://github.com/fredericosferreira/kanban-flex/blob/main/src/views/HomeView.vue"
    click board "https://github.com/fredericosferreira/kanban-flex/blob/main/src/views/BoardView.vue"
    click boardV2 "https://github.com/fredericosferreira/kanban-flex/blob/main/src/views/BoardV2View.vue"
    click stats "https://github.com/fredericosferreira/kanban-flex/blob/main/src/views/BoardStatistics.vue"
    click myBoard "https://github.com/fredericosferreira/kanban-flex/blob/main/src/views/MyBoardView.vue"
    click login "https://github.com/fredericosferreira/kanban-flex/blob/main/src/views/auth/Login.vue"
    click register "https://github.com/fredericosferreira/kanban-flex/blob/main/src/views/auth/Register.vue"
    click createModal "https://github.com/fredericosferreira/kanban-flex/blob/main/src/components/CreateBoardModal.vue"
    click icons "https://github.com/fredericosferreira/kanban-flex/tree/main/src/components/icons/"
    click templates "https://github.com/fredericosferreira/kanban-flex/blob/main/src/utils/templates.ts"
    click validate "https://github.com/fredericosferreira/kanban-flex/blob/main/src/utils/validate.js"
    click uuid "https://github.com/fredericosferreira/kanban-flex/blob/main/src/utils/uuid.ts"
    click swal "https://github.com/fredericosferreira/kanban-flex/blob/main/src/utils/swal.ts"
    click API "https://github.com/fredericosferreira/kanban-flex/blob/main/backend/index.js"
    click dockerfile "https://github.com/fredericosferreira/kanban-flex/tree/main/backend/Dockerfile"
    click compose "https://github.com/fredericosferreira/kanban-flex/blob/main/backend/docker-compose.yml"
    click envBackend "https://github.com/fredericosferreira/kanban-flex/blob/main/backend/.env.sample"
    click authRoutes "https://github.com/fredericosferreira/kanban-flex/blob/main/backend/modules/auth/routes/auth-routes.js"
    click authController "https://github.com/fredericosferreira/kanban-flex/blob/main/backend/modules/auth/controllers/auth-controller.js"
    click boardsRoutes "https://github.com/fredericosferreira/kanban-flex/blob/main/backend/modules/boards/routes/boards-routes.js"
    click boardsController "https://github.com/fredericosferreira/kanban-flex/blob/main/backend/modules/boards/controllers/boards-controller.js"
    click utilsBackend "https://github.com/fredericosferreira/kanban-flex/blob/main/backend/utils.js"
    click migrateConfig "https://github.com/fredericosferreira/kanban-flex/blob/main/backend/migrate-mongo-config.js"
    click migrations "https://github.com/fredericosferreira/kanban-flex/tree/main/backend/migrations/"
    click CF "https://github.com/fredericosferreira/kanban-flex/blob/main/backend/cloud/main.js"
    click emailSender "https://github.com/fredericosferreira/kanban-flex/blob/main/backend/email.js"
    click emailTemplates "https://github.com/fredericosferreira/kanban-flex/blob/main/backend/templates/emails/index.html"
    click packageBackend "https://github.com/fredericosferreira/kanban-flex/blob/main/backend/package.json"
    click envRoot "https://github.com/fredericosferreira/kanban-flex/blob/main/.env.sample"
```
