# vamshin24/task-management-application architecture

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

- Interactive diagram: https://gitdiagram.com/vamshin24/task-management-application
- Repository: https://github.com/vamshin24/task-management-application

## Overview

##### Project type and purpose
- This is a full-stack task management application.
- Frontend: React + TypeScript SPA for user registration, login, and CRUD operations on tasks.
- Backend: Node.js + Express + TypeScript REST API handling authentication (JWT) and task endpoints.
- Database: PostgreSQL stores users and tasks via a simple migration script.

##### File structure
- Top-level folders:
– backend/ contains migrations/, package.json, tsconfig.json, and src/ with controllers, middleware, a db connector, etc.
– frontend/ contains public/ assets, src/ React components, package.json, tsconfig.json.
- Backend src/ breakdown:
– controllers/: auth.controller.ts, task.controller.ts (business logic).
– middleware/: auth.middleware.ts (JWT validation).
– db.ts (PostgreSQL client setup using DATABASE_URL).
– interfaces.ts (type definitions for Request bodies, models).
– index.ts (Express app, route binding, environment variable loading).
- Frontend src/ breakdown:
– components/: Navigation, auth (Login/Register), tasks (TaskForm/TaskList).
– App.tsx & index.tsx bootstrap the React Router and global context if any.
– public/: index.html, manifest, robots.txt.

##### README for additional insights
- Confirms tech stack: React+TS, Node/Express+TS, PostgreSQL.
- Shows database schema via SQL migrations (users, tasks tables).
- Uses environment variables for DB URL, JWT_SECRET, PORT.
- Dev tooling: nodemon for backend, Create React App for frontend.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Layer
    subgraph "Frontend Layer"
        direction TB
        Browser["User's Browser"]:::frontend
        Index["React SPA Entry (index.tsx)"]:::frontend
        App["App & Router (App.tsx)"]:::frontend
        Nav["Navigation Component"]:::frontend
        Login["Login Component"]:::frontend
        Register["Register Component"]:::frontend
        TaskForm["TaskForm Component"]:::frontend
        TaskList["TaskList Component"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        direction TB
        API["Express API Server\n(index.ts)"]:::backend
        AuthMid["Auth Middleware\n(auth.middleware.ts)"]:::backend
        AuthCtrl["AuthController\n(auth.controller.ts)"]:::backend
        TaskCtrl["TaskController\n(task.controller.ts)"]:::backend
        DBClient["DB Client\n(db.ts)"]:::backend
        Interfaces["Type Definitions\n(interfaces.ts)"]:::backend
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        DB["PostgreSQL Database"]:::database
        Migration["SQL Migration Script\n(create_tables.sql)"]:::database
    end

    %% Connections Frontend
    Browser --> Index
    Index --> App
    App --> Nav
    App --> Login
    App --> Register
    App --> TaskForm
    App --> TaskList

    Login -->|POST /login| API
    Register -->|POST /register| API
    TaskForm -->|CRUD /tasks| API
    TaskList -->|CRUD /tasks| API

    %% Connections Backend
    API -->|routes to| AuthMid
    AuthMid -->|on auth routes| AuthCtrl
    AuthMid -->|on task routes| TaskCtrl
    AuthCtrl -->|queries| DBClient
    TaskCtrl -->|queries| DBClient
    Interfaces --> API
    Interfaces --> AuthCtrl
    Interfaces --> TaskCtrl
    DBClient --> DB

    %% Migration
    Migration --> DB

    %% Click Events Frontend
    click Index "https://github.com/vamshin24/task-management-application/blob/main/frontend/src/index.tsx"
    click App "https://github.com/vamshin24/task-management-application/blob/main/frontend/src/App.tsx"
    click Nav "https://github.com/vamshin24/task-management-application/blob/main/frontend/src/components/Navigation.tsx"
    click Login "https://github.com/vamshin24/task-management-application/blob/main/frontend/src/components/auth/Login.tsx"
    click Register "https://github.com/vamshin24/task-management-application/blob/main/frontend/src/components/auth/Register.tsx"
    click TaskForm "https://github.com/vamshin24/task-management-application/blob/main/frontend/src/components/tasks/TaskForm.tsx"
    click TaskList "https://github.com/vamshin24/task-management-application/blob/main/frontend/src/components/tasks/TaskList.tsx"

    %% Click Events Backend
    click API "https://github.com/vamshin24/task-management-application/blob/main/backend/src/index.ts"
    click AuthMid "https://github.com/vamshin24/task-management-application/blob/main/backend/src/middleware/auth.middleware.ts"
    click AuthCtrl "https://github.com/vamshin24/task-management-application/blob/main/backend/src/controllers/auth.controller.ts"
    click TaskCtrl "https://github.com/vamshin24/task-management-application/blob/main/backend/src/controllers/task.controller.ts"
    click DBClient "https://github.com/vamshin24/task-management-application/blob/main/backend/src/db.ts"
    click Interfaces "https://github.com/vamshin24/task-management-application/blob/main/backend/src/interfaces.ts"
    click Migration "https://github.com/vamshin24/task-management-application/blob/main/backend/migrations/create_tables.sql"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef backend fill:#d4edda,stroke:#333,stroke-width:1px
    classDef database fill:#fff3cd,stroke:#333,stroke-width:1px
```
