# rmotgi1227/genie architecture

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

- Interactive diagram: https://gitdiagram.com/rmotgi1227/genie
- Repository: https://github.com/rmotgi1227/genie
- Video tour (about a minute): https://gitdiagram.com/rmotgi1227/genie/video

## Overview

Genie discovers software requests, checks demand and existing tools, obtains human approval, builds and tests an app, then publishes it and replies to its requester. Its maintenance loop handles issues on published apps and requires approval before changes. The README documents the broader product workflow; sampled source confirms the central orchestration and selected module relationships, while several subsystem details are supported only by documentation or the source index.

Main entry points: [`genie.ts`](https://github.com/rmotgi1227/genie/blob/main/genie.ts) (Approval orchestration), [`steps/launch.ts`](https://github.com/rmotgi1227/genie/blob/main/steps/launch.ts) (Publish and reply), [`steps/discover.ts`](https://github.com/rmotgi1227/genie/blob/main/steps/discover.ts) (Find and validate wishes), [`steps/build.ts`](https://github.com/rmotgi1227/genie/blob/main/steps/build.ts) (Generate app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Wish discovery"]
  node_discover["Find and validate wishes<br/>[discover.ts]"]
  node_reddit_reader["Reddit search and lookup<br/>[reddit.ts]"]
  node_parallel_search["Search and grouping<br/>[parallel.ts]"]
  node_sample_discovery["Sample discovery<br/>[discover.fake.ts]"]
end

subgraph group_approval["Human approval"]
  node_approval_flow["Approval orchestration<br/>[genie.ts]"]
  node_approval_transport["Ask and notify<br/>[askApproval.ts]"]
  node_messenger["Messaging transports<br/>[messenger.ts]"]
  node_reply_router["Reply routing<br/>[reply.ts]"]
end

subgraph group_creation["Build and test"]
  node_builder["Generate app<br/>[build.ts]"]
  node_tester["App checks and screenshots<br/>[build.ts]"]
end

subgraph group_shipping["Launch and care"]
  node_launch["Publish and reply<br/>[launch.ts]"]
  node_deployment["Deploy app<br/>[deploy.ts]"]
  node_issue_fix["Fix requested changes<br/>[fix.ts]"]
  node_composio["Composio tool client<br/>[composio.ts]"]
  node_repo["Repository ownership<br/>[repo.ts]"]
end

subgraph group_runtime["Runtime and interface"]
  node_state[("Workflow state<br/>[state.ts]")]
  node_board["Operator board<br/>[index.html]"]
  node_guard["Untrusted input filtering<br/>[guard.ts]"]
  node_types["Workflow data contract<br/>[types.ts]"]
end

node_maker(("Owner"))
node_reddit{{"Reddit"}}
node_parallel_service{{"Parallel"}}
node_github_service{{"GitHub"}}
node_vercel{{"Vercel"}}

node_maker -->|"approves by text"| node_approval_transport
node_reddit -.->|"provides posts"| node_reddit_reader
node_discover -->|"looks up posts"| node_reddit_reader
node_discover -->|"searches and checks"| node_parallel_search
node_discover -->|"falls back to samples"| node_sample_discovery
node_parallel_search -->|"searches"| node_parallel_service
node_reddit_reader -->|"calls tools"| node_composio
node_approval_flow -->|"finds candidates"| node_discover
node_approval_flow -->|"asks approval"| node_approval_transport
node_approval_flow -->|"builds approved app"| node_builder
node_approval_flow -->|"tests app"| node_tester
node_approval_flow -.->|"ships approved app"| node_launch
node_approval_flow -->|"handles issue changes"| node_issue_fix
node_approval_transport -->|"uses transport"| node_messenger
node_approval_flow -->|"routes reply"| node_reply_router
node_maker -.->|"sends decision"| node_reply_router
node_builder -.->|"produces app for checks"| node_tester
node_launch -->|"deploys app"| node_deployment
node_launch -->|"resolves owner"| node_repo
node_launch -->|"publishes and replies"| node_composio
node_launch -->|"creates public repo"| node_github_service
node_deployment -->|"deploys to"| node_vercel
node_launch -->|"replies to requester"| node_reddit
node_issue_fix -->|"reuses build tooling"| node_builder
node_issue_fix -.->|"retests changes"| node_tester
node_approval_flow -->|"records workflow"| node_state
node_board -.->|"shows workflow"| node_state
node_discover -->|"filters untrusted text"| node_guard
node_builder -->|"uses app contract"| node_types
node_launch -->|"uses app contract"| node_types

click node_discover "https://github.com/rmotgi1227/genie/blob/main/steps/discover.ts"
click node_reddit_reader "https://github.com/rmotgi1227/genie/blob/main/lib/reddit.ts"
click node_parallel_search "https://github.com/rmotgi1227/genie/blob/main/lib/parallel.ts"
click node_sample_discovery "https://github.com/rmotgi1227/genie/blob/main/steps/discover.fake.ts"
click node_approval_flow "https://github.com/rmotgi1227/genie/blob/main/genie.ts"
click node_approval_transport "https://github.com/rmotgi1227/genie/blob/main/steps/askApproval.ts"
click node_messenger "https://github.com/rmotgi1227/genie/blob/main/lib/messenger.ts"
click node_reply_router "https://github.com/rmotgi1227/genie/blob/main/lib/reply.ts"
click node_builder "https://github.com/rmotgi1227/genie/blob/main/steps/build.ts"
click node_tester "https://github.com/rmotgi1227/genie/blob/main/steps/build.ts"
click node_launch "https://github.com/rmotgi1227/genie/blob/main/steps/launch.ts"
click node_deployment "https://github.com/rmotgi1227/genie/blob/main/steps/deploy.ts"
click node_issue_fix "https://github.com/rmotgi1227/genie/blob/main/steps/fix.ts"
click node_composio "https://github.com/rmotgi1227/genie/blob/main/lib/composio.ts"
click node_repo "https://github.com/rmotgi1227/genie/blob/main/lib/repo.ts"
click node_state "https://github.com/rmotgi1227/genie/blob/main/lib/state.ts"
click node_board "https://github.com/rmotgi1227/genie/blob/main/board/index.html"
click node_guard "https://github.com/rmotgi1227/genie/blob/main/lib/guard.ts"
click node_types "https://github.com/rmotgi1227/genie/blob/main/lib/types.ts"

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_discover,node_reddit_reader,node_parallel_search,node_sample_discovery toneBlue
class node_approval_flow,node_approval_transport,node_messenger,node_reply_router toneAmber
class node_builder,node_tester toneMint
class node_launch,node_deployment,node_issue_fix,node_composio,node_repo toneRose
class node_state,node_board,node_guard,node_types,node_maker,node_reddit,node_parallel_service,node_github_service,node_vercel toneIndigo
```

## Components

### Wish discovery

- [Find and validate wishes](https://github.com/rmotgi1227/genie/blob/main/steps/discover.ts): `steps/discover.ts`
- [Reddit search and lookup](https://github.com/rmotgi1227/genie/blob/main/lib/reddit.ts): `lib/reddit.ts`
- [Search and grouping](https://github.com/rmotgi1227/genie/blob/main/lib/parallel.ts): `lib/parallel.ts`
- [Sample discovery](https://github.com/rmotgi1227/genie/blob/main/steps/discover.fake.ts): `steps/discover.fake.ts`

### Human approval

- [Approval orchestration](https://github.com/rmotgi1227/genie/blob/main/genie.ts): `genie.ts`
- [Ask and notify](https://github.com/rmotgi1227/genie/blob/main/steps/askApproval.ts): `steps/askApproval.ts`
- [Messaging transports](https://github.com/rmotgi1227/genie/blob/main/lib/messenger.ts): `lib/messenger.ts`
- [Reply routing](https://github.com/rmotgi1227/genie/blob/main/lib/reply.ts): `lib/reply.ts`

### Build and test

- [Generate app](https://github.com/rmotgi1227/genie/blob/main/steps/build.ts): `steps/build.ts`
- [App checks and screenshots](https://github.com/rmotgi1227/genie/blob/main/steps/build.ts): `steps/build.ts`

### Launch and care

- [Publish and reply](https://github.com/rmotgi1227/genie/blob/main/steps/launch.ts): `steps/launch.ts`
- [Deploy app](https://github.com/rmotgi1227/genie/blob/main/steps/deploy.ts): `steps/deploy.ts`
- [Fix requested changes](https://github.com/rmotgi1227/genie/blob/main/steps/fix.ts): `steps/fix.ts`
- [Composio tool client](https://github.com/rmotgi1227/genie/blob/main/lib/composio.ts): `lib/composio.ts`
- [Repository ownership](https://github.com/rmotgi1227/genie/blob/main/lib/repo.ts): `lib/repo.ts`

### Runtime and interface

- [Workflow state](https://github.com/rmotgi1227/genie/blob/main/lib/state.ts): `lib/state.ts`
- [Operator board](https://github.com/rmotgi1227/genie/blob/main/board/index.html): `board/index.html`
- [Untrusted input filtering](https://github.com/rmotgi1227/genie/blob/main/lib/guard.ts): `lib/guard.ts`
- [Workflow data contract](https://github.com/rmotgi1227/genie/blob/main/lib/types.ts): `lib/types.ts`

### Other components

- **Owner**
- **Reddit**
- **Parallel**
- **GitHub**
- **Vercel**

## Connections

- Owner → Ask and notify: approves by text (evidence: `README.md`)
- Reddit → Reddit search and lookup: provides posts (evidence: `README.md`)
- Find and validate wishes → Reddit search and lookup: looks up posts (evidence: `steps/discover.ts`)
- Find and validate wishes → Search and grouping: searches and checks (evidence: `steps/discover.ts`)
- Find and validate wishes → Sample discovery: falls back to samples (evidence: `steps/discover.ts`)
- Search and grouping → Parallel: searches (evidence: `README.md`)
- Reddit search and lookup → Composio tool client: calls tools (evidence: `lib/reddit.ts`)
- Approval orchestration → Find and validate wishes: finds candidates (evidence: `genie.ts`)
- Approval orchestration → Ask and notify: asks approval (evidence: `genie.ts`)
- Approval orchestration → Generate app: builds approved app (evidence: `genie.ts`)
- Approval orchestration → App checks and screenshots: tests app (evidence: `genie.ts`)
- Approval orchestration → Publish and reply: ships approved app (evidence: `README.md`)
- Approval orchestration → Fix requested changes: handles issue changes (evidence: `genie.ts`)
- Ask and notify → Messaging transports: uses transport (evidence: `steps/askApproval.ts`)
- Approval orchestration → Reply routing: routes reply (evidence: `genie.ts`)
- Owner → Reply routing: sends decision (evidence: `README.md`)
- Generate app → App checks and screenshots: produces app for checks (evidence: `README.md`)
- Publish and reply → Deploy app: deploys app (evidence: `steps/launch.ts`)
- Publish and reply → Repository ownership: resolves owner (evidence: `steps/launch.ts`)
- Publish and reply → Composio tool client: publishes and replies (evidence: `steps/launch.ts`)
- Publish and reply → GitHub: creates public repo (evidence: `README.md`)
- Deploy app → Vercel: deploys to (evidence: `README.md`)
- Publish and reply → Reddit: replies to requester (evidence: `README.md`)
- Fix requested changes → Generate app: reuses build tooling (evidence: `steps/fix.ts`)
- Fix requested changes → App checks and screenshots: retests changes (evidence: `README.md`)
- Approval orchestration → Workflow state: records workflow (evidence: `genie.ts`)
- Operator board → Workflow state: shows workflow (evidence: `README.md`)
- Find and validate wishes → Untrusted input filtering: filters untrusted text (evidence: `steps/discover.ts`)
- Generate app → Workflow data contract: uses app contract (evidence: `steps/build.ts`)
- Publish and reply → Workflow data contract: uses app contract (evidence: `steps/launch.ts`)
