# riyapchaudhari2006-wq/gdg-predev architecture

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

- Interactive diagram: https://gitdiagram.com/riyapchaudhari2006-wq/gdg-predev
- Repository: https://github.com/riyapchaudhari2006-wq/gdg-predev

## Overview

Code Roaster is a web app for submitting code for an AI critique and corrected version. The main workflow is to edit code, choose a language, roast level and persona, optionally add an error message, request analysis, then review issues and apply or copy the proposed fix. The sampled sources show the workspace coordinating the UI and the Gemini analysis implementation. The API route and request client are present in the tree, but their connection is not verified by the supplied excerpts; those links are marked unverified. README provides no further capability details.

Main entry points: [`code-roaster/components/Workspace.tsx`](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/Workspace.tsx) (Workspace), [`code-roaster/components/RoastReport.tsx`](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/RoastReport.tsx) (Roast report), [`code-roaster/lib/gemini.ts`](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/lib/gemini.ts) (Gemini analysis), [`code-roaster/lib/api.ts`](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/lib/api.ts) (Roast API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Roasting workspace"]
  node_workspace_ui["Workspace<br/>[Workspace.tsx]"]
end

subgraph group_presentation["Input and report UI"]
  node_roast_controls["Roast controls<br/>[RoastControls.tsx]"]
  node_code_editor["Code editor<br/>[CodeEditor.tsx]"]
  node_error_input["Error context"]
  node_roast_report["Roast report<br/>[RoastReport.tsx]"]
  node_issue_card["Issue card<br/>[IssueCard.tsx]"]
  node_fixed_code["Corrected code<br/>[FixedCode.tsx]"]
  node_section_header["Section header<br/>[SectionHeader.tsx]"]
  node_empty_state["Empty state<br/>[EmptyState.tsx]"]
  node_loading_state["Loading state<br/>[LoadingState.tsx]"]
  node_error_state["Error state<br/>[ErrorState.tsx]"]
  node_top_bar["Top bar<br/>[TopBar.tsx]"]
  node_status_bar["Status bar<br/>[StatusBar.tsx]"]
  node_rangoli_strip["Rangoli strip<br/>[RangoliStrip.tsx]"]
end

subgraph group_service["Analysis service"]
  node_api_client["Roast API client<br/>[api.ts]"]
  node_roast_endpoint["Roast endpoint<br/>[route.ts]"]
  node_analysis["Gemini analysis<br/>[gemini.ts]"]
end

subgraph group_contracts["Analysis definitions"]
  node_prompt_builder["Prompt builder<br/>[prompt.ts]"]
  node_response_schema["Response schema<br/>[schema.ts]"]
  node_app_config["App configuration<br/>[app.config.ts]"]
end

node_developer(("Code author"))
node_google_gemini["Google Gemini"]

node_developer -->|"edits and submits"| node_workspace_ui
node_workspace_ui -->|"renders"| node_roast_controls
node_workspace_ui -->|"renders"| node_code_editor
node_workspace_ui -->|"renders"| node_error_input
node_workspace_ui -->|"renders"| node_roast_report
node_workspace_ui -->|"renders"| node_top_bar
node_workspace_ui -->|"renders"| node_status_bar
node_workspace_ui -->|"renders"| node_rangoli_strip
node_workspace_ui -->|"requests roast"| node_api_client
node_roast_report -->|"renders issues"| node_issue_card
node_roast_report -->|"renders fix"| node_fixed_code
node_roast_report -->|"renders sections"| node_section_header
node_roast_report -->|"renders empty"| node_empty_state
node_roast_report -->|"renders loading"| node_loading_state
node_roast_report -->|"renders error"| node_error_state
node_api_client -.->|"sends request"| node_roast_endpoint
node_roast_endpoint -.->|"invokes analysis"| node_analysis
node_analysis -->|"builds prompt"| node_prompt_builder
node_analysis -->|"sets response schema"| node_response_schema
node_analysis -->|"reads AI settings"| node_app_config
node_analysis -->|"generates content"| node_google_gemini

click node_workspace_ui "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/Workspace.tsx"
click node_roast_controls "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/RoastControls.tsx"
click node_code_editor "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/CodeEditor.tsx"
click node_error_input "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/ErrorMessageInput.tsx"
click node_roast_report "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/RoastReport.tsx"
click node_issue_card "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/IssueCard.tsx"
click node_fixed_code "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/FixedCode.tsx"
click node_section_header "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/SectionHeader.tsx"
click node_empty_state "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/EmptyState.tsx"
click node_loading_state "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/LoadingState.tsx"
click node_error_state "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/ErrorState.tsx"
click node_top_bar "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/TopBar.tsx"
click node_status_bar "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/StatusBar.tsx"
click node_rangoli_strip "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/RangoliStrip.tsx"
click node_api_client "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/lib/api.ts"
click node_roast_endpoint "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/app/api/roast/route.ts"
click node_analysis "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/lib/gemini.ts"
click node_prompt_builder "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/lib/prompt.ts"
click node_response_schema "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/lib/schema.ts"
click node_app_config "https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/config/app.config.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_workspace_ui toneBlue
class node_roast_controls,node_code_editor,node_error_input,node_roast_report,node_issue_card,node_fixed_code,node_section_header,node_empty_state,node_loading_state,node_error_state,node_top_bar,node_status_bar,node_rangoli_strip toneAmber
class node_api_client,node_roast_endpoint,node_analysis toneMint
class node_prompt_builder,node_response_schema,node_app_config toneRose
class node_developer,node_google_gemini toneIndigo
```

## Components

### Roasting workspace

- [Workspace](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/Workspace.tsx): `code-roaster/components/Workspace.tsx`

### Input and report UI

- [Roast controls](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/RoastControls.tsx): `code-roaster/components/RoastControls.tsx`
- [Code editor](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/CodeEditor.tsx): `code-roaster/components/CodeEditor.tsx`
- [Error context](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/ErrorMessageInput.tsx): `code-roaster/components/ErrorMessageInput.tsx`
- [Roast report](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/RoastReport.tsx): `code-roaster/components/RoastReport.tsx`
- [Issue card](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/IssueCard.tsx): `code-roaster/components/IssueCard.tsx`
- [Corrected code](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/FixedCode.tsx): `code-roaster/components/FixedCode.tsx`
- [Section header](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/SectionHeader.tsx): `code-roaster/components/SectionHeader.tsx`
- [Empty state](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/EmptyState.tsx): `code-roaster/components/EmptyState.tsx`
- [Loading state](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/LoadingState.tsx): `code-roaster/components/LoadingState.tsx`
- [Error state](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/ErrorState.tsx): `code-roaster/components/ErrorState.tsx`
- [Top bar](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/TopBar.tsx): `code-roaster/components/TopBar.tsx`
- [Status bar](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/StatusBar.tsx): `code-roaster/components/StatusBar.tsx`
- [Rangoli strip](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/components/RangoliStrip.tsx): `code-roaster/components/RangoliStrip.tsx`

### Analysis service

- [Roast API client](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/lib/api.ts): `code-roaster/lib/api.ts`
- [Roast endpoint](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/app/api/roast/route.ts): `code-roaster/app/api/roast/route.ts`
- [Gemini analysis](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/lib/gemini.ts): `code-roaster/lib/gemini.ts`

### Analysis definitions

- [Prompt builder](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/lib/prompt.ts): `code-roaster/lib/prompt.ts`
- [Response schema](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/lib/schema.ts): `code-roaster/lib/schema.ts`
- [App configuration](https://github.com/riyapchaudhari2006-wq/gdg-predev/blob/main/code-roaster/config/app.config.ts): `code-roaster/config/app.config.ts`

### Other components

- **Code author**
- **Google Gemini**

## Connections

- Code author → Workspace: edits and submits (evidence: `code-roaster/components/Workspace.tsx`)
- Workspace → Roast controls: renders (evidence: `code-roaster/components/Workspace.tsx`)
- Workspace → Code editor: renders (evidence: `code-roaster/components/Workspace.tsx`)
- Workspace → Error context: renders (evidence: `code-roaster/components/Workspace.tsx`)
- Workspace → Roast report: renders (evidence: `code-roaster/components/Workspace.tsx`)
- Workspace → Top bar: renders (evidence: `code-roaster/components/Workspace.tsx`)
- Workspace → Status bar: renders (evidence: `code-roaster/components/Workspace.tsx`)
- Workspace → Rangoli strip: renders (evidence: `code-roaster/components/Workspace.tsx`)
- Workspace → Roast API client: requests roast (evidence: `code-roaster/components/Workspace.tsx`)
- Roast report → Issue card: renders issues (evidence: `code-roaster/components/RoastReport.tsx`)
- Roast report → Corrected code: renders fix (evidence: `code-roaster/components/RoastReport.tsx`)
- Roast report → Section header: renders sections (evidence: `code-roaster/components/RoastReport.tsx`)
- Roast report → Empty state: renders empty (evidence: `code-roaster/components/RoastReport.tsx`)
- Roast report → Loading state: renders loading (evidence: `code-roaster/components/RoastReport.tsx`)
- Roast report → Error state: renders error (evidence: `code-roaster/components/RoastReport.tsx`)
- Roast API client → Roast endpoint: sends request
- Roast endpoint → Gemini analysis: invokes analysis
- Gemini analysis → Prompt builder: builds prompt (evidence: `code-roaster/lib/gemini.ts`)
- Gemini analysis → Response schema: sets response schema (evidence: `code-roaster/lib/gemini.ts`)
- Gemini analysis → App configuration: reads AI settings (evidence: `code-roaster/lib/gemini.ts`)
- Gemini analysis → Google Gemini: generates content (evidence: `code-roaster/lib/gemini.ts`)
