# putrayana267-afk/superpowers architecture

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

- Interactive diagram: https://gitdiagram.com/putrayana267-afk/superpowers
- Repository: https://github.com/putrayana267-afk/superpowers

## Overview

Asisten Guru is an Indonesian teacher’s toolkit for generating teaching materials with AI, reviewing and exporting results, and managing saved work and preferences. The main flow runs from the app shell through tool selection and input, AI generation, result handling, and local persistence. The tree also shows dashboard, curriculum, question-bank, and time-zone capabilities. The supplied README describes a different product, so it is not used as evidence; links to serverless handlers are shown as unverified because their request wiring was not excerpted.

Main entry points: [`asisten-guru/src/App.tsx`](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/App.tsx) (App shell), [`asisten-guru/src/services/ai.ts`](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/services/ai.ts) (AI client), [`asisten-guru/src/components/Settings.tsx`](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/components/Settings.tsx) (Settings), [`asisten-guru/src/features/tools/bankSoal.ts`](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/features/tools/bankSoal.ts) (Question-bank format)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Teacher experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_home["Home dashboard<br/>[Beranda.tsx]"]
  node_main["Application bootstrap<br/>[main.tsx]"]
end

subgraph group_generation["Generation workflow"]
  node_toolform["Tool inputs<br/>[ToolForm.tsx]"]
  node_registry["Tool registry<br/>[registry.ts]"]
  node_curriculum["Curriculum data<br/>[kurikulum.ts]"]
  node_prompt["Prompt builder<br/>[promptBuilder.ts]"]
  node_ai["AI client<br/>[ai.ts]"]
  node_generate_api["Generate handler<br/>[generate.ts]"]
  node_suggest_api["Suggest handler<br/>[suggest.ts]"]
  node_bank["Question-bank format<br/>[bankSoal.ts]"]
  node_results["Result panel<br/>[ResultPanel.tsx]"]
end

subgraph group_library["Saved work"]
  node_history[("History<br/>[storage.ts]")]
  node_sqlite[("Offline generations<br/>[db.ts]")]
  node_library_view["Saved library<br/>[Perpustakaan.tsx]"]
end

subgraph group_preferences["Personalization"]
  node_settings["Settings<br/>[Settings.tsx]"]
  node_profile["Teacher profile<br/>[profil.ts]"]
  node_theme["Theme preferences<br/>[theme.ts]"]
  node_timezone["Time-zone selection<br/>[useZonaWaktu.ts]"]
  node_cities["Curated cities<br/>[kota.ts]"]
end

node_teacher(("Teacher"))
node_gemini{{"Google Gemini"}}

node_teacher -->|"uses"| node_app
node_main -->|"renders"| node_app
node_main -->|"initializes"| node_sqlite
node_app -->|"selects tools"| node_registry
node_app -->|"renders"| node_toolform
node_app -->|"shows dashboard"| node_home
node_registry -.->|"uses options"| node_curriculum
node_app -->|"requests generation"| node_ai
node_ai -->|"builds prompts"| node_prompt
node_ai -->|"builds question prompts"| node_bank
node_ai -->|"sends requests"| node_gemini
node_ai -.->|"may call proxy"| node_generate_api
node_ai -.->|"may call proxy"| node_suggest_api
node_app -->|"parses results"| node_bank
node_app -->|"renders results"| node_results
node_results -->|"renders question bank"| node_bank
node_app -->|"loads and saves"| node_history
node_app -->|"saves generations"| node_sqlite
node_app -.->|"shows saved work"| node_library_view
node_settings -->|"stores API key"| node_sqlite
node_settings -->|"loads and saves"| node_profile
node_settings -->|"loads and sets"| node_theme
node_settings -->|"configures"| node_timezone
node_timezone -->|"maps time zones"| node_cities

click node_app "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/App.tsx"
click node_home "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/components/Beranda.tsx"
click node_toolform "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/components/ToolForm.tsx"
click node_registry "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/features/tools/registry.ts"
click node_curriculum "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/data/kurikulum.ts"
click node_prompt "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/features/tools/promptBuilder.ts"
click node_ai "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/services/ai.ts"
click node_generate_api "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/api/generate.ts"
click node_suggest_api "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/api/suggest.ts"
click node_bank "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/features/tools/bankSoal.ts"
click node_results "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/components/ResultPanel.tsx"
click node_history "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/lib/storage.ts"
click node_sqlite "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/lib/db.ts"
click node_library_view "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/components/Perpustakaan.tsx"
click node_settings "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/components/Settings.tsx"
click node_profile "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/lib/profil.ts"
click node_theme "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/lib/theme.ts"
click node_timezone "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/features/waktu/useZonaWaktu.ts"
click node_cities "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/features/waktu/kota.ts"
click node_main "https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/main.tsx"

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_app,node_home,node_main toneBlue
class node_toolform,node_registry,node_curriculum,node_prompt,node_ai,node_generate_api,node_suggest_api,node_bank,node_results toneAmber
class node_history,node_sqlite,node_library_view toneMint
class node_settings,node_profile,node_theme,node_timezone,node_cities toneRose
class node_teacher,node_gemini toneIndigo
```

## Components

### Teacher experience

- [App shell](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/App.tsx): `asisten-guru/src/App.tsx`
- [Home dashboard](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/components/Beranda.tsx): `asisten-guru/src/components/Beranda.tsx`
- [Application bootstrap](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/main.tsx): `asisten-guru/src/main.tsx`

### Generation workflow

- [Tool inputs](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/components/ToolForm.tsx): `asisten-guru/src/components/ToolForm.tsx`
- [Tool registry](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/features/tools/registry.ts): `asisten-guru/src/features/tools/registry.ts`
- [Curriculum data](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/data/kurikulum.ts): `asisten-guru/src/data/kurikulum.ts`
- [Prompt builder](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/features/tools/promptBuilder.ts): `asisten-guru/src/features/tools/promptBuilder.ts`
- [AI client](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/services/ai.ts): `asisten-guru/src/services/ai.ts`
- [Generate handler](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/api/generate.ts): `asisten-guru/api/generate.ts`
- [Suggest handler](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/api/suggest.ts): `asisten-guru/api/suggest.ts`
- [Question-bank format](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/features/tools/bankSoal.ts): `asisten-guru/src/features/tools/bankSoal.ts`
- [Result panel](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/components/ResultPanel.tsx): `asisten-guru/src/components/ResultPanel.tsx`

### Saved work

- [History](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/lib/storage.ts): `asisten-guru/src/lib/storage.ts`
- [Offline generations](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/lib/db.ts): `asisten-guru/src/lib/db.ts`
- [Saved library](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/components/Perpustakaan.tsx): `asisten-guru/src/components/Perpustakaan.tsx`

### Personalization

- [Settings](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/components/Settings.tsx): `asisten-guru/src/components/Settings.tsx`
- [Teacher profile](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/lib/profil.ts): `asisten-guru/src/lib/profil.ts`
- [Theme preferences](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/lib/theme.ts): `asisten-guru/src/lib/theme.ts`
- [Time-zone selection](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/features/waktu/useZonaWaktu.ts): `asisten-guru/src/features/waktu/useZonaWaktu.ts`
- [Curated cities](https://github.com/putrayana267-afk/superpowers/blob/main/asisten-guru/src/features/waktu/kota.ts): `asisten-guru/src/features/waktu/kota.ts`

### Other components

- **Teacher**
- **Google Gemini**

## Connections

- Teacher → App shell: uses
- Application bootstrap → App shell: renders (evidence: `asisten-guru/src/main.tsx`)
- Application bootstrap → Offline generations: initializes (evidence: `asisten-guru/src/main.tsx`)
- App shell → Tool registry: selects tools (evidence: `asisten-guru/src/App.tsx`)
- App shell → Tool inputs: renders (evidence: `asisten-guru/src/App.tsx`)
- App shell → Home dashboard: shows dashboard (evidence: `asisten-guru/src/components/Beranda.tsx`)
- Tool registry → Curriculum data: uses options
- App shell → AI client: requests generation (evidence: `asisten-guru/src/App.tsx`)
- AI client → Prompt builder: builds prompts (evidence: `asisten-guru/src/services/ai.ts`)
- AI client → Question-bank format: builds question prompts (evidence: `asisten-guru/src/services/ai.ts`)
- AI client → Google Gemini: sends requests (evidence: `asisten-guru/src/services/ai.ts`)
- AI client → Generate handler: may call proxy
- AI client → Suggest handler: may call proxy
- App shell → Question-bank format: parses results (evidence: `asisten-guru/src/App.tsx`)
- App shell → Result panel: renders results (evidence: `asisten-guru/src/components/ResultPanel.tsx`)
- Result panel → Question-bank format: renders question bank (evidence: `asisten-guru/src/components/ResultPanel.tsx`)
- App shell → History: loads and saves (evidence: `asisten-guru/src/App.tsx`)
- App shell → Offline generations: saves generations (evidence: `asisten-guru/src/App.tsx`)
- App shell → Saved library: shows saved work (evidence: `asisten-guru/src/App.tsx`)
- Settings → Offline generations: stores API key (evidence: `asisten-guru/src/components/Settings.tsx`)
- Settings → Teacher profile: loads and saves (evidence: `asisten-guru/src/components/Settings.tsx`)
- Settings → Theme preferences: loads and sets (evidence: `asisten-guru/src/components/Settings.tsx`)
- Settings → Time-zone selection: configures (evidence: `asisten-guru/src/components/Settings.tsx`)
- Time-zone selection → Curated cities: maps time zones (evidence: `asisten-guru/src/features/waktu/useZonaWaktu.ts`)
