# shathuryaparamanathan/taskflow-platform architecture

> Architecture diagram of the GitHub repository shathuryaparamanathan/taskflow-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shathuryaparamanathan/taskflow-platform
- Repository: https://github.com/shathuryaparamanathan/taskflow-platform

## Overview

TaskFlow is a PostgreSQL-backed task-management API, accompanied by AWS infrastructure and host-configuration code. The main user workflow is HTTP requests through the Express server and task routes to PostgreSQL, with results returned as JSON. The repository also includes Terraform infrastructure modules, Ansible configuration, and ECS vertical-scaling automation. The README documents deployment and scaling capabilities, but most infrastructure and Ansible implementation files were not sampled; those relationships are shown only where documented, and uncertain wiring is omitted.

Main entry points: [`terraform/main.tf`](https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/terraform/main.tf) (Infrastructure config), [`app/src/server.js`](https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/app/src/server.js) (HTTP server), [`app/ci-db-setup.cjs`](https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/app/ci-db-setup.cjs) (Migration setup), [`app/src/routes/task.routes.js`](https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/app/src/routes/task.routes.js) (Task routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Task API"]
  node_server["HTTP server<br/>[server.js]"]
  node_task_routes["Task routes<br/>[task.routes.js]"]
  node_openapi["API specification<br/>[openapi.yaml]"]
end

subgraph group_data["Persistence"]
  node_db_pool["Database pool<br/>[db.js]"]
  node_postgres[("PostgreSQL")]
  node_migration_setup["Migration setup<br/>[ci-db-setup.cjs]"]
  node_task_schema["Task schema"]
end

subgraph group_cloud["AWS Infrastructure"]
  node_terraform_root["Infrastructure config<br/>[main.tf]"]
  node_network["Network resources"]
  node_security["Security resources"]
  node_cloud_database["Cloud database"]
  node_compute["Compute resources"]
  node_scaling_config["Scaling configuration"]
  node_scaler["Vertical scaler<br/>[vertical_scaler.py]"]
end

subgraph group_ops["Operations"]
  node_ansible_playbook["Host configuration<br/>[configure-ec2.yml]"]
  node_ansible_roles["Configuration roles"]
end

node_client(("API client"))
node_operator(("Platform operator"))
node_aws_ecs["AWS ECS"]

node_client -->|"sends requests"| node_server
node_server -->|"routes tasks"| node_task_routes
node_server -->|"loads specification"| node_openapi
node_task_routes -->|"queries"| node_db_pool
node_db_pool -->|"reads and writes"| node_postgres
node_operator -->|"runs setup"| node_migration_setup
node_migration_setup -->|"loads migration"| node_task_schema
node_migration_setup -->|"applies schema"| node_postgres
node_operator -->|"configures deployment"| node_terraform_root
node_terraform_root -.->|"configures resources"| node_network
node_terraform_root -.->|"configures resources"| node_security
node_terraform_root -.->|"configures resources"| node_cloud_database
node_terraform_root -.->|"configures resources"| node_compute
node_compute -.->|"includes scaling"| node_scaling_config
node_scaling_config -.->|"configures automation"| node_scaler
node_scaler -->|"updates service"| node_aws_ecs
node_operator -->|"runs configuration"| node_ansible_playbook
node_ansible_playbook -.->|"uses roles"| node_ansible_roles

click node_server "https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/app/src/server.js"
click node_task_routes "https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/app/src/routes/task.routes.js"
click node_openapi "https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/app/openapi.yaml"
click node_db_pool "https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/app/src/db.js"
click node_migration_setup "https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/app/ci-db-setup.cjs"
click node_task_schema "https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/app/migrations/001_create_tasks.sql"
click node_terraform_root "https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/terraform/main.tf"
click node_network "https://github.com/shathuryaparamanathan/taskflow-platform/tree/main/terraform/modules/network"
click node_security "https://github.com/shathuryaparamanathan/taskflow-platform/tree/main/terraform/modules/security"
click node_cloud_database "https://github.com/shathuryaparamanathan/taskflow-platform/tree/main/terraform/modules/database"
click node_compute "https://github.com/shathuryaparamanathan/taskflow-platform/tree/main/terraform/modules/compute"
click node_scaling_config "https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/terraform/modules/compute/vertical_scaling.tf"
click node_scaler "https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/terraform/modules/compute/vertical_scaler.py"
click node_ansible_playbook "https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/ansible/playbooks/configure-ec2.yml"
click node_ansible_roles "https://github.com/shathuryaparamanathan/taskflow-platform/tree/main/ansible/roles"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server,node_task_routes,node_openapi,node_client toneBlue
class node_db_pool,node_postgres,node_migration_setup,node_task_schema toneAmber
class node_terraform_root,node_network,node_security,node_cloud_database,node_compute,node_scaling_config,node_scaler toneMint
class node_ansible_playbook,node_ansible_roles toneRose
class node_operator,node_aws_ecs toneIndigo
```

## Components

### Task API

- [HTTP server](https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/app/src/server.js): `app/src/server.js`
- [Task routes](https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/app/src/routes/task.routes.js): `app/src/routes/task.routes.js`
- [API specification](https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/app/openapi.yaml): `app/openapi.yaml`

### Persistence

- [Database pool](https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/app/src/db.js): `app/src/db.js`
- **PostgreSQL**
- [Migration setup](https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/app/ci-db-setup.cjs): `app/ci-db-setup.cjs`
- [Task schema](https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/app/migrations/001_create_tasks.sql): `app/migrations/001_create_tasks.sql`

### AWS Infrastructure

- [Infrastructure config](https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/terraform/main.tf): `terraform/main.tf`
- [Network resources](https://github.com/shathuryaparamanathan/taskflow-platform/tree/main/terraform/modules/network): `terraform/modules/network`
- [Security resources](https://github.com/shathuryaparamanathan/taskflow-platform/tree/main/terraform/modules/security): `terraform/modules/security`
- [Cloud database](https://github.com/shathuryaparamanathan/taskflow-platform/tree/main/terraform/modules/database): `terraform/modules/database`
- [Compute resources](https://github.com/shathuryaparamanathan/taskflow-platform/tree/main/terraform/modules/compute): `terraform/modules/compute`
- [Scaling configuration](https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/terraform/modules/compute/vertical_scaling.tf): `terraform/modules/compute/vertical_scaling.tf`
- [Vertical scaler](https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/terraform/modules/compute/vertical_scaler.py): `terraform/modules/compute/vertical_scaler.py`

### Operations

- [Host configuration](https://github.com/shathuryaparamanathan/taskflow-platform/blob/main/ansible/playbooks/configure-ec2.yml): `ansible/playbooks/configure-ec2.yml`
- [Configuration roles](https://github.com/shathuryaparamanathan/taskflow-platform/tree/main/ansible/roles): `ansible/roles`

### Other components

- **API client**
- **Platform operator**
- **AWS ECS**

## Connections

- API client → HTTP server: sends requests (evidence: `README.md`)
- HTTP server → Task routes: routes tasks (evidence: `app/src/server.js`)
- HTTP server → API specification: loads specification (evidence: `app/src/server.js`)
- Task routes → Database pool: queries (evidence: `app/src/routes/task.routes.js`)
- Database pool → PostgreSQL: reads and writes (evidence: `README.md`)
- Platform operator → Migration setup: runs setup (evidence: `README.md`)
- Migration setup → Task schema: loads migration (evidence: `app/ci-db-setup.cjs`)
- Migration setup → PostgreSQL: applies schema (evidence: `app/ci-db-setup.cjs`)
- Platform operator → Infrastructure config: configures deployment (evidence: `README.md`)
- Infrastructure config → Network resources: configures resources
- Infrastructure config → Security resources: configures resources
- Infrastructure config → Cloud database: configures resources
- Infrastructure config → Compute resources: configures resources
- Compute resources → Scaling configuration: includes scaling
- Scaling configuration → Vertical scaler: configures automation (evidence: `README.md`)
- Vertical scaler → AWS ECS: updates service (evidence: `terraform/modules/compute/vertical_scaler.py`)
- Platform operator → Host configuration: runs configuration (evidence: `README.md`)
- Host configuration → Configuration roles: uses roles
