# benarfi/typescriptsamples architecture

> Architecture diagram of the GitHub repository benarfi/typescriptsamples, 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/benarfi/typescriptsamples
- Repository: https://github.com/benarfi/typescriptsamples

## Overview

This repository is a collection of independent TypeScript samples, not one product. The clearest end-to-end workflows are the Image Board’s HTTP routes and MongoDB operations, and the async sample’s GitHub pull-request, commit, and comment retrieval. Other groups preserve the README’s major demo families. Connections are limited to relationships shown by excerpts or SOURCE INDEX references; unsampled internals are not inferred.

Main entry points: [`react-flux-babel-karma/src/stores/GreetingStore.ts`](https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/stores/GreetingStore.ts) (Greeting Store), [`imageboard/app.ts`](https://github.com/benarfi/typescriptsamples/blob/master/imageboard/app.ts) (HTTP App), [`async/src/lib/index.ts`](https://github.com/benarfi/typescriptsamples/blob/master/async/src/lib/index.ts) (Async CLI), [`react-flux-babel-karma/src/components/App.tsx`](https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/components/App.tsx) (Greeting App)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_imageboard["Image Board"]
  node_express["HTTP App<br/>[app.ts]"]
  node_image_routes["Index Route<br/>[index.ts]"]
  node_image_db[("Mongo Data Access<br/>[db.ts]")]
end

subgraph group_async["Async GitHub"]
  node_async_entry["Async CLI<br/>[index.ts]"]
  node_github_client["GitHub Client<br/>[github.ts]"]
  node_async_utils["Formatting Utilities<br/>[utils.ts]"]
end

subgraph group_react["React Flux"]
  node_react_entry["React Mount<br/>[main.tsx]"]
  node_react_app["Greeting App<br/>[App.tsx]"]
  node_greeting_view["Greeting View<br/>[Greeting.tsx]"]
  node_who_view["Recipient Input<br/>[WhoToGreet.tsx]"]
  node_greeting_actions["Greeting Actions<br/>[GreetingActions.ts]"]
  node_greeting_store["Greeting Store<br/>[GreetingStore.ts]"]
  node_flux_store["Flux Base Store<br/>[FluxStore.ts]"]
  node_dispatcher["App Dispatcher<br/>[AppDispatcher.ts]"]
  node_greeting_state["Greeting State<br/>[GreetingState.ts]"]
end

subgraph group_frameworks["Framework Samples"]
  node_angular1["Angular Seed App<br/>[app.ts]"]
  node_angular_views["Angular Views<br/>[view1.ts]"]
  node_angular_version["Version Component<br/>[version.ts]"]
  node_angular2_todo["Angular 2 Todo<br/>[todo.ts]"]
  node_angularfire["AngularFire Adapter<br/>[angularfire.js]"]
  node_todomvc["TodoMVC<br/>[todos.ts]"]
end

subgraph group_demos["Other Demos"]
  node_mankala_game["Mankala Game<br/>[Game.ts]"]
  node_mankala_position["Board Position<br/>[Position.ts]"]
  node_warship["Warship Combat<br/>[warship.ts]"]
  node_raytracer["Raytracer<br/>[raytracer.ts]"]
  node_d3_data["D3 Data Demo<br/>[data.ts]"]
  node_parallax["Parallax Starfield<br/>[parallax.ts]"]
  node_time_reporter["Time Reporter<br/>[timeReporter.ts]"]
  node_browser_time["Browser Time Demo<br/>[app.ts]"]
end

node_visitor(("Web Visitor"))
node_mongodb[("MongoDB")]
node_remote_site["Remote Site"]
node_github_service["GitHub API"]
node_terminal(("Terminal"))

node_visitor -->|"requests"| node_express
node_express -->|"routes to"| node_image_routes
node_image_routes -->|"loads users"| node_image_db
node_express -->|"reads and writes"| node_image_db
node_image_db -->|"queries"| node_mongodb
node_express -->|"fetches HTML"| node_remote_site
node_terminal -->|"runs"| node_async_entry
node_async_entry -->|"requests pull data"| node_github_client
node_async_entry -->|"formats messages"| node_async_utils
node_github_client -.->|"calls API"| node_github_service
node_async_entry -->|"prints results"| node_terminal
node_react_entry -->|"mounts"| node_react_app
node_react_app -->|"reads state"| node_greeting_store
node_react_app -->|"renders"| node_greeting_view
node_react_app -->|"renders"| node_who_view
node_greeting_view -->|"uses"| node_greeting_actions
node_who_view -->|"uses"| node_greeting_actions
node_greeting_store -.->|"extends"| node_flux_store
node_greeting_store -.->|"registers with"| node_dispatcher
node_greeting_store -.->|"references"| node_greeting_actions
node_greeting_store -.->|"uses state type"| node_greeting_state
node_angular2_todo -->|"imports"| node_angularfire
node_mankala_game -.->|"uses positions"| node_mankala_position
node_browser_time -->|"starts"| node_time_reporter

click node_express "https://github.com/benarfi/typescriptsamples/blob/master/imageboard/app.ts"
click node_image_routes "https://github.com/benarfi/typescriptsamples/blob/master/imageboard/routes/index.ts"
click node_image_db "https://github.com/benarfi/typescriptsamples/blob/master/imageboard/db.ts"
click node_async_entry "https://github.com/benarfi/typescriptsamples/blob/master/async/src/lib/index.ts"
click node_github_client "https://github.com/benarfi/typescriptsamples/blob/master/async/src/lib/github.ts"
click node_async_utils "https://github.com/benarfi/typescriptsamples/blob/master/async/src/lib/utils.ts"
click node_react_entry "https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/main.tsx"
click node_react_app "https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/components/App.tsx"
click node_greeting_view "https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/components/Greeting.tsx"
click node_who_view "https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/components/WhoToGreet.tsx"
click node_greeting_actions "https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/actions/GreetingActions.ts"
click node_greeting_store "https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/stores/GreetingStore.ts"
click node_flux_store "https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/stores/FluxStore.ts"
click node_dispatcher "https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/dispatcher/AppDispatcher.ts"
click node_greeting_state "https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/types/GreetingState.ts"
click node_angular1 "https://github.com/benarfi/typescriptsamples/blob/master/angular1/app/app.ts"
click node_angular_views "https://github.com/benarfi/typescriptsamples/blob/master/angular1/app/view1/view1.ts"
click node_angular_version "https://github.com/benarfi/typescriptsamples/blob/master/angular1/app/components/version/version.ts"
click node_angular2_todo "https://github.com/benarfi/typescriptsamples/blob/master/angular2/app/todo.ts"
click node_angularfire "https://github.com/benarfi/typescriptsamples/blob/master/angular2/firebase/angularfire.js"
click node_todomvc "https://github.com/benarfi/typescriptsamples/blob/master/todomvc/js/todos.ts"
click node_mankala_game "https://github.com/benarfi/typescriptsamples/blob/master/mankala/Game.ts"
click node_mankala_position "https://github.com/benarfi/typescriptsamples/blob/master/mankala/Position.ts"
click node_warship "https://github.com/benarfi/typescriptsamples/blob/master/warship/warship.ts"
click node_raytracer "https://github.com/benarfi/typescriptsamples/blob/master/raytracer/raytracer.ts"
click node_d3_data "https://github.com/benarfi/typescriptsamples/blob/master/d3/data.ts"
click node_parallax "https://github.com/benarfi/typescriptsamples/blob/master/jquery/parallax.ts"
click node_time_reporter "https://github.com/benarfi/typescriptsamples/blob/master/umd/shared/timeReporter.ts"
click node_browser_time "https://github.com/benarfi/typescriptsamples/blob/master/umd/browser/app.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_express,node_image_routes,node_image_db toneBlue
class node_async_entry,node_github_client,node_async_utils,node_mongodb toneAmber
class node_react_entry,node_react_app,node_greeting_view,node_who_view,node_greeting_actions,node_greeting_store,node_flux_store,node_dispatcher,node_greeting_state,node_github_service toneMint
class node_angular1,node_angular_views,node_angular_version,node_angular2_todo,node_angularfire,node_todomvc toneRose
class node_mankala_game,node_mankala_position,node_warship,node_raytracer,node_d3_data,node_parallax,node_time_reporter,node_browser_time,node_visitor,node_remote_site,node_terminal toneIndigo
```

## Components

### Image Board

- [HTTP App](https://github.com/benarfi/typescriptsamples/blob/master/imageboard/app.ts): `imageboard/app.ts`
- [Index Route](https://github.com/benarfi/typescriptsamples/blob/master/imageboard/routes/index.ts): `imageboard/routes/index.ts`
- [Mongo Data Access](https://github.com/benarfi/typescriptsamples/blob/master/imageboard/db.ts): `imageboard/db.ts`

### Async GitHub

- [Async CLI](https://github.com/benarfi/typescriptsamples/blob/master/async/src/lib/index.ts): `async/src/lib/index.ts`
- [GitHub Client](https://github.com/benarfi/typescriptsamples/blob/master/async/src/lib/github.ts): `async/src/lib/github.ts`
- [Formatting Utilities](https://github.com/benarfi/typescriptsamples/blob/master/async/src/lib/utils.ts): `async/src/lib/utils.ts`

### React Flux

- [React Mount](https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/main.tsx): `react-flux-babel-karma/src/main.tsx`
- [Greeting App](https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/components/App.tsx): `react-flux-babel-karma/src/components/App.tsx`
- [Greeting View](https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/components/Greeting.tsx): `react-flux-babel-karma/src/components/Greeting.tsx`
- [Recipient Input](https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/components/WhoToGreet.tsx): `react-flux-babel-karma/src/components/WhoToGreet.tsx`
- [Greeting Actions](https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/actions/GreetingActions.ts): `react-flux-babel-karma/src/actions/GreetingActions.ts`
- [Greeting Store](https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/stores/GreetingStore.ts): `react-flux-babel-karma/src/stores/GreetingStore.ts`
- [Flux Base Store](https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/stores/FluxStore.ts): `react-flux-babel-karma/src/stores/FluxStore.ts`
- [App Dispatcher](https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/dispatcher/AppDispatcher.ts): `react-flux-babel-karma/src/dispatcher/AppDispatcher.ts`
- [Greeting State](https://github.com/benarfi/typescriptsamples/blob/master/react-flux-babel-karma/src/types/GreetingState.ts): `react-flux-babel-karma/src/types/GreetingState.ts`

### Framework Samples

- [Angular Seed App](https://github.com/benarfi/typescriptsamples/blob/master/angular1/app/app.ts): `angular1/app/app.ts`
- [Angular Views](https://github.com/benarfi/typescriptsamples/blob/master/angular1/app/view1/view1.ts): `angular1/app/view1/view1.ts`
- [Version Component](https://github.com/benarfi/typescriptsamples/blob/master/angular1/app/components/version/version.ts): `angular1/app/components/version/version.ts`
- [Angular 2 Todo](https://github.com/benarfi/typescriptsamples/blob/master/angular2/app/todo.ts): `angular2/app/todo.ts`
- [AngularFire Adapter](https://github.com/benarfi/typescriptsamples/blob/master/angular2/firebase/angularfire.js): `angular2/firebase/angularfire.js`
- [TodoMVC](https://github.com/benarfi/typescriptsamples/blob/master/todomvc/js/todos.ts): `todomvc/js/todos.ts`

### Other Demos

- [Mankala Game](https://github.com/benarfi/typescriptsamples/blob/master/mankala/Game.ts): `mankala/Game.ts`
- [Board Position](https://github.com/benarfi/typescriptsamples/blob/master/mankala/Position.ts): `mankala/Position.ts`
- [Warship Combat](https://github.com/benarfi/typescriptsamples/blob/master/warship/warship.ts): `warship/warship.ts`
- [Raytracer](https://github.com/benarfi/typescriptsamples/blob/master/raytracer/raytracer.ts): `raytracer/raytracer.ts`
- [D3 Data Demo](https://github.com/benarfi/typescriptsamples/blob/master/d3/data.ts): `d3/data.ts`
- [Parallax Starfield](https://github.com/benarfi/typescriptsamples/blob/master/jquery/parallax.ts): `jquery/parallax.ts`
- [Time Reporter](https://github.com/benarfi/typescriptsamples/blob/master/umd/shared/timeReporter.ts): `umd/shared/timeReporter.ts`
- [Browser Time Demo](https://github.com/benarfi/typescriptsamples/blob/master/umd/browser/app.ts): `umd/browser/app.ts`

### Other components

- **Web Visitor**
- **MongoDB**
- **Remote Site**
- **GitHub API**
- **Terminal**

## Connections

- Web Visitor → HTTP App: requests (evidence: `imageboard/app.ts`)
- HTTP App → Index Route: routes to (evidence: `imageboard/app.ts`)
- Index Route → Mongo Data Access: loads users (evidence: `imageboard/routes/index.ts`)
- HTTP App → Mongo Data Access: reads and writes (evidence: `imageboard/app.ts`)
- Mongo Data Access → MongoDB: queries (evidence: `imageboard/db.ts`)
- HTTP App → Remote Site: fetches HTML (evidence: `imageboard/app.ts`)
- Terminal → Async CLI: runs (evidence: `async/src/lib/index.ts`)
- Async CLI → GitHub Client: requests pull data (evidence: `async/src/lib/index.ts`)
- Async CLI → Formatting Utilities: formats messages (evidence: `async/src/lib/index.ts`)
- GitHub Client → GitHub API: calls API
- Async CLI → Terminal: prints results (evidence: `async/src/lib/index.ts`)
- React Mount → Greeting App: mounts (evidence: `react-flux-babel-karma/src/main.tsx`)
- Greeting App → Greeting Store: reads state (evidence: `react-flux-babel-karma/src/components/App.tsx`)
- Greeting App → Greeting View: renders (evidence: `react-flux-babel-karma/src/components/App.tsx`)
- Greeting App → Recipient Input: renders (evidence: `react-flux-babel-karma/src/components/App.tsx`)
- Greeting View → Greeting Actions: uses (evidence: `react-flux-babel-karma/src/components/Greeting.tsx`)
- Recipient Input → Greeting Actions: uses (evidence: `react-flux-babel-karma/src/components/WhoToGreet.tsx`)
- Greeting Store → Flux Base Store: extends (evidence: `react-flux-babel-karma/src/stores/GreetingStore.ts`)
- Greeting Store → App Dispatcher: registers with (evidence: `react-flux-babel-karma/src/stores/GreetingStore.ts`)
- Greeting Store → Greeting Actions: references (evidence: `react-flux-babel-karma/src/stores/GreetingStore.ts`)
- Greeting Store → Greeting State: uses state type (evidence: `react-flux-babel-karma/src/stores/GreetingStore.ts`)
- Angular 2 Todo → AngularFire Adapter: imports (evidence: `angular2/app/todo.ts`)
- Mankala Game → Board Position: uses positions
- Browser Time Demo → Time Reporter: starts (evidence: `umd/browser/app.ts`)
