# eseddah/ichc-ghana architecture

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

- Interactive diagram: https://gitdiagram.com/eseddah/ichc-ghana
- Repository: https://github.com/eseddah/ichc-ghana

## Overview

This repository appears to combine an International Chemistry Competition assessment portal with an applicant intake flow. The visible assessment sign-in page verifies users with reCAPTCHA, starts Google sign-in, and redirects authenticated sessions toward a quiz; the portal also supports configurable AI exam generation. Separately, an application endpoint verifies reCAPTCHA server-side and stores applicant records in Supabase. The tree includes other pages and duplicate-looking files whose behavior was not sampled, so their relationships are not inferred.

Main entry points: [`index.js`](https://github.com/eseddah/ichc-ghana/blob/main/index.js) (Assessment sign-in), [`index.ts`](https://github.com/eseddah/ichc-ghana/blob/main/index.ts) (Application handler), [`api/generate-exam.js`](https://github.com/eseddah/ichc-ghana/blob/main/api/generate-exam.js) (Exam generator API), [`apply.html`](https://github.com/eseddah/ichc-ghana/blob/main/apply.html) (Application page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_assessment["Assessment access"]
  node_signin["Assessment sign-in<br/>[index.js]"]
  node_quiz["Quiz destination"]
end

subgraph group_exam["Exam authoring"]
  node_portal["Exam portal<br/>[portal.html]"]
  node_generator["Exam generator API<br/>[generate-exam.js]"]
end

subgraph group_applications["Applicant intake"]
  node_applicationform["Application page<br/>[apply.html]"]
  node_submit["Application handler<br/>[index.ts]"]
  node_supabase[("Supabase KV store")]
end

subgraph group_integrations["External services"]
  node_recaptcha["reCAPTCHA widget"]
  node_googleauth["Google sign-in"]
  node_anthropic["Anthropic API"]
  node_googleverify["Google verification"]
  node_pushworker["Push service worker"]
  node_onesignal["OneSignal SDK"]
end

node_student(("Student"))
node_applicant(("Applicant"))

node_student -->|"opens"| node_signin
node_signin -->|"loads widget"| node_recaptcha
node_signin -->|"starts sign-in"| node_googleauth
node_signin -->|"redirects after auth"| node_quiz
node_applicant -.->|"submits"| node_applicationform
node_applicationform -->|"calls handler"| node_submit
node_submit -->|"verifies token"| node_googleverify
node_submit -->|"reads and writes"| node_supabase
node_portal -->|"requests exam"| node_generator
node_generator -->|"generates content"| node_anthropic
node_pushworker -->|"imports SDK"| node_onesignal

click node_signin "https://github.com/eseddah/ichc-ghana/blob/main/index.js"
click node_portal "https://github.com/eseddah/ichc-ghana/blob/main/portal.html"
click node_generator "https://github.com/eseddah/ichc-ghana/blob/main/api/generate-exam.js"
click node_applicationform "https://github.com/eseddah/ichc-ghana/blob/main/apply.html"
click node_submit "https://github.com/eseddah/ichc-ghana/blob/main/index.ts"
click node_pushworker "https://github.com/eseddah/ichc-ghana/blob/main/OneSignalSDKWorker.js"

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_signin,node_quiz toneBlue
class node_portal,node_generator toneAmber
class node_applicationform,node_submit,node_supabase toneMint
class node_recaptcha,node_googleauth,node_anthropic,node_googleverify,node_pushworker,node_onesignal toneRose
class node_student,node_applicant toneIndigo
```

## Components

### Assessment access

- [Assessment sign-in](https://github.com/eseddah/ichc-ghana/blob/main/index.js): `index.js`
- **Quiz destination**

### Exam authoring

- [Exam portal](https://github.com/eseddah/ichc-ghana/blob/main/portal.html): `portal.html`
- [Exam generator API](https://github.com/eseddah/ichc-ghana/blob/main/api/generate-exam.js): `api/generate-exam.js`

### Applicant intake

- [Application page](https://github.com/eseddah/ichc-ghana/blob/main/apply.html): `apply.html`
- [Application handler](https://github.com/eseddah/ichc-ghana/blob/main/index.ts): `index.ts`
- **Supabase KV store**

### External services

- **reCAPTCHA widget**
- **Google sign-in**
- **Anthropic API**
- **Google verification**
- [Push service worker](https://github.com/eseddah/ichc-ghana/blob/main/OneSignalSDKWorker.js): `OneSignalSDKWorker.js`
- **OneSignal SDK**

### Other components

- **Student**
- **Applicant**

## Connections

- Student → Assessment sign-in: opens (evidence: `index.js`)
- Assessment sign-in → reCAPTCHA widget: loads widget (evidence: `index.js`)
- Assessment sign-in → Google sign-in: starts sign-in (evidence: `index.js`)
- Assessment sign-in → Quiz destination: redirects after auth (evidence: `index.js`)
- Applicant → Application page: submits
- Application page → Application handler: calls handler (evidence: `index.ts`)
- Application handler → Google verification: verifies token (evidence: `index.ts`)
- Application handler → Supabase KV store: reads and writes (evidence: `index.ts`)
- Exam portal → Exam generator API: requests exam
- Exam generator API → Anthropic API: generates content (evidence: `api/generate-exam.js`)
- Push service worker → OneSignal SDK: imports SDK (evidence: `OneSignalSDKWorker.js`)
