# symmetry7/algogym architecture

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

- Interactive diagram: https://gitdiagram.com/symmetry7/algogym
- Repository: https://github.com/symmetry7/algogym

## Overview

AlgoGym is a competitive-programming learning workspace: users browse practice and learning content, connect coding profiles, and track progress and rewards. Its Next.js application serves the product and API surface; Supabase supplies identity and persisted data, with provider APIs and Gemini supporting documented integrations. The graph also preserves interview preparation, communities, rankings, and billing as product areas. Evidence is limited to the README and sampled/indexed files; unsampled subsystems are represented at supported directory paths, without guessed call links.

Main entry points: [`apps/web/src/app/api/[...path]/route.ts`](https://github.com/symmetry7/algogym/blob/main/apps/web/src/app/api/%5B...path%5D/route.ts) (API dispatch), [`apps/web/src/app`](https://github.com/symmetry7/algogym/tree/main/apps/web/src/app) (Next.js app), [`apps/web/server/problem-catalog.ts`](https://github.com/symmetry7/algogym/blob/main/apps/web/server/problem-catalog.ts) (Problem catalog), [`apps/web/src/app/problems/(list)/page.tsx`](https://github.com/symmetry7/algogym/blob/main/apps/web/src/app/problems/(list)/page.tsx) (Training gym)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_web["Next.js app"]
  node_api["API dispatch<br/>[route.ts]"]
end

subgraph group_practice["Practice and learning"]
  node_catalog[("Problem catalog<br/>[problem-catalog.ts]")]
  node_training["Training gym<br/>[page.tsx]"]
  node_systemdesign["System design"]
  node_ai["Symm AI learning"]
  node_interview["Interview prep<br/>[interview-items.ts]"]
  node_gemini{{"Gemini API"}}
end

subgraph group_identity["Identity and progress"]
  node_verification["Profile verification<br/>[index.ts]"]
  node_progress["Progress analytics"]
  node_supabase[("Supabase")]
  node_providers{{"Coding providers"}}
end

subgraph group_engagement["Community and commerce"]
  node_communities["Communities and rankings"]
  node_billing["Billing and rewards<br/>[billing.ts]"]
end

subgraph group_execution["Code execution"]
  node_judge["Judge generation<br/>[generate.mjs]"]
  node_engine["Judge queue API<br/>[app.ts]"]
end

node_user(("Learner"))

node_user -->|"uses"| node_web
node_web -->|"dispatches"| node_api
node_training -->|"loads catalog"| node_catalog
node_catalog -->|"reads data"| node_supabase
node_verification -->|"checks profiles"| node_providers
node_api -->|"uses data and identity"| node_supabase
node_api -->|"integrates"| node_providers
node_api -->|"requests AI"| node_gemini
node_judge -.->|"supplies harnesses"| node_engine

click node_web "https://github.com/symmetry7/algogym/tree/main/apps/web/src/app"
click node_api "https://github.com/symmetry7/algogym/blob/main/apps/web/src/app/api/%5B...path%5D/route.ts"
click node_catalog "https://github.com/symmetry7/algogym/blob/main/apps/web/server/problem-catalog.ts"
click node_training "https://github.com/symmetry7/algogym/blob/main/apps/web/src/app/problems/(list)/page.tsx"
click node_systemdesign "https://github.com/symmetry7/algogym/tree/main/apps/web/src/app/system-design"
click node_ai "https://github.com/symmetry7/algogym/tree/main/apps/web/server"
click node_interview "https://github.com/symmetry7/algogym/blob/main/apps/web/server/interview-items.ts"
click node_verification "https://github.com/symmetry7/algogym/blob/main/supabase/functions/profile-verification/index.ts"
click node_progress "https://github.com/symmetry7/algogym/blob/main/apps/web/server/learning-progress.ts"
click node_communities "https://github.com/symmetry7/algogym/tree/main/apps/web/server"
click node_billing "https://github.com/symmetry7/algogym/blob/main/apps/web/server/billing.ts"
click node_judge "https://github.com/symmetry7/algogym/blob/main/packages/judge/src/generate.mjs"
click node_engine "https://github.com/symmetry7/algogym/blob/main/apps/engine/src/app.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_web,node_api toneBlue
class node_catalog,node_training,node_systemdesign,node_ai,node_interview,node_gemini toneAmber
class node_verification,node_progress,node_supabase,node_providers toneMint
class node_communities,node_billing toneRose
class node_judge,node_engine,node_user toneIndigo
```

## Components

### Web experience

- [Next.js app](https://github.com/symmetry7/algogym/tree/main/apps/web/src/app): `apps/web/src/app`
- [API dispatch](https://github.com/symmetry7/algogym/blob/main/apps/web/src/app/api/%5B...path%5D/route.ts): `apps/web/src/app/api/[...path]/route.ts`

### Practice and learning

- [Problem catalog](https://github.com/symmetry7/algogym/blob/main/apps/web/server/problem-catalog.ts): `apps/web/server/problem-catalog.ts`
- [Training gym](https://github.com/symmetry7/algogym/blob/main/apps/web/src/app/problems/(list)/page.tsx): `apps/web/src/app/problems/(list)/page.tsx`
- [System design](https://github.com/symmetry7/algogym/tree/main/apps/web/src/app/system-design): `apps/web/src/app/system-design`
- [Symm AI learning](https://github.com/symmetry7/algogym/tree/main/apps/web/server): `apps/web/server`
- [Interview prep](https://github.com/symmetry7/algogym/blob/main/apps/web/server/interview-items.ts): `apps/web/server/interview-items.ts`
- **Gemini API**

### Identity and progress

- [Profile verification](https://github.com/symmetry7/algogym/blob/main/supabase/functions/profile-verification/index.ts): `supabase/functions/profile-verification/index.ts`
- [Progress analytics](https://github.com/symmetry7/algogym/blob/main/apps/web/server/learning-progress.ts): `apps/web/server/learning-progress.ts`
- **Supabase**
- **Coding providers**

### Community and commerce

- [Communities and rankings](https://github.com/symmetry7/algogym/tree/main/apps/web/server): `apps/web/server`
- [Billing and rewards](https://github.com/symmetry7/algogym/blob/main/apps/web/server/billing.ts): `apps/web/server/billing.ts`

### Code execution

- [Judge generation](https://github.com/symmetry7/algogym/blob/main/packages/judge/src/generate.mjs): `packages/judge/src/generate.mjs`
- [Judge queue API](https://github.com/symmetry7/algogym/blob/main/apps/engine/src/app.ts): `apps/engine/src/app.ts`

### Other components

- **Learner**

## Connections

- Learner → Next.js app: uses (evidence: `README.md`)
- Next.js app → API dispatch: dispatches (evidence: `README.md`)
- Training gym → Problem catalog: loads catalog (evidence: `apps/web/src/app/problems/(list)/page.tsx`)
- Problem catalog → Supabase: reads data (evidence: `apps/web/server/problem-catalog.ts`)
- Profile verification → Coding providers: checks profiles (evidence: `supabase/functions/profile-verification/index.ts`)
- API dispatch → Supabase: uses data and identity (evidence: `README.md`)
- API dispatch → Coding providers: integrates (evidence: `README.md`)
- API dispatch → Gemini API: requests AI (evidence: `README.md`)
- Judge generation → Judge queue API: supplies harnesses
