# arham689/task-manager-stuffpie architecture

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

- Interactive diagram: https://gitdiagram.com/arham689/task-manager-stuffpie
- Repository: https://github.com/arham689/task-manager-stuffpie

## Overview

##### Main Components

A. Frontend Layer (Client Application)
- React + TypeScript application
- Components structure (Kanban board, Task cards, Modals)
- State management
- API integration layer

B. Backend Layer (Server Application)
- Express.js server with TypeScript
- Authentication middleware
- Controllers layer
- Routes layer
- Models layer
- Validation layer

C. Database Layer
- MongoDB instance
- Data models (Users, Tasks)

D. Shared Packages
- UI components library
- TypeScript configurations
- ESLint configurations

**┌─────────────────────────────────────────────────────────────┐**
- Client Layer (React + TypeScript)                           │
- ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐    │
- Components  │ │   Pages     │ │ API Integration     │    │
- Kanban    │ │ - Dashboard │ │ - Auth Services     │    │
- TaskCard  │ │ - Home      │ │ - Task Services     │    │
- Modals    │ │ - Signup    │ └─────────────────────┘    │
- ┘ └─────────────┘                            │
- ┘
- ↕ HTTP/REST
**┌─────────────────────────────────────────────────────────────┐**
- Server Layer (Express + TypeScript)                         │
- ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐    │
- Routes     │ │ Controllers │ │     Middleware      │    │
- Auth      │ │ - Auth      │ │ - Authentication   │    │
- Tasks     │ │ - Tasks     │ │ - Validation       │    │
- ┘ └─────────────┘ └─────────────────────┘    │
- ┘
- ↕ Mongoose
**┌─────────────────────────────────────────────────────────────┐**
- Database Layer (MongoDB)                                    │
- ┌─────────────┐ ┌─────────────┐                            │
- Users       │ │   Tasks     │                            │
- ┘ └─────────────┘                            │
- ┘

##### Additional Details

A. Infrastructure Components:
- Docker containers (as shown in docker-compose.yml)
- Environment configurations
- Build and deployment flow

B. Shared Package Structure:
- UI component library
- Configuration packages
- Type definitions

C. Authentication Flow:
- JWT token flow
- Protected routes
- Auth middleware

##### Key Relationships to Highlight

- Frontend-Backend communication via REST APIs
- Authentication flow and JWT token handling
- Task CRUD operations flow
- Real-time updates mechanism
- Shared package dependencies
- Docker container relationships

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client["Client Layer"]
        FE_COMP["Components"]
        KB["Kanban Board"]:::component
        TC["Task Cards"]:::component
        TM["Task Modals"]:::component
        FE_COMP --> KB
        FE_COMP --> TC
        FE_COMP --> TM

        FE_PAGES["Pages"]
        DASH["Dashboard"]:::component
        HOME["Home"]:::component
        SIGNUP["Signup"]:::component
        FE_PAGES --> DASH
        FE_PAGES --> HOME
        FE_PAGES --> SIGNUP

        API_INT["API Integration"]
        AUTH_SERV["Auth Services"]
        TASK_SERV["Task Services"]
        API_INT --> AUTH_SERV
        API_INT --> TASK_SERV
    end

    subgraph Server["Server Layer"]
        ROUTES["Routes"]
        AUTH_ROUTE["Auth Routes"]:::component
        TASK_ROUTE["Task Routes"]:::component
        ROUTES --> AUTH_ROUTE
        ROUTES --> TASK_ROUTE

        CONTROLLERS["Controllers"]
        AUTH_CTRL["Auth Controller"]:::component
        TASK_CTRL["Task Controller"]:::component
        CONTROLLERS --> AUTH_CTRL
        CONTROLLERS --> TASK_CTRL

        MIDDLEWARE["Middleware"]
        AUTH_MID["Authentication"]:::component
        VAL["Validation"]:::component
        AUTH_VAL["Auth Validation"]:::component
        MIDDLEWARE --> AUTH_MID
        MIDDLEWARE --> VAL
        VAL --> AUTH_VAL
    end

    subgraph Database["Database Layer"]
        DB_CONFIG["MongoDB Config"]:::component
        MODELS["Models"]
        USER_MODEL["User Model"]:::component
        TASK_MODEL["Task Model"]:::component
        DB_CONFIG --> MODELS
        MODELS --> USER_MODEL
        MODELS --> TASK_MODEL
    end

    subgraph Shared["Shared Packages"]
        UI_LIB["UI Components"]:::component
        TS_CONFIG["TypeScript Config"]:::component
        ESLINT_CONFIG["ESLint Config"]:::component
    end

    Client -- HTTP/REST --> Server
    Server -- Mongoose --> Database
    Shared --> Client
    Shared --> Server

    %% Click events for components
    click KB "https://github.com/Arham689/task-manager-stuffpie/blob/main/apps/client/src/componets/kanban.tsx"
    click TC "https://github.com/Arham689/task-manager-stuffpie/blob/main/apps/client/src/componets/TaskCard.tsx"
    click TM "https://github.com/Arham689/task-manager-stuffpie/blob/main/apps/client/src/componets/TaskModal.tsx"
    click DASH "https://github.com/Arham689/task-manager-stuffpie/blob/main/apps/client/src/pages/DashBoard.tsx"
    click HOME "https://github.com/Arham689/task-manager-stuffpie/blob/main/apps/client/src/pages/Home.tsx"
    click SIGNUP "https://github.com/Arham689/task-manager-stuffpie/blob/main/apps/client/src/pages/Singup.tsx"
    click AUTH_CTRL "https://github.com/Arham689/task-manager-stuffpie/blob/main/apps/server/src/controllers/auth.controllers.ts"
    click TASK_CTRL "https://github.com/Arham689/task-manager-stuffpie/blob/main/apps/server/src/controllers/manageTask.contorller.ts"
    click AUTH_ROUTE "https://github.com/Arham689/task-manager-stuffpie/blob/main/apps/server/src/routes/auth.routes.ts"
    click TASK_ROUTE "https://github.com/Arham689/task-manager-stuffpie/blob/main/apps/server/src/routes/manageTasks.route.ts"
    click AUTH_MID "https://github.com/Arham689/task-manager-stuffpie/blob/main/apps/server/src/middleware/auth.middleware.ts"
    click USER_MODEL "https://github.com/Arham689/task-manager-stuffpie/blob/main/apps/server/src/models/user.model.ts"
    click TASK_MODEL "https://github.com/Arham689/task-manager-stuffpie/blob/main/apps/server/src/models/task.model.ts"
    click AUTH_VAL "https://github.com/Arham689/task-manager-stuffpie/blob/main/apps/server/src/validation/auth.validation.ts"
    click DB_CONFIG "https://github.com/Arham689/task-manager-stuffpie/blob/main/apps/server/src/config/db.ts"
    click UI_LIB "https://github.com/Arham689/task-manager-stuffpie/tree/main/packages/ui/src"
    click TS_CONFIG "https://github.com/Arham689/task-manager-stuffpie/tree/main/packages/typescript-config"
    click ESLINT_CONFIG "https://github.com/Arham689/task-manager-stuffpie/tree/main/packages/eslint-config"

    classDef component fill:#f9f,stroke:#333,stroke-width:2px
    classDef default fill:#fff,stroke:#333,stroke-width:2px
    classDef client fill:#ddf,stroke:#333,stroke-width:2px
    classDef server fill:#dfd,stroke:#333,stroke-width:2px
    classDef database fill:#ffd,stroke:#333,stroke-width:2px
    classDef shared fill:#f8f,stroke:#333,stroke-width:2px

    class Client client
    class Server server
    class Database database
    class Shared shared
```
