# jayed2003/globaled-temp architecture

> Architecture diagram of the GitHub repository jayed2003/globaled-temp, 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/jayed2003/globaled-temp
- Repository: https://github.com/jayed2003/globaled-temp

## Overview

GlobalEd is a study-abroad and IELTS consultancy website whose primary workflow turns public consultation or IELTS-booking submissions into stored leads, confirmation emails, and company alerts. Its public pages also present editable consultancy content, while an authenticated admin CMS manages that content and handles leads and contact messages. The README documents the broader CMS capabilities; sampled source confirms the lead-submission path and examples of content reads and admin writes. Several unsampled subsystem links are shown only where the README documents them.

Main entry points: [`src/app/api/leads/route.ts`](https://github.com/jayed2003/globaled-temp/blob/main/src/app/api/leads/route.ts) (Lead endpoint), [`src/app/api/admin`](https://github.com/jayed2003/globaled-temp/tree/main/src/app/api/admin) (Admin APIs), [`src/app/(site)`](https://github.com/jayed2003/globaled-temp/tree/main/src/app/(site)) (Public pages), [`src/lib/db.ts`](https://github.com/jayed2003/globaled-temp/blob/main/src/lib/db.ts) (PostgreSQL database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public experience"]
  node_site["Public pages"]
  node_services["Service pages<br/>[ServicesGrid.tsx]"]
  node_servicecard["Service card<br/>[ServiceCard.tsx]"]
  node_legal["Legal content<br/>[legal.ts]"]
end

subgraph group_engagement["Lead engagement"]
  node_booking["Booking form"]
  node_contactform["Contact form<br/>[ContactForm.tsx]"]
  node_leadapi["Lead endpoint<br/>[route.ts]"]
  node_contactapi["Contact endpoint<br/>[route.ts]"]
  node_email["Email delivery<br/>[email.ts]"]
end

subgraph group_cms["Admin CMS"]
  node_leads["Leads and messages<br/>[page.tsx]"]
  node_admin["Admin dashboard"]
  node_editor["Content editors"]
  node_adminapi["Admin APIs"]
  node_activity["Activity log<br/>[activity.ts]"]
end

subgraph group_platform["Application services"]
  node_content["Content reads"]
  node_turnstile["Bot verification<br/>[turnstile.ts]"]
  node_ratelimit["Rate limiting<br/>[rate-limit.ts]"]
  node_adminroute["Admin route guard<br/>[admin-route.ts]"]
  node_validation["Input validation"]
  node_database[("PostgreSQL database<br/>[db.ts]")]
end

node_visitor(("Site visitor"))
node_emailservice["Resend"]
node_captcha["Cloudflare Turnstile"]

node_visitor -->|"browses"| node_site
node_site -->|"loads content"| node_content
node_site -->|"renders policies"| node_legal
node_site -->|"shows services"| node_services
node_services -->|"renders cards"| node_servicecard
node_visitor -->|"submits booking"| node_booking
node_visitor -->|"sends enquiry"| node_contactform
node_booking -->|"posts lead"| node_leadapi
node_contactform -->|"posts message"| node_contactapi
node_leadapi -->|"checks limits"| node_ratelimit
node_leadapi -->|"validates submission"| node_validation
node_leadapi -->|"verifies token"| node_turnstile
node_leadapi -->|"stores lead"| node_database
node_leadapi -->|"looks up branches"| node_content
node_leadapi -->|"sends alerts"| node_email
node_contactapi -->|"stores message"| node_database
node_contactapi -->|"sends notification"| node_email
node_email -.->|"delivers email"| node_emailservice
node_turnstile -.->|"checks response"| node_captcha
node_admin -->|"edits content"| node_editor
node_editor -->|"saves changes"| node_adminapi
node_adminapi -->|"uses guard"| node_adminroute
node_adminapi -->|"validates writes"| node_validation
node_adminapi -->|"reads and writes"| node_database
node_adminapi -->|"records changes"| node_activity
node_admin -->|"reviews submissions"| node_leads
node_content -->|"reads published data"| node_database

click node_site "https://github.com/jayed2003/globaled-temp/tree/main/src/app/(site)"
click node_content "https://github.com/jayed2003/globaled-temp/tree/main/src/lib/content"
click node_services "https://github.com/jayed2003/globaled-temp/blob/main/src/components/sections/ServicesGrid.tsx"
click node_servicecard "https://github.com/jayed2003/globaled-temp/blob/main/src/components/cards/ServiceCard.tsx"
click node_legal "https://github.com/jayed2003/globaled-temp/blob/main/src/data/legal.ts"
click node_booking "https://github.com/jayed2003/globaled-temp/blob/main/src/components/forms/ConsultationForm.tsx"
click node_contactform "https://github.com/jayed2003/globaled-temp/blob/main/src/components/forms/ContactForm.tsx"
click node_leadapi "https://github.com/jayed2003/globaled-temp/blob/main/src/app/api/leads/route.ts"
click node_contactapi "https://github.com/jayed2003/globaled-temp/blob/main/src/app/api/contact/route.ts"
click node_leads "https://github.com/jayed2003/globaled-temp/blob/main/src/app/admin/(dashboard)/leads/page.tsx"
click node_email "https://github.com/jayed2003/globaled-temp/blob/main/src/lib/email.ts"
click node_turnstile "https://github.com/jayed2003/globaled-temp/blob/main/src/lib/turnstile.ts"
click node_ratelimit "https://github.com/jayed2003/globaled-temp/blob/main/src/lib/rate-limit.ts"
click node_admin "https://github.com/jayed2003/globaled-temp/tree/main/src/app/admin/(dashboard)"
click node_editor "https://github.com/jayed2003/globaled-temp/tree/main/src/components/admin"
click node_adminapi "https://github.com/jayed2003/globaled-temp/tree/main/src/app/api/admin"
click node_adminroute "https://github.com/jayed2003/globaled-temp/blob/main/src/lib/api/admin-route.ts"
click node_validation "https://github.com/jayed2003/globaled-temp/tree/main/src/lib/validation"
click node_activity "https://github.com/jayed2003/globaled-temp/blob/main/src/lib/activity.ts"
click node_database "https://github.com/jayed2003/globaled-temp/blob/main/src/lib/db.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_site,node_services,node_servicecard,node_legal toneBlue
class node_booking,node_contactform,node_leadapi,node_contactapi,node_email toneAmber
class node_leads,node_admin,node_editor,node_adminapi,node_activity toneMint
class node_content,node_turnstile,node_ratelimit,node_adminroute,node_validation,node_database toneRose
class node_visitor,node_emailservice,node_captcha toneIndigo
```

## Components

### Public experience

- [Public pages](https://github.com/jayed2003/globaled-temp/tree/main/src/app/(site)): `src/app/(site)`
- [Service pages](https://github.com/jayed2003/globaled-temp/blob/main/src/components/sections/ServicesGrid.tsx): `src/components/sections/ServicesGrid.tsx`
- [Service card](https://github.com/jayed2003/globaled-temp/blob/main/src/components/cards/ServiceCard.tsx): `src/components/cards/ServiceCard.tsx`
- [Legal content](https://github.com/jayed2003/globaled-temp/blob/main/src/data/legal.ts): `src/data/legal.ts`

### Lead engagement

- [Booking form](https://github.com/jayed2003/globaled-temp/blob/main/src/components/forms/ConsultationForm.tsx): `src/components/forms/ConsultationForm.tsx`
- [Contact form](https://github.com/jayed2003/globaled-temp/blob/main/src/components/forms/ContactForm.tsx): `src/components/forms/ContactForm.tsx`
- [Lead endpoint](https://github.com/jayed2003/globaled-temp/blob/main/src/app/api/leads/route.ts): `src/app/api/leads/route.ts`
- [Contact endpoint](https://github.com/jayed2003/globaled-temp/blob/main/src/app/api/contact/route.ts): `src/app/api/contact/route.ts`
- [Email delivery](https://github.com/jayed2003/globaled-temp/blob/main/src/lib/email.ts): `src/lib/email.ts`

### Admin CMS

- [Leads and messages](https://github.com/jayed2003/globaled-temp/blob/main/src/app/admin/(dashboard)/leads/page.tsx): `src/app/admin/(dashboard)/leads/page.tsx`
- [Admin dashboard](https://github.com/jayed2003/globaled-temp/tree/main/src/app/admin/(dashboard)): `src/app/admin/(dashboard)`
- [Content editors](https://github.com/jayed2003/globaled-temp/tree/main/src/components/admin): `src/components/admin`
- [Admin APIs](https://github.com/jayed2003/globaled-temp/tree/main/src/app/api/admin): `src/app/api/admin`
- [Activity log](https://github.com/jayed2003/globaled-temp/blob/main/src/lib/activity.ts): `src/lib/activity.ts`

### Application services

- [Content reads](https://github.com/jayed2003/globaled-temp/tree/main/src/lib/content): `src/lib/content`
- [Bot verification](https://github.com/jayed2003/globaled-temp/blob/main/src/lib/turnstile.ts): `src/lib/turnstile.ts`
- [Rate limiting](https://github.com/jayed2003/globaled-temp/blob/main/src/lib/rate-limit.ts): `src/lib/rate-limit.ts`
- [Admin route guard](https://github.com/jayed2003/globaled-temp/blob/main/src/lib/api/admin-route.ts): `src/lib/api/admin-route.ts`
- [Input validation](https://github.com/jayed2003/globaled-temp/tree/main/src/lib/validation): `src/lib/validation`
- [PostgreSQL database](https://github.com/jayed2003/globaled-temp/blob/main/src/lib/db.ts): `src/lib/db.ts`

### Other components

- **Site visitor**
- **Resend**
- **Cloudflare Turnstile**

## Connections

- Site visitor → Public pages: browses
- Public pages → Content reads: loads content
- Public pages → Legal content: renders policies
- Public pages → Service pages: shows services (evidence: `src/components/sections/ServicesGrid.tsx`)
- Service pages → Service card: renders cards (evidence: `src/components/sections/ServicesGrid.tsx`)
- Site visitor → Booking form: submits booking
- Site visitor → Contact form: sends enquiry
- Booking form → Lead endpoint: posts lead
- Contact form → Contact endpoint: posts message
- Lead endpoint → Rate limiting: checks limits (evidence: `src/app/api/leads/route.ts`)
- Lead endpoint → Input validation: validates submission (evidence: `src/app/api/leads/route.ts`)
- Lead endpoint → Bot verification: verifies token (evidence: `src/app/api/leads/route.ts`)
- Lead endpoint → PostgreSQL database: stores lead (evidence: `src/app/api/leads/route.ts`)
- Lead endpoint → Content reads: looks up branches (evidence: `src/app/api/leads/route.ts`)
- Lead endpoint → Email delivery: sends alerts (evidence: `src/app/api/leads/route.ts`)
- Contact endpoint → PostgreSQL database: stores message (evidence: `src/app/api/contact/route.ts`)
- Contact endpoint → Email delivery: sends notification (evidence: `src/app/api/contact/route.ts`)
- Email delivery → Resend: delivers email
- Bot verification → Cloudflare Turnstile: checks response
- Admin dashboard → Content editors: edits content
- Content editors → Admin APIs: saves changes (evidence: `src/components/admin/ServiceForm.tsx`)
- Admin APIs → Admin route guard: uses guard (evidence: `src/app/api/admin/blogs/route.ts`)
- Admin APIs → Input validation: validates writes (evidence: `src/app/api/admin/blogs/route.ts`)
- Admin APIs → PostgreSQL database: reads and writes (evidence: `src/app/api/admin/blogs/route.ts`)
- Admin APIs → Activity log: records changes (evidence: `src/app/api/admin/blogs/route.ts`)
- Admin dashboard → Leads and messages: reviews submissions
- Content reads → PostgreSQL database: reads published data (evidence: `src/lib/content/services.ts`)
