# shinasmuhammedk/org architecture

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

- Interactive diagram: https://gitdiagram.com/shinasmuhammedk/org
- Repository: https://github.com/shinasmuhammedk/org

## Overview

ORG is a workflow-automation platform; this tree shows its Go API and runtime, not the visual editor. Users authenticate, create and configure workflows, then publish, schedule, or trigger runs; queued jobs execute and runs can be inspected. The README documents broader execution capabilities, OAuth, billing, and monitoring. Some runtime links are supported only by README statements or are unverified because their source was not sampled; dashed edges mark those unverified links.

Main entry points: [`services/api-core/internal/workflow/service/workflow_service.go`](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/workflow/service/workflow_service.go) (Workflow service), [`services/api-core/internal/router/router.go`](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/router/router.go) (HTTP API), [`services/api-core/internal/auth/handler/auth_handler.go`](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/auth/handler/auth_handler.go) (Authentication), [`services/api-core/internal/auth/handler/google_auth_handler.go`](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/auth/handler/google_auth_handler.go) (Google OAuth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and identity"]
  node_api["HTTP API<br/>[router.go]"]
  node_auth["Authentication<br/>[auth_handler.go]"]
  node_authservice["Auth service<br/>[auth_service.go]"]
  node_authrepo["User repository"]
  node_oauth["Google OAuth"]
end

subgraph group_design["Workflow design"]
  node_workflowapi["Workflow API"]
  node_workflowservice["Workflow service"]
  node_workflowrepo["Workflow repository"]
  node_workflowdb[("Workflow state<br/>[workflow.sql.go]")]
end

subgraph group_runtime["Execution runtime"]
  node_queue["Redis job queue<br/>[redis_queue.go]"]
  node_worker["Workflow worker<br/>[workflow_worker.go]"]
  node_executors["Workflow executors<br/>[executor.go]"]
  node_scheduler["Cron scheduler<br/>[scheduler.go]"]
  node_monitoring["Run monitoring"]
end

subgraph group_integrations["Platform integrations"]
  node_gemini["Gemini integration<br/>[gemini_service.go]"]
  node_oauthprovider["Google identity"]
  node_billing["Billing API<br/>[handler.go]"]
  node_billingservice["Billing service"]
  node_stripe["Stripe"]
  node_usage["Usage tracking<br/>[handler.go]"]
end

node_user(("User"))

node_user -->|"sends requests"| node_api
node_api -->|"routes auth"| node_auth
node_auth -->|"calls"| node_authservice
node_authservice -->|"uses"| node_authrepo
node_auth -->|"routes OAuth"| node_oauth
node_oauth -->|"gets user tokens"| node_authservice
node_oauth -->|"exchanges code"| node_oauthprovider
node_api -->|"routes workflows"| node_workflowapi
node_workflowapi -->|"calls"| node_workflowservice
node_workflowservice -->|"reads and writes"| node_workflowrepo
node_workflowrepo -->|"runs queries"| node_workflowdb
node_workflowservice -->|"enqueues runs"| node_queue
node_queue -.->|"delivers jobs"| node_worker
node_worker -->|"executes run"| node_workflowservice
node_workflowservice -.->|"dispatches steps"| node_executors
node_executors -.->|"requests AI steps"| node_gemini
node_scheduler -->|"starts scheduled runs"| node_workflowservice
node_workflowservice -->|"publishes run events"| node_monitoring
node_monitoring -->|"streams updates"| node_user
node_api -->|"routes billing"| node_billing
node_billing -->|"requests billing"| node_billingservice
node_billingservice -.->|"handles payments"| node_stripe
node_api -->|"routes usage"| node_usage
node_workflowapi -.->|"checks usage"| node_usage

click node_api "https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/router/router.go"
click node_auth "https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/auth/handler/auth_handler.go"
click node_authservice "https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/auth/service/auth_service.go"
click node_authrepo "https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/auth/repository/sqlc_user_repository.go"
click node_oauth "https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/auth/handler/google_auth_handler.go"
click node_workflowapi "https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/workflow/handler/workflow_handler.go"
click node_workflowservice "https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/workflow/service/workflow_service.go"
click node_workflowrepo "https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/workflow/repository/sqlc_workflow_repository.go"
click node_workflowdb "https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/db/workflow.sql.go"
click node_queue "https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/queue/redis_queue.go"
click node_worker "https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/worker/workflow_worker.go"
click node_executors "https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/workflow/executor/executor.go"
click node_scheduler "https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/scheduler/scheduler.go"
click node_monitoring "https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/workflow/service/workflow_service.go"
click node_gemini "https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/gemini/service/gemini_service.go"
click node_billing "https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/billing/handler.go"
click node_usage "https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/usage/handler/handler.go"

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_api,node_auth,node_authservice,node_authrepo,node_oauth,node_user toneBlue
class node_workflowapi,node_workflowservice,node_workflowrepo,node_workflowdb toneAmber
class node_queue,node_worker,node_executors,node_scheduler,node_monitoring toneMint
class node_gemini,node_oauthprovider,node_billing,node_billingservice,node_stripe,node_usage toneRose
```

## Components

### API and identity

- [HTTP API](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/router/router.go): `services/api-core/internal/router/router.go`
- [Authentication](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/auth/handler/auth_handler.go): `services/api-core/internal/auth/handler/auth_handler.go`
- [Auth service](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/auth/service/auth_service.go): `services/api-core/internal/auth/service/auth_service.go`
- [User repository](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/auth/repository/sqlc_user_repository.go): `services/api-core/internal/auth/repository/sqlc_user_repository.go`
- [Google OAuth](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/auth/handler/google_auth_handler.go): `services/api-core/internal/auth/handler/google_auth_handler.go`

### Workflow design

- [Workflow API](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/workflow/handler/workflow_handler.go): `services/api-core/internal/workflow/handler/workflow_handler.go`
- [Workflow service](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/workflow/service/workflow_service.go): `services/api-core/internal/workflow/service/workflow_service.go`
- [Workflow repository](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/workflow/repository/sqlc_workflow_repository.go): `services/api-core/internal/workflow/repository/sqlc_workflow_repository.go`
- [Workflow state](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/db/workflow.sql.go): `services/api-core/internal/db/workflow.sql.go`

### Execution runtime

- [Redis job queue](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/queue/redis_queue.go): `services/api-core/internal/queue/redis_queue.go`
- [Workflow worker](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/worker/workflow_worker.go): `services/api-core/internal/worker/workflow_worker.go`
- [Workflow executors](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/workflow/executor/executor.go): `services/api-core/internal/workflow/executor/executor.go`
- [Cron scheduler](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/scheduler/scheduler.go): `services/api-core/internal/scheduler/scheduler.go`
- [Run monitoring](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/workflow/service/workflow_service.go): `services/api-core/internal/workflow/service/workflow_service.go`

### Platform integrations

- [Gemini integration](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/gemini/service/gemini_service.go): `services/api-core/internal/gemini/service/gemini_service.go`
- **Google identity**
- [Billing API](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/billing/handler.go): `services/api-core/internal/billing/handler.go`
- **Billing service**
- **Stripe**
- [Usage tracking](https://github.com/shinasmuhammedk/org/blob/main/services/api-core/internal/usage/handler/handler.go): `services/api-core/internal/usage/handler/handler.go`

### Other components

- **User**

## Connections

- User → HTTP API: sends requests
- HTTP API → Authentication: routes auth (evidence: `services/api-core/internal/router/router.go`)
- Authentication → Auth service: calls (evidence: `services/api-core/internal/auth/handler/auth_handler.go`)
- Auth service → User repository: uses (evidence: `services/api-core/internal/auth/service/auth_service.go`)
- Authentication → Google OAuth: routes OAuth
- Google OAuth → Auth service: gets user tokens (evidence: `services/api-core/internal/auth/handler/google_auth_handler.go`)
- Google OAuth → Google identity: exchanges code (evidence: `services/api-core/internal/auth/handler/google_auth_handler.go`)
- HTTP API → Workflow API: routes workflows (evidence: `services/api-core/internal/router/router.go`)
- Workflow API → Workflow service: calls (evidence: `services/api-core/internal/workflow/handler/workflow_handler.go`)
- Workflow service → Workflow repository: reads and writes (evidence: `services/api-core/internal/workflow/service/workflow_service.go`)
- Workflow repository → Workflow state: runs queries (evidence: `services/api-core/internal/workflow/repository/sqlc_workflow_repository.go`)
- Workflow service → Redis job queue: enqueues runs (evidence: `services/api-core/internal/workflow/service/workflow_service.go`)
- Redis job queue → Workflow worker: delivers jobs
- Workflow worker → Workflow service: executes run (evidence: `services/api-core/internal/worker/workflow_worker.go`)
- Workflow service → Workflow executors: dispatches steps
- Workflow executors → Gemini integration: requests AI steps
- Cron scheduler → Workflow service: starts scheduled runs
- Workflow service → Run monitoring: publishes run events (evidence: `services/api-core/internal/workflow/service/workflow_service.go`)
- Run monitoring → User: streams updates
- HTTP API → Billing API: routes billing (evidence: `services/api-core/internal/router/router.go`)
- Billing API → Billing service: requests billing (evidence: `services/api-core/internal/billing/handler.go`)
- Billing service → Stripe: handles payments
- HTTP API → Usage tracking: routes usage (evidence: `services/api-core/internal/router/router.go`)
- Workflow API → Usage tracking: checks usage
