# mayur-anand-cys/crane-apple-otter-amber architecture

> Architecture diagram of the GitHub repository mayur-anand-cys/crane-apple-otter-amber, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mayur-anand-cys/crane-apple-otter-amber
- Repository: https://github.com/mayur-anand-cys/crane-apple-otter-amber

## Overview

Cyber Suraksha is an interactive cybersecurity-awareness app focused on phishing, digital-arrest scams, and malicious apps. Users enter a tabbed learning portal, practise scenarios, study locally stored material, take assessments, and consult scam-response guidance. The sampled portal shows how it dispatches to learning sections; the component excerpts also show local study progress and the embedded-preview bridge. Authentication, connector data, and PWA behavior are present in the tree, but their full runtime paths were not sampled, so those links are limited to directly evidenced relationships.

Main entry points: [`src/components/portal.tsx`](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/components/portal.tsx) (Learning portal), [`src/components/studio.tsx`](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/components/studio.tsx) (Study studio), [`src/routes/__root.tsx`](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/routes/__root.tsx) (Application root), [`src/components/preview-host-bridge.tsx`](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/components/preview-host-bridge.tsx) (Preview bridge mount)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning experience"]
  node_portal["Learning portal<br/>[portal.tsx]"]
  node_simulator["Simulator lab<br/>[lab.tsx]"]
  node_assessment["Assessments<br/>[assess.tsx]"]
  node_study["Study studio<br/>[studio.tsx]"]
  node_navigation["Site navigation<br/>[shell.tsx]"]
end

subgraph group_content["Learning content"]
  node_briefing["Briefing material<br/>[content.ts]"]
  node_threats["Threat guidance<br/>[portal.ts]"]
end

subgraph group_platform["Identity and data"]
  node_auth["Authentication provider<br/>[provider.tsx]"]
  node_authclient["Auth client<br/>[client.ts]"]
  node_appdata["Connector app data<br/>[client.server.ts]"]
  node_storage[("Browser storage<br/>[storage.ts]")]
end

subgraph group_hosting["Hosting and preview"]
  node_root["Application root<br/>[__root.tsx]"]
  node_previewcomponent["Preview bridge mount"]
  node_previewbridge["Preview host bridge"]
  node_pwa["PWA middleware<br/>[grok-pwa.ts]"]
  node_pwahelpers["PWA response helpers"]
end

node_learner(("Learner"))
node_connector{{"Connector service"}}
node_embedder(("Grok preview host"))

node_learner -->|"uses"| node_portal
node_portal -->|"renders"| node_simulator
node_portal -->|"renders"| node_assessment
node_portal -->|"renders"| node_study
node_portal -->|"renders"| node_navigation
node_portal -->|"reads"| node_threats
node_study -->|"reads"| node_briefing
node_study -->|"reads and writes"| node_storage
node_root -->|"mounts"| node_auth
node_root -->|"mounts"| node_previewcomponent
node_previewcomponent -->|"installs"| node_previewbridge
node_previewbridge -->|"exchanges messages"| node_embedder
node_authclient -.->|"authenticates"| node_connector
node_appdata -->|"posts tool calls"| node_connector
node_pwa -->|"uses"| node_pwahelpers

click node_portal "https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/components/portal.tsx"
click node_simulator "https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/components/lab.tsx"
click node_assessment "https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/components/assess.tsx"
click node_study "https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/components/studio.tsx"
click node_navigation "https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/components/shell.tsx"
click node_briefing "https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/data/content.ts"
click node_threats "https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/data/portal.ts"
click node_auth "https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/lib/auth/provider.tsx"
click node_authclient "https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/lib/auth/client.ts"
click node_appdata "https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/lib/app-data/client.server.ts"
click node_root "https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/routes/__root.tsx"
click node_previewcomponent "https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/components/preview-host-bridge.tsx"
click node_previewbridge "https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/lib/preview-host-bridge.ts"
click node_pwa "https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/server/middleware/grok-pwa.ts"
click node_pwahelpers "https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/scripts/grok-pwa-shared.mjs"
click node_storage "https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/lib/storage.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_portal,node_simulator,node_assessment,node_study,node_navigation,node_embedder toneBlue
class node_briefing,node_threats toneAmber
class node_auth,node_authclient,node_appdata,node_storage toneMint
class node_root,node_previewcomponent,node_previewbridge,node_pwa,node_pwahelpers toneRose
class node_learner,node_connector toneIndigo
```

## Components

### Learning experience

- [Learning portal](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/components/portal.tsx): `src/components/portal.tsx`
- [Simulator lab](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/components/lab.tsx): `src/components/lab.tsx`
- [Assessments](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/components/assess.tsx): `src/components/assess.tsx`
- [Study studio](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/components/studio.tsx): `src/components/studio.tsx`
- [Site navigation](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/components/shell.tsx): `src/components/shell.tsx`

### Learning content

- [Briefing material](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/data/content.ts): `src/data/content.ts`
- [Threat guidance](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/data/portal.ts): `src/data/portal.ts`

### Identity and data

- [Authentication provider](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/lib/auth/provider.tsx): `src/lib/auth/provider.tsx`
- [Auth client](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/lib/auth/client.ts): `src/lib/auth/client.ts`
- [Connector app data](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/lib/app-data/client.server.ts): `src/lib/app-data/client.server.ts`
- [Browser storage](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/lib/storage.ts): `src/lib/storage.ts`

### Hosting and preview

- [Application root](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/routes/__root.tsx): `src/routes/__root.tsx`
- [Preview bridge mount](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/components/preview-host-bridge.tsx): `src/components/preview-host-bridge.tsx`
- [Preview host bridge](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/src/lib/preview-host-bridge.ts): `src/lib/preview-host-bridge.ts`
- [PWA middleware](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/server/middleware/grok-pwa.ts): `server/middleware/grok-pwa.ts`
- [PWA response helpers](https://github.com/mayur-anand-cys/crane-apple-otter-amber/blob/main/scripts/grok-pwa-shared.mjs): `scripts/grok-pwa-shared.mjs`

### Other components

- **Learner**
- **Connector service**
- **Grok preview host**

## Connections

- Learner → Learning portal: uses (evidence: `src/components/portal.tsx`)
- Learning portal → Simulator lab: renders (evidence: `src/components/portal.tsx`)
- Learning portal → Assessments: renders (evidence: `src/components/portal.tsx`)
- Learning portal → Study studio: renders (evidence: `src/components/portal.tsx`)
- Learning portal → Site navigation: renders (evidence: `src/components/portal.tsx`)
- Learning portal → Threat guidance: reads (evidence: `src/components/portal.tsx`)
- Study studio → Briefing material: reads (evidence: `src/components/studio.tsx`)
- Study studio → Browser storage: reads and writes (evidence: `src/components/studio.tsx`)
- Application root → Authentication provider: mounts (evidence: `src/routes/__root.tsx`)
- Application root → Preview bridge mount: mounts (evidence: `src/routes/__root.tsx`)
- Preview bridge mount → Preview host bridge: installs (evidence: `src/components/preview-host-bridge.tsx`)
- Preview host bridge → Grok preview host: exchanges messages (evidence: `src/lib/preview-host-bridge.ts`)
- Auth client → Connector service: authenticates
- Connector app data → Connector service: posts tool calls (evidence: `src/lib/app-data/client.server.ts`)
- PWA middleware → PWA response helpers: uses (evidence: `server/middleware/grok-pwa.ts`)
