# harshit-dev-on/simhub architecture

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

- Interactive diagram: https://gitdiagram.com/harshit-dev-on/simhub
- Repository: https://github.com/harshit-dev-on/simhub

## Overview

SimHub is a web platform for finding, testing, running, and discussing verified STEM simulations. The main creator-to-learner path is: submit a simulation, run six security checks, review it, publish it to the catalogue, then let learners open it in a sandbox and use the POE learning loop. The map also preserves documented community, Markdown, subscription, and moderation capabilities. Some paths are based on README documentation because their source was not sampled; links are omitted where the available evidence does not establish a caller or data transfer.

Main entry points: [`frontend/components/views/GatesConsole.tsx`](https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/views/GatesConsole.tsx) (Submission console), [`frontend/app/page.tsx`](https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/page.tsx) (App shell), [`frontend/components/views/WatchView.tsx`](https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/views/WatchView.tsx) (Simulation player), [`frontend/components/views/FeedView.tsx`](https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/views/FeedView.tsx) (Simulation catalogue)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Discovery and playback"]
  node_header["Header and search<br/>[Header.tsx]"]
  node_sidebar["Category navigation<br/>[Sidebar.tsx]"]
  node_feed["Simulation catalogue<br/>[FeedView.tsx]"]
  node_watch["Simulation player<br/>[WatchView.tsx]"]
  node_subscriptions["Creator subscriptions"]
end

subgraph group_verification["Verification and publishing"]
  node_submission_ui["Submission console<br/>[GatesConsole.tsx]"]
  node_gate_ownership["Ownership gate<br/>[route.ts]"]
  node_gate_linkage["Linkage gate<br/>[route.ts]"]
  node_gate_liveness["Liveness gate<br/>[route.ts]"]
  node_gate_safety["Safe browsing gate<br/>[route.ts]"]
  node_gate_license["License gate<br/>[route.ts]"]
  node_gate_scan["Tracker scan gate<br/>[route.ts]"]
  node_submission_api["Submission intake<br/>[route.ts]"]
  node_admin["Review and reverify<br/>[AdminQueue.tsx]"]
  node_admin_api["Moderation API<br/>[route.ts]"]
end

subgraph group_learning["Learning and community"]
  node_workbench["Simulation workbench"]
  node_poe["POE challenge<br/>[PoeModal.tsx]"]
  node_quiz_api["Quiz and grading API<br/>[route.ts]"]
  node_comments["Threaded discussions"]
  node_comments_api["Comments API<br/>[route.ts]"]
  node_markdown["Markdown editor and renderer"]
end

subgraph group_identity["Identity and profiles"]
  node_auth_modal["Authentication dialog<br/>[AuthModal.tsx]"]
  node_supabase_client["Supabase auth client<br/>[supabase.ts]"]
  node_supabase["Supabase service"]
end

subgraph group_platform["Application and data"]
  node_app["App shell<br/>[page.tsx]"]
  node_registry_api["Simulation registry API<br/>[route.ts]"]
  node_store[("Local simulation store<br/>[store.ts]")]
end

node_learner(("Learner or creator"))

node_learner -->|"opens"| node_app
node_app -->|"presents"| node_header
node_app -->|"presents"| node_sidebar
node_app -->|"presents"| node_feed
node_app -->|"presents"| node_watch
node_app -->|"presents"| node_subscriptions
node_learner -->|"submits simulation"| node_submission_ui
node_submission_ui -->|"checks"| node_gate_ownership
node_submission_ui -->|"checks"| node_gate_linkage
node_submission_ui -->|"checks"| node_gate_liveness
node_submission_ui -->|"checks"| node_gate_safety
node_submission_ui -->|"checks"| node_gate_license
node_submission_ui -->|"checks"| node_gate_scan
node_submission_ui -->|"queues submission"| node_submission_api
node_learner -->|"moderates"| node_admin
node_admin -->|"approves or restricts"| node_admin_api
node_feed -.->|"loads catalogue"| node_registry_api
node_watch -->|"opens simulation stage"| node_workbench
node_watch -->|"shows discussion"| node_comments
node_watch -->|"renders description"| node_markdown
node_workbench -->|"starts challenge"| node_poe
node_poe -.->|"submits answers"| node_quiz_api
node_comments -->|"syncs votes and comments"| node_comments_api
node_auth_modal -->|"maps auth user"| node_supabase_client
node_supabase_client -->|"authenticates"| node_supabase
node_submission_ui -->|"edits README"| node_markdown

click node_app "https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/page.tsx"
click node_header "https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/layout/Header.tsx"
click node_sidebar "https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/layout/Sidebar.tsx"
click node_feed "https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/views/FeedView.tsx"
click node_watch "https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/views/WatchView.tsx"
click node_subscriptions "https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/views/SubscriptionsFeed.tsx"
click node_registry_api "https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/simulations/route.ts"
click node_submission_ui "https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/views/GatesConsole.tsx"
click node_gate_ownership "https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/gates/ownership/route.ts"
click node_gate_linkage "https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/gates/linkage/route.ts"
click node_gate_liveness "https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/gates/liveness/route.ts"
click node_gate_safety "https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/gates/safebrowsing/route.ts"
click node_gate_license "https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/gates/license/route.ts"
click node_gate_scan "https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/gates/scan/route.ts"
click node_submission_api "https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/submissions/route.ts"
click node_admin "https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/views/AdminQueue.tsx"
click node_admin_api "https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/admin/approve/route.ts"
click node_workbench "https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/views/SimulationWorkbench.tsx"
click node_poe "https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/modals/PoeModal.tsx"
click node_quiz_api "https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/quiz/grade/route.ts"
click node_comments "https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/comments/RedditCommentsSection.tsx"
click node_comments_api "https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/simulations/%5Bid%5D/comments/route.ts"
click node_markdown "https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/markdown/MarkdownRenderer.tsx"
click node_auth_modal "https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/modals/AuthModal.tsx"
click node_supabase_client "https://github.com/harshit-dev-on/simhub/blob/main/frontend/lib/supabase.ts"
click node_store "https://github.com/harshit-dev-on/simhub/blob/main/frontend/lib/store.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_header,node_sidebar,node_feed,node_watch,node_subscriptions toneBlue
class node_submission_ui,node_gate_ownership,node_gate_linkage,node_gate_liveness,node_gate_safety,node_gate_license,node_gate_scan,node_submission_api,node_admin,node_admin_api toneAmber
class node_workbench,node_poe,node_quiz_api,node_comments,node_comments_api,node_markdown toneMint
class node_auth_modal,node_supabase_client,node_supabase toneRose
class node_app,node_registry_api,node_store,node_learner toneIndigo
```

## Components

### Discovery and playback

- [Header and search](https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/layout/Header.tsx): `frontend/components/layout/Header.tsx`
- [Category navigation](https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/layout/Sidebar.tsx): `frontend/components/layout/Sidebar.tsx`
- [Simulation catalogue](https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/views/FeedView.tsx): `frontend/components/views/FeedView.tsx`
- [Simulation player](https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/views/WatchView.tsx): `frontend/components/views/WatchView.tsx`
- [Creator subscriptions](https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/views/SubscriptionsFeed.tsx): `frontend/components/views/SubscriptionsFeed.tsx`

### Verification and publishing

- [Submission console](https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/views/GatesConsole.tsx): `frontend/components/views/GatesConsole.tsx`
- [Ownership gate](https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/gates/ownership/route.ts): `frontend/app/api/gates/ownership/route.ts`
- [Linkage gate](https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/gates/linkage/route.ts): `frontend/app/api/gates/linkage/route.ts`
- [Liveness gate](https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/gates/liveness/route.ts): `frontend/app/api/gates/liveness/route.ts`
- [Safe browsing gate](https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/gates/safebrowsing/route.ts): `frontend/app/api/gates/safebrowsing/route.ts`
- [License gate](https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/gates/license/route.ts): `frontend/app/api/gates/license/route.ts`
- [Tracker scan gate](https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/gates/scan/route.ts): `frontend/app/api/gates/scan/route.ts`
- [Submission intake](https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/submissions/route.ts): `frontend/app/api/submissions/route.ts`
- [Review and reverify](https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/views/AdminQueue.tsx): `frontend/components/views/AdminQueue.tsx`
- [Moderation API](https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/admin/approve/route.ts): `frontend/app/api/admin/approve/route.ts`

### Learning and community

- [Simulation workbench](https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/views/SimulationWorkbench.tsx): `frontend/components/views/SimulationWorkbench.tsx`
- [POE challenge](https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/modals/PoeModal.tsx): `frontend/components/modals/PoeModal.tsx`
- [Quiz and grading API](https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/quiz/grade/route.ts): `frontend/app/api/quiz/grade/route.ts`
- [Threaded discussions](https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/comments/RedditCommentsSection.tsx): `frontend/components/comments/RedditCommentsSection.tsx`
- [Comments API](https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/simulations/%5Bid%5D/comments/route.ts): `frontend/app/api/simulations/[id]/comments/route.ts`
- [Markdown editor and renderer](https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/markdown/MarkdownRenderer.tsx): `frontend/components/markdown/MarkdownRenderer.tsx`

### Identity and profiles

- [Authentication dialog](https://github.com/harshit-dev-on/simhub/blob/main/frontend/components/modals/AuthModal.tsx): `frontend/components/modals/AuthModal.tsx`
- [Supabase auth client](https://github.com/harshit-dev-on/simhub/blob/main/frontend/lib/supabase.ts): `frontend/lib/supabase.ts`
- **Supabase service**

### Application and data

- [App shell](https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/page.tsx): `frontend/app/page.tsx`
- [Simulation registry API](https://github.com/harshit-dev-on/simhub/blob/main/frontend/app/api/simulations/route.ts): `frontend/app/api/simulations/route.ts`
- [Local simulation store](https://github.com/harshit-dev-on/simhub/blob/main/frontend/lib/store.ts): `frontend/lib/store.ts`

### Other components

- **Learner or creator**

## Connections

- Learner or creator → App shell: opens (evidence: `README.md`)
- App shell → Header and search: presents (evidence: `README.md`)
- App shell → Category navigation: presents (evidence: `README.md`)
- App shell → Simulation catalogue: presents (evidence: `README.md`)
- App shell → Simulation player: presents (evidence: `README.md`)
- App shell → Creator subscriptions: presents (evidence: `README.md`)
- Learner or creator → Submission console: submits simulation (evidence: `README.md`)
- Submission console → Ownership gate: checks (evidence: `frontend/components/views/GatesConsole.tsx`)
- Submission console → Linkage gate: checks (evidence: `frontend/components/views/GatesConsole.tsx`)
- Submission console → Liveness gate: checks (evidence: `frontend/components/views/GatesConsole.tsx`)
- Submission console → Safe browsing gate: checks (evidence: `frontend/components/views/GatesConsole.tsx`)
- Submission console → License gate: checks (evidence: `frontend/components/views/GatesConsole.tsx`)
- Submission console → Tracker scan gate: checks (evidence: `frontend/components/views/GatesConsole.tsx`)
- Submission console → Submission intake: queues submission (evidence: `frontend/components/views/GatesConsole.tsx`)
- Learner or creator → Review and reverify: moderates (evidence: `README.md`)
- Review and reverify → Moderation API: approves or restricts (evidence: `README.md`)
- Simulation catalogue → Simulation registry API: loads catalogue
- Simulation player → Simulation workbench: opens simulation stage (evidence: `README.md`)
- Simulation player → Threaded discussions: shows discussion (evidence: `README.md`)
- Simulation player → Markdown editor and renderer: renders description (evidence: `README.md`)
- Simulation workbench → POE challenge: starts challenge (evidence: `README.md`)
- POE challenge → Quiz and grading API: submits answers
- Threaded discussions → Comments API: syncs votes and comments (evidence: `README.md`)
- Authentication dialog → Supabase auth client: maps auth user (evidence: `frontend/components/modals/AuthModal.tsx`)
- Supabase auth client → Supabase service: authenticates (evidence: `README.md`)
- Submission console → Markdown editor and renderer: edits README (evidence: `README.md`)
