# dhanush-10-1/jenkins-first-job architecture

> Architecture diagram of the GitHub repository dhanush-10-1/jenkins-first-job, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dhanush-10-1/jenkins-first-job
- Repository: https://github.com/dhanush-10-1/jenkins-first-job

## Overview

CI/CD Pipeline Manager lets users define pipelines, connect GitHub/GitLab push events to executions, schedule jobs to language-capable workers, and inspect live execution state. The principal flow is webhook or manual execution → queued jobs → priority scheduling → worker execution, with results persisted for dashboard and log queries. The frontend also provides a visual designer with bidirectional YAML/graph editing and repository setup. The README documents SSE, simulations, and worker routing; several backend implementation details were not sampled, so uncertain call links are omitted.

Main entry points: [`backend/main.py`](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/main.py) (FastAPI application), [`frontend/src/App.tsx`](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/frontend/src/App.tsx) (App and tabs), [`backend/database.py`](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/database.py) (SQL database), [`backend/engine/scheduler.py`](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/engine/scheduler.py) (Priority scheduler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_app["App and tabs<br/>[App.tsx]"]
  node_canvas["Pipeline canvas<br/>[PipelineCanvas.tsx]"]
  node_yaml["YAML editor<br/>[YamlEditor.tsx]"]
  node_sync["YAML graph sync<br/>[sync.ts]"]
  node_dashboard["Live dashboard<br/>[Dashboard.tsx]"]
  node_repo["Repository manager<br/>[RepoManager.tsx]"]
end

subgraph group_api["API and triggers"]
  node_main["FastAPI application<br/>[main.py]"]
  node_pipelines["Pipeline CRUD<br/>[pipelines.py]"]
  node_webhooks["Webhook handlers<br/>[webhooks.py]"]
  node_executions["Execution API<br/>[executions.py]"]
end

subgraph group_execution["Execution engine"]
  node_scheduler["Priority scheduler<br/>[scheduler.py]"]
  node_workers["Worker pool<br/>[workers.py]"]
  node_executor["Stage executor<br/>[executor.py]"]
  node_simulators["Workload simulators<br/>[simulators.py]"]
end

subgraph group_state["Persistent state"]
  node_models["Pipeline execution jobs"]
  node_database[("SQL database<br/>[database.py]")]
end

subgraph group_integrations["External systems"]
  node_github(("GitHub"))
  node_gitlab(("GitLab"))
end

node_user(("Pipeline operator"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_canvas
node_app -->|"renders"| node_yaml
node_app -->|"converts"| node_sync
node_canvas -->|"sends edits"| node_app
node_yaml -->|"sends edits"| node_app
node_app -->|"shows"| node_dashboard
node_app -->|"shows"| node_repo
node_repo -->|"requests API"| node_main
node_dashboard -->|"requests state"| node_main
node_github -->|"pushes event"| node_webhooks
node_gitlab -->|"pushes event"| node_webhooks
node_main -->|"registers router"| node_pipelines
node_main -->|"registers router"| node_executions
node_main -->|"registers router"| node_webhooks
node_pipelines -->|"reads and writes"| node_database
node_webhooks -->|"creates records"| node_database
node_executions -->|"reads and writes"| node_database
node_main -->|"starts polling"| node_scheduler
node_scheduler -->|"selects worker"| node_workers
node_workers -->|"runs stages"| node_executor
node_main -->|"starts simulations"| node_simulators
node_main -->|"initializes"| node_database
node_main -->|"queries SSE state"| node_database
node_scheduler -->|"polls queued jobs"| node_database
node_executions -->|"queues execution"| node_scheduler

click node_app "https://github.com/dhanush-10-1/jenkins-first-job/blob/main/frontend/src/App.tsx"
click node_canvas "https://github.com/dhanush-10-1/jenkins-first-job/blob/main/frontend/src/components/PipelineCanvas.tsx"
click node_yaml "https://github.com/dhanush-10-1/jenkins-first-job/blob/main/frontend/src/components/YamlEditor.tsx"
click node_sync "https://github.com/dhanush-10-1/jenkins-first-job/blob/main/frontend/src/lib/sync.ts"
click node_dashboard "https://github.com/dhanush-10-1/jenkins-first-job/blob/main/frontend/src/components/Dashboard.tsx"
click node_repo "https://github.com/dhanush-10-1/jenkins-first-job/blob/main/frontend/src/components/RepoManager.tsx"
click node_main "https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/main.py"
click node_pipelines "https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/routers/pipelines.py"
click node_webhooks "https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/routers/webhooks.py"
click node_executions "https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/routers/executions.py"
click node_scheduler "https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/engine/scheduler.py"
click node_workers "https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/engine/workers.py"
click node_executor "https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/engine/executor.py"
click node_simulators "https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/engine/simulators.py"
click node_models "https://github.com/dhanush-10-1/jenkins-first-job/tree/main/backend/models"
click node_database "https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/database.py"

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_app,node_canvas,node_yaml,node_sync,node_dashboard,node_repo toneBlue
class node_main,node_pipelines,node_webhooks,node_executions toneAmber
class node_scheduler,node_workers,node_executor,node_simulators toneMint
class node_models,node_database toneRose
class node_github,node_gitlab,node_user toneIndigo
```

## Components

### Frontend

- [App and tabs](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Pipeline canvas](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/frontend/src/components/PipelineCanvas.tsx): `frontend/src/components/PipelineCanvas.tsx`
- [YAML editor](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/frontend/src/components/YamlEditor.tsx): `frontend/src/components/YamlEditor.tsx`
- [YAML graph sync](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/frontend/src/lib/sync.ts): `frontend/src/lib/sync.ts`
- [Live dashboard](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/frontend/src/components/Dashboard.tsx): `frontend/src/components/Dashboard.tsx`
- [Repository manager](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/frontend/src/components/RepoManager.tsx): `frontend/src/components/RepoManager.tsx`

### API and triggers

- [FastAPI application](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/main.py): `backend/main.py`
- [Pipeline CRUD](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/routers/pipelines.py): `backend/routers/pipelines.py`
- [Webhook handlers](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/routers/webhooks.py): `backend/routers/webhooks.py`
- [Execution API](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/routers/executions.py): `backend/routers/executions.py`

### Execution engine

- [Priority scheduler](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/engine/scheduler.py): `backend/engine/scheduler.py`
- [Worker pool](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/engine/workers.py): `backend/engine/workers.py`
- [Stage executor](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/engine/executor.py): `backend/engine/executor.py`
- [Workload simulators](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/engine/simulators.py): `backend/engine/simulators.py`

### Persistent state

- [Pipeline execution jobs](https://github.com/dhanush-10-1/jenkins-first-job/tree/main/backend/models): `backend/models`
- [SQL database](https://github.com/dhanush-10-1/jenkins-first-job/blob/main/backend/database.py): `backend/database.py`

### External systems

- **GitHub**
- **GitLab**

### Other components

- **Pipeline operator**

## Connections

- Pipeline operator → App and tabs: uses
- App and tabs → Pipeline canvas: renders
- App and tabs → YAML editor: renders
- App and tabs → YAML graph sync: converts
- Pipeline canvas → App and tabs: sends edits
- YAML editor → App and tabs: sends edits
- App and tabs → Live dashboard: shows
- App and tabs → Repository manager: shows
- Repository manager → FastAPI application: requests API
- Live dashboard → FastAPI application: requests state
- GitHub → Webhook handlers: pushes event
- GitLab → Webhook handlers: pushes event
- FastAPI application → Pipeline CRUD: registers router
- FastAPI application → Execution API: registers router
- FastAPI application → Webhook handlers: registers router
- Pipeline CRUD → SQL database: reads and writes
- Webhook handlers → SQL database: creates records
- Execution API → SQL database: reads and writes
- FastAPI application → Priority scheduler: starts polling
- Priority scheduler → Worker pool: selects worker
- Worker pool → Stage executor: runs stages
- FastAPI application → Workload simulators: starts simulations
- FastAPI application → SQL database: initializes
- FastAPI application → SQL database: queries SSE state
- Priority scheduler → SQL database: polls queued jobs
- Execution API → Priority scheduler: queues execution
