# adityacodes-root/taskprism architecture

> Architecture diagram of the GitHub repository adityacodes-root/taskprism, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adityacodes-root/taskprism
- Repository: https://github.com/adityacodes-root/taskprism

## Overview

1. **Project shape**
   - This repository is a very small, single-app Streamlit project centered on one runtime entrypoint: `app.py`.
   - There is no separate backend, database, or service layer in the repo; the application is mostly an interactive, in-memory analytics tool.

2. **Primary user interface**
   - The UI is built in Streamlit and runs as a web app.
   - User interaction happens through sidebar controls for task count, graph density, resource count, and per-task fields like duration, deadline, description, and priority.

3. **Core domain model**
   - The app models the problem as **tasks** connected by **dependencies**.
   - Tasks also carry scheduling metadata: duration, deadline, priority, and description.
   - Resources are abstract execution lanes assigned to tasks through graph coloring.

4. **Main algorithmic subsystem**
   - The central computation is a **graph coloring–based allocation engine**.
   - It uses a dependency graph to assign resources while avoiding conflicts, and it incorporates task priority and timing constraints into the schedule interpretation.
   - This is the architectural heart of the app: “generate graph → color graph → derive allocation/schedule.”

5. **Data flow through the app**
   - The user configures task/resource parameters in the UI.
   - The app generates a dependency graph with configurable density.
   - That graph is processed into a resource allocation plan.
   - The resulting allocation is then rendered as visualizations and tables, and can be exported for downstream use.

6. **Graph and matrix representation**
   - The task network is represented with `networkx`, which is the graph computation layer.
   - An adjacency matrix view is also produced for inspection, giving a second structural representation of the same task graph.
   - These views are derived from the same underlying task/dependency model, not separate sources of truth.

7. **Visualization subsystem**
   - Visual output is split across two plotting stacks:
     - `matplotlib` for graph-style/static visualizations
     - `plotly` for the interactive Gantt chart and timeline-oriented views
   - Visuals are color-coded by assigned resource, so the allocation result is directly readable from the charts.

8. **Scheduling and analysis outputs**
   - The app generates an execution timeline that reflects task duration and dependency ordering.
   - It also performs basic analysis such as overdue-task detection and resource allocation overview.
   - These are presentation-layer outputs derived from the same computed schedule, not independent workflows.

9. **Export boundary**
   - The app can export task execution data as CSV.
   - This is the main persistence/interop boundary in the system: the computed schedule is emitted for external analysis rather than stored in-app.

10. **Technology stack and runtime**
   - The repo is Python-based and depends on `streamlit`, `numpy`, `pandas`, `networkx`, `matplotlib`, and `plotly`.
   - `pandas` likely serves as the tabular data layer for task and schedule data, while `numpy` supports numerical generation/processing.
   - The live deployment referenced in the README is Streamlit-hosted, but the repo itself remains self-contained.

11. **Development environment**
   - The `.devcontainer` folder indicates support for containerized development, which helps standardize the Python environment for contributors.
   - This affects developer setup, not the runtime architecture of the app.

12. **Architectural summary**
   - The repo is best drawn as a single-page interactive application with one compute pipeline:
     - **Streamlit UI inputs** feed an **in-memory task graph generator**
     - which feeds a **graph-coloring allocation/scheduling step**
     - which feeds **visualizations, analysis, and CSV export**
   - There are no major distributed-system boundaries; the app is a self-contained analytical frontend with local algorithmic processing.

Main entry points: [`app.py`](https://github.com/adityacodes-root/taskprism/blob/main/app.py) (Execution Plan), [`.devcontainer/devcontainer.json`](https://github.com/adityacodes-root/taskprism/blob/main/.devcontainer/devcontainer.json) (Dev Container)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_ui["Streamlit UI<br/>web app shell<br/>[app.py]"]
  node_inputs["Task Inputs<br/>form state<br/>[app.py]"]
  node_params["Scenario Params<br/>config state<br/>[app.py]"]
  node_gen(("Graph Generator<br/>task graph builder<br/>[app.py]"))
  node_networkx(("NetworkX Graph<br/>graph model<br/>[app.py]"))
  node_matrix["Adjacency Matrix<br/>structural view<br/>[app.py]"]
  node_coloring{{"Coloring Engine<br/>allocation engine<br/>[app.py]"}}
  node_priority["Priority Logic<br/>scheduling rule<br/>[app.py]"]
  node_timing["Timing Logic<br/>scheduling rule<br/>[app.py]"]
  node_schedule["Execution Plan<br/>schedule model<br/>[app.py]"]
  node_timeline["Gantt Timeline<br/>plotly view<br/>[app.py]"]
  node_graphviz["Graph View<br/>matplotlib view<br/>[app.py]"]
  node_analysis["Analysis View<br/>summary output<br/>[app.py]"]
  node_table["Task Table<br/>tabular output<br/>[app.py]"]
  node_export["CSV Export<br/>interop boundary<br/>[app.py]"]
end

subgraph group_dev["Dev Setup"]
  node_devcontainer["Dev Container<br/>dev environment<br/>[devcontainer.json]"]
end

node_ui -->|"configures"| node_params
node_ui -->|"enters"| node_inputs
node_params -->|"drives"| node_gen
node_inputs -->|"populate"| node_gen
node_gen -->|"builds"| node_networkx
node_networkx -->|"derives"| node_matrix
node_networkx -->|"feeds"| node_coloring
node_coloring -->|"applies"| node_priority
node_coloring -->|"applies"| node_timing
node_priority -->|"influences"| node_schedule
node_timing -->|"constrains"| node_schedule
node_coloring -->|"produces"| node_schedule
node_schedule -->|"renders"| node_timeline
node_schedule -->|"renders"| node_graphviz
node_schedule -->|"summarizes"| node_analysis
node_schedule -->|"tabulates"| node_table
node_schedule -->|"exports"| node_export
node_devcontainer -.->|"supports"| node_ui

click node_ui "https://github.com/adityacodes-root/taskprism/blob/main/app.py"
click node_inputs "https://github.com/adityacodes-root/taskprism/blob/main/app.py"
click node_params "https://github.com/adityacodes-root/taskprism/blob/main/app.py"
click node_gen "https://github.com/adityacodes-root/taskprism/blob/main/app.py"
click node_networkx "https://github.com/adityacodes-root/taskprism/blob/main/app.py"
click node_matrix "https://github.com/adityacodes-root/taskprism/blob/main/app.py"
click node_coloring "https://github.com/adityacodes-root/taskprism/blob/main/app.py"
click node_priority "https://github.com/adityacodes-root/taskprism/blob/main/app.py"
click node_timing "https://github.com/adityacodes-root/taskprism/blob/main/app.py"
click node_schedule "https://github.com/adityacodes-root/taskprism/blob/main/app.py"
click node_timeline "https://github.com/adityacodes-root/taskprism/blob/main/app.py"
click node_graphviz "https://github.com/adityacodes-root/taskprism/blob/main/app.py"
click node_analysis "https://github.com/adityacodes-root/taskprism/blob/main/app.py"
click node_table "https://github.com/adityacodes-root/taskprism/blob/main/app.py"
click node_export "https://github.com/adityacodes-root/taskprism/blob/main/app.py"
click node_devcontainer "https://github.com/adityacodes-root/taskprism/blob/main/.devcontainer/devcontainer.json"

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_ui,node_inputs,node_params,node_gen,node_networkx,node_matrix,node_coloring,node_priority,node_timing,node_schedule,node_timeline,node_graphviz,node_analysis,node_table,node_export toneBlue
class node_devcontainer toneAmber
```

## Components

### Runtime

Single Streamlit application and its in-memory compute pipeline.

- [Streamlit UI](https://github.com/adityacodes-root/taskprism/blob/main/app.py): web app shell · Interactive sidebar and page controls for task and resource parameters. · `app.py`
- [Task Inputs](https://github.com/adityacodes-root/taskprism/blob/main/app.py): form state · Duration, deadline, description, and priority fields captured per task. · `app.py`
- [Scenario Params](https://github.com/adityacodes-root/taskprism/blob/main/app.py): config state · Task count, graph density, and resource count settings. · `app.py`
- [Graph Generator](https://github.com/adityacodes-root/taskprism/blob/main/app.py): task graph builder · Creates the in-memory dependency graph from user-selected parameters. · `app.py`
- [NetworkX Graph](https://github.com/adityacodes-root/taskprism/blob/main/app.py): graph model · Graph computation layer used to represent tasks and dependencies. · `app.py`
- [Adjacency Matrix](https://github.com/adityacodes-root/taskprism/blob/main/app.py): structural view · Tabular matrix view derived from the same task/dependency graph. · `app.py`
- [Coloring Engine](https://github.com/adityacodes-root/taskprism/blob/main/app.py): allocation engine · Assigns resources by graph coloring while avoiding dependency conflicts. · `app.py`
- [Priority Logic](https://github.com/adityacodes-root/taskprism/blob/main/app.py): scheduling rule · Factors task priority into allocation interpretation. · `app.py`
- [Timing Logic](https://github.com/adityacodes-root/taskprism/blob/main/app.py): scheduling rule · Interprets duration and deadline constraints for schedule ordering. · `app.py`
- [Execution Plan](https://github.com/adityacodes-root/taskprism/blob/main/app.py): schedule model · Derived task sequence and resource assignment for execution. · `app.py`
- [Gantt Timeline](https://github.com/adityacodes-root/taskprism/blob/main/app.py): plotly view · Interactive timeline view of task execution across resources. · `app.py`
- [Graph View](https://github.com/adityacodes-root/taskprism/blob/main/app.py): matplotlib view · Static graph-style visualization of tasks, dependencies, and colors. · `app.py`
- [Analysis View](https://github.com/adityacodes-root/taskprism/blob/main/app.py): summary output · Overdue-task detection and resource allocation overview. · `app.py`
- [Task Table](https://github.com/adityacodes-root/taskprism/blob/main/app.py): tabular output · Pandas-backed view of task and schedule records. · `app.py`
- [CSV Export](https://github.com/adityacodes-root/taskprism/blob/main/app.py): interop boundary · Exports computed execution data for external analysis. · `app.py`

### Dev Setup

Containerized contributor environment.

- [Dev Container](https://github.com/adityacodes-root/taskprism/blob/main/.devcontainer/devcontainer.json): dev environment · Containerized Python development setup for contributors. · `.devcontainer/devcontainer.json`

## Connections

- Streamlit UI → Scenario Params: configures · Users set scenario-wide task and resource counts.
- Streamlit UI → Task Inputs: enters · Users provide per-task metadata in the sidebar.
- Scenario Params → Graph Generator: drives · Scenario settings shape the generated dependency graph.
- Task Inputs → Graph Generator: populate · Per-task fields become nodes and attributes in the generated graph.
- Graph Generator → NetworkX Graph: builds · The dependency structure is materialized as a NetworkX graph.
- NetworkX Graph → Adjacency Matrix: derives · The same graph is rendered as an adjacency matrix.
- NetworkX Graph → Coloring Engine: feeds · Graph structure is the input to resource allocation.
- Coloring Engine → Priority Logic: applies · Priority affects how conflicts and assignments are interpreted.
- Coloring Engine → Timing Logic: applies · Duration and deadline rules shape the schedule result.
- Priority Logic → Execution Plan: influences · Priority-adjusted allocation contributes to the final plan.
- Timing Logic → Execution Plan: constrains · Timing metadata constrains ordering and execution windows.
- Coloring Engine → Execution Plan: produces · Allocation decisions are turned into an execution plan.
- Execution Plan → Gantt Timeline: renders · The plan is shown as a Gantt-style timeline.
- Execution Plan → Graph View: renders · The plan is also shown in a graph visualization.
- Execution Plan → Analysis View: summarizes · The schedule is checked for overdue tasks and resource usage.
- Execution Plan → Task Table: tabulates · Schedule records are formatted for inspection.
- Execution Plan → CSV Export: exports · Execution data can be emitted as CSV.
- Dev Container → Streamlit UI: supports · Development environment supports working on the Streamlit app.
