# imrankabir02/task-manager architecture

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

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

## Overview

##### Main Components

A. Frontend Layer (React + TypeScript):
- Authentication Module (Login/Register)
- Task Management Module
- Layout Components
- API Service Layer

B. Backend Layer (Django):
- Django REST Framework API
- Authentication System
- Task Management Service
- Database Models

C. Database Layer:
- Main tables: Users, Tasks

##### Component Relationships

- Authentication requests
- Task CRUD operations
- User data storage
- Task data storage

##### Specific Elements

A. API Gateway:
- Main API endpoints:
- /api/users/ (Authentication)
- /api/auth/token/ (Token management)
- /api/tasks/ (Task operations)

B. Security Layer:
- A security component showing:
- Token-based authentication
- CORS handling
- User authorization

C. Frontend Architecture:
- Component hierarchy:
- Layout (Navbar, Footer)
- Auth Components
- Task Components
- Custom Hooks

D. Backend Architecture:
- Django app structure:
- URL routing
- Views/API endpoints
- Serializers
- Models

##### Additional Details

A. External Services:
- Deployment platforms:
- Vercel (Frontend)
- Railway (Backend)

B. State Management:
- Local state handling
- Token storage
- Task state management

##### Notes

Annotations for:
- Authentication flow
- Task status workflow
- Security implementations
- Scalability points

Remember to include the task status workflow (todo → started → complete → archived) as this is a core feature of the system.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        FE[Frontend React + TS]
        AuthModule[Authentication Module]
        TaskModule[Task Management Module]
        LayoutComp[Layout Components]
        APIService[API Service Layer]

        FE --> AuthModule
        FE --> TaskModule
        FE --> LayoutComp
        FE --> APIService

        subgraph AuthComponents
            Login[Login Component]
            Register[Register Component]
            AuthGuard[Auth Protection]
            AuthModule --> Login
            AuthModule --> Register
            AuthModule --> AuthGuard
        end

        subgraph TaskComponents
            TaskList[Task List]
            TaskForm[Task Form]
            TaskItem[Task Item]
            TaskUpdate[Task Update]
            TaskModule --> TaskList
            TaskModule --> TaskForm
            TaskModule --> TaskItem
            TaskModule --> TaskUpdate
        end

        subgraph LayoutComponents
            MainLayout[Main Layout]
            Navbar[Navigation Bar]
            Footer[Footer]
            LayoutComp --> MainLayout
            LayoutComp --> Navbar
            LayoutComp --> Footer
        end
    end

    subgraph API_Gateway
        API["/api"]
        Auth["/api/auth/token"]
        Tasks["/api/tasks"]
        Users["/api/users"]
    end

    subgraph Backend
        Django[Django Backend]
        URLRouting[URL Routing]
        Views[Views]
        Serializers[Serializers]
        Models[Database Models]
        Security[Security Layer]

        Django --> URLRouting
        Django --> Views
        Django --> Serializers
        Django --> Models
        Django --> Security
    end

    subgraph Database
        PostgreSQL[(PostgreSQL)]
        UserTable[(Users Table)]
        TaskTable[(Tasks Table)]
        PostgreSQL --> UserTable
        PostgreSQL --> TaskTable
    end

    %% Frontend to API Gateway
    APIService --> API
    API --> Auth
    API --> Tasks
    API --> Users

    %% API Gateway to Backend
    Auth --> Django
    Tasks --> Django
    Users --> Django

    %% Backend to Database
    Models -.-> PostgreSQL

    %% Styling
    classDef frontend fill:#e1f5fe,stroke:#01579b
    classDef backend fill:#e8f5e9,stroke:#1b5e20
    classDef database fill:#fff3e0,stroke:#e65100
    classDef api fill:#f3e5f5,stroke:#4a148c
    classDef security fill:#ffebee,stroke:#b71c1c

    class FE,AuthModule,TaskModule,LayoutComp,APIService,Login,Register,AuthGuard,TaskList,TaskForm,TaskItem,TaskUpdate,MainLayout,Navbar,Footer frontend
    class Django,URLRouting,Views,Serializers,Models,Security backend
    class PostgreSQL,UserTable,TaskTable database
    class API,Auth,Tasks,Users api

    %% Click events
    click Login "https://github.com/imrankabir02/task-manager/blob/main/frontend/src/components/Auth/Login.tsx"
    click Register "https://github.com/imrankabir02/task-manager/blob/main/frontend/src/components/Auth/Register.tsx"
    click AuthGuard "https://github.com/imrankabir02/task-manager/blob/main/frontend/src/components/Auth/AuthGuard.tsx"
    click TaskList "https://github.com/imrankabir02/task-manager/blob/main/frontend/src/components/Tasks/TaskList.tsx"
    click TaskForm "https://github.com/imrankabir02/task-manager/blob/main/frontend/src/components/Tasks/TaskForm.tsx"
    click TaskItem "https://github.com/imrankabir02/task-manager/blob/main/frontend/src/components/Tasks/TaskItem.tsx"
    click TaskUpdate "https://github.com/imrankabir02/task-manager/blob/main/frontend/src/components/Tasks/TaskUpdate.tsx"
    click MainLayout "https://github.com/imrankabir02/task-manager/blob/main/frontend/src/components/Layout/Layout.tsx"
    click Navbar "https://github.com/imrankabir02/task-manager/blob/main/frontend/src/components/Layout/Navbar.tsx"
    click Footer "https://github.com/imrankabir02/task-manager/blob/main/frontend/src/components/Layout/Footer.tsx"
    click APIService "https://github.com/imrankabir02/task-manager/blob/main/frontend/src/api/api.ts"
    click URLRouting "https://github.com/imrankabir02/task-manager/blob/main/base/urls.py"
    click Views "https://github.com/imrankabir02/task-manager/blob/main/base/views.py"
    click Models "https://github.com/imrankabir02/task-manager/blob/main/base/models.py"
    click Serializers "https://github.com/imrankabir02/task-manager/blob/main/base/serializers.py"
```
