# nastaso/cloudcertprep architecture

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

- Interactive diagram: https://gitdiagram.com/nastaso/cloudcertprep
- Repository: https://github.com/nastaso/cloudcertprep

## Overview

CloudCertPrep is an Astro static site with hydrated React islands for AWS certification preparation. Learners choose a certification, practice by domain or take a timed mock exam, review results, and—if signed in—save progress and view history; the README also describes community statistics and adaptive spaced repetition. Bundled question data supports guest practice without Supabase. The graph combines sampled call/reference evidence with explicitly documented README flows; unsampled page implementations are represented only at their listed paths.

Main entry points: [`src/pages/_DomainPractice.tsx`](https://github.com/nastaso/cloudcertprep/blob/main/src/pages/_DomainPractice.tsx) (Domain practice), [`src/hooks/useAuth.ts`](https://github.com/nastaso/cloudcertprep/blob/main/src/hooks/useAuth.ts) (Authentication state), [`src/pages/_MockExam.tsx`](https://github.com/nastaso/cloudcertprep/blob/main/src/pages/_MockExam.tsx) (Timed mock exam), [`src/data/questions.ts`](https://github.com/nastaso/cloudcertprep/blob/main/src/data/questions.ts) (Question loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Practice and exams"]
  node_domain_practice["Domain practice"]
  node_mock_exam["Timed mock exam<br/>[_MockExam.tsx]"]
  node_review["Question review"]
  node_answer_inputs["Answer inputs<br/>[MatchingInput.tsx]"]
  node_scoring["Exam scoring<br/>[scoring.ts]"]
end

subgraph group_identity["Identity and persistence"]
  node_auth["Authentication state<br/>[useAuth.ts]"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
  node_pending_attempt["Pending attempts<br/>[pendingAttempt.ts]"]
  node_supabase[("Supabase Auth and database")]
end

subgraph group_content["Question content"]
  node_cert_registry["Certification registry<br/>[certifications.ts]"]
  node_question_loader["Question loader<br/>[questions.ts]"]
  node_question_banks["Domain question banks"]
end

subgraph group_insights["Progress and insights"]
  node_history["Exam history<br/>[_History.tsx]"]
  node_dashboard["Certification dashboard"]
  node_community_stats["Community statistics<br/>[_Stats.tsx]"]
end

subgraph group_shared["Shared application services"]
  node_analytics["Analytics events<br/>[analytics.ts]"]
  node_logger["Client error logging<br/>[logger.ts]"]
  node_seo["SEO metadata<br/>[useSEO.ts]"]
  node_button_styles["Shared button styles<br/>[buttonStyles.ts]"]
end

node_learner(("Learner"))

node_learner -->|"practices by domain"| node_domain_practice
node_learner -->|"takes timed exam"| node_mock_exam
node_domain_practice -->|"loads questions"| node_question_loader
node_mock_exam -->|"loads question bank"| node_question_loader
node_question_loader -->|"loads domain JSON"| node_question_banks
node_cert_registry -->|"defines certification domains"| node_question_loader
node_mock_exam -->|"scores attempts"| node_scoring
node_domain_practice -->|"reviews answers"| node_review
node_review -->|"renders answer controls"| node_answer_inputs
node_learner -->|"signs in optionally"| node_auth
node_auth -->|"gets client"| node_supabase_client
node_auth -->|"flushes pending attempt"| node_pending_attempt
node_pending_attempt -->|"persists attempts"| node_supabase_client
node_supabase_client -->|"authenticates and queries"| node_supabase
node_history -->|"reads saved history"| node_supabase
node_dashboard -->|"reads progress"| node_supabase
node_community_stats -->|"reads aggregate statistics"| node_supabase
node_dashboard -->|"checks signed-in user"| node_auth
node_auth -->|"tracks sign-in"| node_analytics
node_logger -->|"reports client errors"| node_analytics
node_history -->|"renders question review"| node_review
node_domain_practice -->|"updates page metadata"| node_seo
node_mock_exam -->|"updates page metadata"| node_seo
node_domain_practice -->|"uses shared styles"| node_button_styles

click node_domain_practice "https://github.com/nastaso/cloudcertprep/blob/main/src/pages/_DomainPractice.tsx"
click node_mock_exam "https://github.com/nastaso/cloudcertprep/blob/main/src/pages/_MockExam.tsx"
click node_review "https://github.com/nastaso/cloudcertprep/blob/main/src/components/QuestionReviewCard.tsx"
click node_answer_inputs "https://github.com/nastaso/cloudcertprep/blob/main/src/components/MatchingInput.tsx"
click node_cert_registry "https://github.com/nastaso/cloudcertprep/blob/main/src/data/certifications.ts"
click node_question_loader "https://github.com/nastaso/cloudcertprep/blob/main/src/data/questions.ts"
click node_question_banks "https://github.com/nastaso/cloudcertprep/tree/main/src/data"
click node_scoring "https://github.com/nastaso/cloudcertprep/blob/main/src/lib/scoring.ts"
click node_auth "https://github.com/nastaso/cloudcertprep/blob/main/src/hooks/useAuth.ts"
click node_supabase_client "https://github.com/nastaso/cloudcertprep/blob/main/src/lib/supabase.ts"
click node_pending_attempt "https://github.com/nastaso/cloudcertprep/blob/main/src/lib/pendingAttempt.ts"
click node_history "https://github.com/nastaso/cloudcertprep/blob/main/src/pages/_History.tsx"
click node_dashboard "https://github.com/nastaso/cloudcertprep/blob/main/src/components/CertDashboardIsland.tsx"
click node_community_stats "https://github.com/nastaso/cloudcertprep/blob/main/src/pages/_Stats.tsx"
click node_analytics "https://github.com/nastaso/cloudcertprep/blob/main/src/lib/analytics.ts"
click node_logger "https://github.com/nastaso/cloudcertprep/blob/main/src/lib/logger.ts"
click node_seo "https://github.com/nastaso/cloudcertprep/blob/main/src/hooks/useSEO.ts"
click node_button_styles "https://github.com/nastaso/cloudcertprep/blob/main/src/lib/buttonStyles.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_domain_practice,node_mock_exam,node_review,node_answer_inputs,node_scoring toneBlue
class node_auth,node_supabase_client,node_pending_attempt,node_supabase toneAmber
class node_cert_registry,node_question_loader,node_question_banks toneMint
class node_history,node_dashboard,node_community_stats toneRose
class node_analytics,node_logger,node_seo,node_button_styles,node_learner toneIndigo
```

## Components

### Practice and exams

- [Domain practice](https://github.com/nastaso/cloudcertprep/blob/main/src/pages/_DomainPractice.tsx): `src/pages/_DomainPractice.tsx`
- [Timed mock exam](https://github.com/nastaso/cloudcertprep/blob/main/src/pages/_MockExam.tsx): `src/pages/_MockExam.tsx`
- [Question review](https://github.com/nastaso/cloudcertprep/blob/main/src/components/QuestionReviewCard.tsx): `src/components/QuestionReviewCard.tsx`
- [Answer inputs](https://github.com/nastaso/cloudcertprep/blob/main/src/components/MatchingInput.tsx): `src/components/MatchingInput.tsx`
- [Exam scoring](https://github.com/nastaso/cloudcertprep/blob/main/src/lib/scoring.ts): `src/lib/scoring.ts`

### Identity and persistence

- [Authentication state](https://github.com/nastaso/cloudcertprep/blob/main/src/hooks/useAuth.ts): `src/hooks/useAuth.ts`
- [Supabase client](https://github.com/nastaso/cloudcertprep/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Pending attempts](https://github.com/nastaso/cloudcertprep/blob/main/src/lib/pendingAttempt.ts): `src/lib/pendingAttempt.ts`
- **Supabase Auth and database**

### Question content

- [Certification registry](https://github.com/nastaso/cloudcertprep/blob/main/src/data/certifications.ts): `src/data/certifications.ts`
- [Question loader](https://github.com/nastaso/cloudcertprep/blob/main/src/data/questions.ts): `src/data/questions.ts`
- [Domain question banks](https://github.com/nastaso/cloudcertprep/tree/main/src/data): `src/data`

### Progress and insights

- [Exam history](https://github.com/nastaso/cloudcertprep/blob/main/src/pages/_History.tsx): `src/pages/_History.tsx`
- [Certification dashboard](https://github.com/nastaso/cloudcertprep/blob/main/src/components/CertDashboardIsland.tsx): `src/components/CertDashboardIsland.tsx`
- [Community statistics](https://github.com/nastaso/cloudcertprep/blob/main/src/pages/_Stats.tsx): `src/pages/_Stats.tsx`

### Shared application services

- [Analytics events](https://github.com/nastaso/cloudcertprep/blob/main/src/lib/analytics.ts): `src/lib/analytics.ts`
- [Client error logging](https://github.com/nastaso/cloudcertprep/blob/main/src/lib/logger.ts): `src/lib/logger.ts`
- [SEO metadata](https://github.com/nastaso/cloudcertprep/blob/main/src/hooks/useSEO.ts): `src/hooks/useSEO.ts`
- [Shared button styles](https://github.com/nastaso/cloudcertprep/blob/main/src/lib/buttonStyles.ts): `src/lib/buttonStyles.ts`

### Other components

- **Learner**

## Connections

- Learner → Domain practice: practices by domain
- Learner → Timed mock exam: takes timed exam
- Domain practice → Question loader: loads questions (evidence: `src/data/questions.ts`)
- Timed mock exam → Question loader: loads question bank (evidence: `src/data/questions.ts`)
- Question loader → Domain question banks: loads domain JSON (evidence: `src/data/questions.ts`)
- Certification registry → Question loader: defines certification domains (evidence: `src/data/certifications.ts`)
- Timed mock exam → Exam scoring: scores attempts (evidence: `src/pages/_MockExam.tsx`)
- Domain practice → Question review: reviews answers (evidence: `src/pages/_DomainPractice.tsx`)
- Question review → Answer inputs: renders answer controls (evidence: `src/components/QuestionReviewCard.tsx`)
- Learner → Authentication state: signs in optionally
- Authentication state → Supabase client: gets client (evidence: `src/hooks/useAuth.ts`)
- Authentication state → Pending attempts: flushes pending attempt (evidence: `src/hooks/useAuth.ts`)
- Pending attempts → Supabase client: persists attempts (evidence: `src/lib/pendingAttempt.ts`)
- Supabase client → Supabase Auth and database: authenticates and queries
- Exam history → Supabase Auth and database: reads saved history
- Certification dashboard → Supabase Auth and database: reads progress
- Community statistics → Supabase Auth and database: reads aggregate statistics
- Certification dashboard → Authentication state: checks signed-in user (evidence: `src/components/CertDashboardIsland.tsx`)
- Authentication state → Analytics events: tracks sign-in (evidence: `src/hooks/useAuth.ts`)
- Client error logging → Analytics events: reports client errors (evidence: `src/lib/logger.ts`)
- Exam history → Question review: renders question review (evidence: `src/pages/_History.tsx`)
- Domain practice → SEO metadata: updates page metadata (evidence: `src/pages/_DomainPractice.tsx`)
- Timed mock exam → SEO metadata: updates page metadata (evidence: `src/pages/_MockExam.tsx`)
- Domain practice → Shared button styles: uses shared styles (evidence: `src/pages/_DomainPractice.tsx`)
