# allylearning/eicoach architecture

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

- Interactive diagram: https://gitdiagram.com/allylearning/eicoach
- Repository: https://github.com/allylearning/eicoach

## Overview

EIcoach is a browser-based emotional-intelligence coaching experience. A user works through a sequence of athlete-focused reflection prompts, submits a response for AI-generated feedback, then proceeds or retries. The page owns that interaction and calls the server feedback flow; the flow builds the coaching prompt and uses the configured Genkit/Gemini model, with a fallback response on failure. The graph also preserves substantial shared UI modules. Evidence is limited to the README and sampled source/SOURCE INDEX references; unsampled modules are not assigned unverified runtime relationships.

Main entry points: [`src/app/page.tsx`](https://github.com/allylearning/eicoach/blob/main/src/app/page.tsx) (Prompt session), [`src/components/ui/sidebar.tsx`](https://github.com/allylearning/eicoach/blob/main/src/components/ui/sidebar.tsx) (Sidebar components), [`src/components/ui/button.tsx`](https://github.com/allylearning/eicoach/blob/main/src/components/ui/button.tsx) (Button), [`src/lib/utils.ts`](https://github.com/allylearning/eicoach/blob/main/src/lib/utils.ts) (Class utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Coaching experience"]
  node_session["Prompt session<br/>[page.tsx]"]
  node_layout["App layout<br/>[layout.tsx]"]
end

subgraph group_ai["AI feedback"]
  node_feedback["Feedback flow"]
  node_genkit["Genkit model setup<br/>[ai-instance.ts]"]
end

subgraph group_interface["Shared interface"]
  node_button["Button<br/>[button.tsx]"]
  node_card["Card<br/>[card.tsx]"]
  node_input["Input<br/>[input.tsx]"]
  node_textarea["Textarea<br/>[textarea.tsx]"]
  node_chart["Chart components<br/>[chart.tsx]"]
  node_sidebar["Sidebar components<br/>[sidebar.tsx]"]
  node_mobile["Mobile detection<br/>[use-mobile.tsx]"]
  node_sheet["Sheet components<br/>[sheet.tsx]"]
  node_tooltip["Tooltip components<br/>[tooltip.tsx]"]
  node_skeleton["Skeleton<br/>[skeleton.tsx]"]
  node_separator["Separator<br/>[separator.tsx]"]
  node_toastui["Toast primitives<br/>[toast.tsx]"]
  node_toaststate["Toast state<br/>[use-toast.ts]"]
  node_styling["Class utilities<br/>[utils.ts]"]
end

node_athlete(("Athlete"))
node_gemini{{"Google Gemini"}}

node_athlete -->|"uses"| node_session
node_session -->|"requests feedback"| node_feedback
node_feedback -->|"generates with"| node_genkit
node_genkit -->|"configures model"| node_gemini
node_session -->|"renders"| node_button
node_session -->|"renders"| node_card
node_session -->|"renders"| node_input
node_session -->|"renders"| node_textarea
node_sidebar -->|"checks viewport"| node_mobile
node_sidebar -->|"uses on mobile"| node_sheet
node_sidebar -->|"renders"| node_tooltip
node_sidebar -->|"uses"| node_button
node_toaststate -->|"manages toast state"| node_toastui
node_chart -->|"merges classes"| node_styling
node_sidebar -->|"merges classes"| node_styling
node_button -->|"merges classes"| node_styling

click node_session "https://github.com/allylearning/eicoach/blob/main/src/app/page.tsx"
click node_feedback "https://github.com/allylearning/eicoach/blob/main/src/ai/flows/generate-feedback.ts"
click node_genkit "https://github.com/allylearning/eicoach/blob/main/src/ai/ai-instance.ts"
click node_layout "https://github.com/allylearning/eicoach/blob/main/src/app/layout.tsx"
click node_button "https://github.com/allylearning/eicoach/blob/main/src/components/ui/button.tsx"
click node_card "https://github.com/allylearning/eicoach/blob/main/src/components/ui/card.tsx"
click node_input "https://github.com/allylearning/eicoach/blob/main/src/components/ui/input.tsx"
click node_textarea "https://github.com/allylearning/eicoach/blob/main/src/components/ui/textarea.tsx"
click node_chart "https://github.com/allylearning/eicoach/blob/main/src/components/ui/chart.tsx"
click node_sidebar "https://github.com/allylearning/eicoach/blob/main/src/components/ui/sidebar.tsx"
click node_mobile "https://github.com/allylearning/eicoach/blob/main/src/hooks/use-mobile.tsx"
click node_sheet "https://github.com/allylearning/eicoach/blob/main/src/components/ui/sheet.tsx"
click node_tooltip "https://github.com/allylearning/eicoach/blob/main/src/components/ui/tooltip.tsx"
click node_skeleton "https://github.com/allylearning/eicoach/blob/main/src/components/ui/skeleton.tsx"
click node_separator "https://github.com/allylearning/eicoach/blob/main/src/components/ui/separator.tsx"
click node_toastui "https://github.com/allylearning/eicoach/blob/main/src/components/ui/toast.tsx"
click node_toaststate "https://github.com/allylearning/eicoach/blob/main/src/hooks/use-toast.ts"
click node_styling "https://github.com/allylearning/eicoach/blob/main/src/lib/utils.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_session,node_layout toneBlue
class node_feedback,node_genkit toneAmber
class node_button,node_card,node_input,node_textarea,node_chart,node_sidebar,node_mobile,node_sheet,node_tooltip,node_skeleton,node_separator,node_toastui,node_toaststate,node_styling toneMint
class node_athlete,node_gemini toneIndigo
```

## Components

### Coaching experience

- [Prompt session](https://github.com/allylearning/eicoach/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [App layout](https://github.com/allylearning/eicoach/blob/main/src/app/layout.tsx): `src/app/layout.tsx`

### AI feedback

- [Feedback flow](https://github.com/allylearning/eicoach/blob/main/src/ai/flows/generate-feedback.ts): `src/ai/flows/generate-feedback.ts`
- [Genkit model setup](https://github.com/allylearning/eicoach/blob/main/src/ai/ai-instance.ts): `src/ai/ai-instance.ts`

### Shared interface

- [Button](https://github.com/allylearning/eicoach/blob/main/src/components/ui/button.tsx): `src/components/ui/button.tsx`
- [Card](https://github.com/allylearning/eicoach/blob/main/src/components/ui/card.tsx): `src/components/ui/card.tsx`
- [Input](https://github.com/allylearning/eicoach/blob/main/src/components/ui/input.tsx): `src/components/ui/input.tsx`
- [Textarea](https://github.com/allylearning/eicoach/blob/main/src/components/ui/textarea.tsx): `src/components/ui/textarea.tsx`
- [Chart components](https://github.com/allylearning/eicoach/blob/main/src/components/ui/chart.tsx): `src/components/ui/chart.tsx`
- [Sidebar components](https://github.com/allylearning/eicoach/blob/main/src/components/ui/sidebar.tsx): `src/components/ui/sidebar.tsx`
- [Mobile detection](https://github.com/allylearning/eicoach/blob/main/src/hooks/use-mobile.tsx): `src/hooks/use-mobile.tsx`
- [Sheet components](https://github.com/allylearning/eicoach/blob/main/src/components/ui/sheet.tsx): `src/components/ui/sheet.tsx`
- [Tooltip components](https://github.com/allylearning/eicoach/blob/main/src/components/ui/tooltip.tsx): `src/components/ui/tooltip.tsx`
- [Skeleton](https://github.com/allylearning/eicoach/blob/main/src/components/ui/skeleton.tsx): `src/components/ui/skeleton.tsx`
- [Separator](https://github.com/allylearning/eicoach/blob/main/src/components/ui/separator.tsx): `src/components/ui/separator.tsx`
- [Toast primitives](https://github.com/allylearning/eicoach/blob/main/src/components/ui/toast.tsx): `src/components/ui/toast.tsx`
- [Toast state](https://github.com/allylearning/eicoach/blob/main/src/hooks/use-toast.ts): `src/hooks/use-toast.ts`
- [Class utilities](https://github.com/allylearning/eicoach/blob/main/src/lib/utils.ts): `src/lib/utils.ts`

### Other components

- **Athlete**
- **Google Gemini**

## Connections

- Athlete → Prompt session: uses
- Prompt session → Feedback flow: requests feedback (evidence: `src/app/page.tsx`)
- Feedback flow → Genkit model setup: generates with (evidence: `src/ai/flows/generate-feedback.ts`)
- Genkit model setup → Google Gemini: configures model (evidence: `src/ai/ai-instance.ts`)
- Prompt session → Button: renders (evidence: `src/app/page.tsx`)
- Prompt session → Card: renders (evidence: `src/app/page.tsx`)
- Prompt session → Input: renders (evidence: `src/app/page.tsx`)
- Prompt session → Textarea: renders (evidence: `src/app/page.tsx`)
- Sidebar components → Mobile detection: checks viewport (evidence: `src/components/ui/sidebar.tsx`)
- Sidebar components → Sheet components: uses on mobile (evidence: `src/components/ui/sidebar.tsx`)
- Sidebar components → Tooltip components: renders (evidence: `src/components/ui/sidebar.tsx`)
- Sidebar components → Button: uses (evidence: `src/components/ui/sidebar.tsx`)
- Toast state → Toast primitives: manages toast state (evidence: `src/hooks/use-toast.ts`)
- Chart components → Class utilities: merges classes (evidence: `src/components/ui/chart.tsx`)
- Sidebar components → Class utilities: merges classes (evidence: `src/components/ui/sidebar.tsx`)
- Button → Class utilities: merges classes (evidence: `src/components/ui/button.tsx`)
