# github-samples/caldova-careers architecture

> Architecture diagram of the GitHub repository github-samples/caldova-careers, 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/github-samples/caldova-careers
- Repository: https://github.com/github-samples/caldova-careers

## Overview

Caldova Careers is a small Astro careers site: applicants browse Markdown-backed roles, view a role and submit an unauthenticated application, which is validated and stored in the applications table. The graph includes the documented listing, detail, apply and confirmation stages, plus the content, helper and database layers. Page and component connections rely on README descriptions; the sampled endpoint and library excerpts provide the implementation evidence for application validation and persistence.

Main entry points: [`src/pages/index.astro`](https://github.com/github-samples/caldova-careers/blob/main/src/pages/index.astro) (Role listing), [`src/pages/roles/[slug].astro`](https://github.com/github-samples/caldova-careers/blob/main/src/pages/roles/%5Bslug%5D.astro) (Role detail), [`src/pages/api/apply.ts`](https://github.com/github-samples/caldova-careers/blob/main/src/pages/api/apply.ts) (Apply endpoint), [`src/lib/applications.ts`](https://github.com/github-samples/caldova-careers/blob/main/src/lib/applications.ts) (Application validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_careers["Careers pages"]
  node_listing["Role listing<br/>[index.astro]"]
  node_detail["Role detail<br/>[&#91;slug&#93;.astro]"]
  node_apply_form["Apply form<br/>[ApplyForm.astro]"]
  node_confirmation["Confirmation page<br/>[thanks.astro]"]
  node_about["About page<br/>[about.astro]"]
  node_not_found["Not found page<br/>[404.astro]"]
  node_shared_ui["Shared UI"]
end

subgraph group_content["Role content"]
  node_job_posts["Job postings"]
  node_content_schema["Content schema<br/>[content.config.ts]"]
  node_job_helpers["Job helpers<br/>[jobs.ts]"]
  node_job_types["Job types<br/>[job.ts]"]
end

subgraph group_apply["Application flow"]
  node_apply_endpoint["Apply endpoint<br/>[apply.ts]"]
  node_application_logic["Application validation<br/>[applications.ts]"]
end

subgraph group_data["Data layer"]
  node_db_client["Database client<br/>[db.ts]"]
  node_applications_table[("Applications table<br/>[schema.ts]")]
end

node_visitor(("Job seeker"))

node_visitor -->|"browses roles"| node_listing
node_listing -->|"lists postings"| node_job_posts
node_listing -->|"opens role"| node_detail
node_detail -->|"presents form"| node_apply_form
node_apply_form -->|"submits application"| node_apply_endpoint
node_apply_endpoint -->|"loads roles"| node_content_schema
node_apply_endpoint -->|"validates and creates"| node_application_logic
node_application_logic -->|"accepts database"| node_db_client
node_application_logic -->|"inserts row"| node_applications_table
node_db_client -->|"configures schema"| node_applications_table
node_apply_endpoint -->|"redirects on success"| node_confirmation
node_content_schema -->|"loads and validates"| node_job_posts
node_job_helpers -->|"uses type"| node_job_types
node_listing -.->|"sorts postings"| node_job_helpers
node_detail -.->|"shows posting"| node_job_posts
node_detail -.->|"formats dates"| node_job_helpers

click node_listing "https://github.com/github-samples/caldova-careers/blob/main/src/pages/index.astro"
click node_detail "https://github.com/github-samples/caldova-careers/blob/main/src/pages/roles/%5Bslug%5D.astro"
click node_apply_form "https://github.com/github-samples/caldova-careers/blob/main/src/components/ApplyForm.astro"
click node_confirmation "https://github.com/github-samples/caldova-careers/blob/main/src/pages/thanks.astro"
click node_about "https://github.com/github-samples/caldova-careers/blob/main/src/pages/about.astro"
click node_not_found "https://github.com/github-samples/caldova-careers/blob/main/src/pages/404.astro"
click node_shared_ui "https://github.com/github-samples/caldova-careers/tree/main/src/components"
click node_job_posts "https://github.com/github-samples/caldova-careers/tree/main/src/content/jobs"
click node_content_schema "https://github.com/github-samples/caldova-careers/blob/main/src/content.config.ts"
click node_job_helpers "https://github.com/github-samples/caldova-careers/blob/main/src/lib/jobs.ts"
click node_job_types "https://github.com/github-samples/caldova-careers/blob/main/src/types/job.ts"
click node_apply_endpoint "https://github.com/github-samples/caldova-careers/blob/main/src/pages/api/apply.ts"
click node_application_logic "https://github.com/github-samples/caldova-careers/blob/main/src/lib/applications.ts"
click node_db_client "https://github.com/github-samples/caldova-careers/blob/main/src/lib/db.ts"
click node_applications_table "https://github.com/github-samples/caldova-careers/blob/main/db/schema.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_listing,node_detail,node_apply_form,node_confirmation,node_about,node_not_found,node_shared_ui toneBlue
class node_job_posts,node_content_schema,node_job_helpers,node_job_types toneAmber
class node_apply_endpoint,node_application_logic toneMint
class node_db_client,node_applications_table toneRose
class node_visitor toneIndigo
```

## Components

### Careers pages

- [Role listing](https://github.com/github-samples/caldova-careers/blob/main/src/pages/index.astro): `src/pages/index.astro`
- [Role detail](https://github.com/github-samples/caldova-careers/blob/main/src/pages/roles/%5Bslug%5D.astro): `src/pages/roles/[slug].astro`
- [Apply form](https://github.com/github-samples/caldova-careers/blob/main/src/components/ApplyForm.astro): `src/components/ApplyForm.astro`
- [Confirmation page](https://github.com/github-samples/caldova-careers/blob/main/src/pages/thanks.astro): `src/pages/thanks.astro`
- [About page](https://github.com/github-samples/caldova-careers/blob/main/src/pages/about.astro): `src/pages/about.astro`
- [Not found page](https://github.com/github-samples/caldova-careers/blob/main/src/pages/404.astro): `src/pages/404.astro`
- [Shared UI](https://github.com/github-samples/caldova-careers/tree/main/src/components): `src/components`

### Role content

- [Job postings](https://github.com/github-samples/caldova-careers/tree/main/src/content/jobs): `src/content/jobs`
- [Content schema](https://github.com/github-samples/caldova-careers/blob/main/src/content.config.ts): `src/content.config.ts`
- [Job helpers](https://github.com/github-samples/caldova-careers/blob/main/src/lib/jobs.ts): `src/lib/jobs.ts`
- [Job types](https://github.com/github-samples/caldova-careers/blob/main/src/types/job.ts): `src/types/job.ts`

### Application flow

- [Apply endpoint](https://github.com/github-samples/caldova-careers/blob/main/src/pages/api/apply.ts): `src/pages/api/apply.ts`
- [Application validation](https://github.com/github-samples/caldova-careers/blob/main/src/lib/applications.ts): `src/lib/applications.ts`

### Data layer

- [Database client](https://github.com/github-samples/caldova-careers/blob/main/src/lib/db.ts): `src/lib/db.ts`
- [Applications table](https://github.com/github-samples/caldova-careers/blob/main/db/schema.ts): `db/schema.ts`

### Other components

- **Job seeker**

## Connections

- Job seeker → Role listing: browses roles (evidence: `README.md`)
- Role listing → Job postings: lists postings (evidence: `README.md`)
- Role listing → Role detail: opens role (evidence: `README.md`)
- Role detail → Apply form: presents form (evidence: `README.md`)
- Apply form → Apply endpoint: submits application (evidence: `README.md`)
- Apply endpoint → Content schema: loads roles (evidence: `src/pages/api/apply.ts`)
- Apply endpoint → Application validation: validates and creates (evidence: `src/pages/api/apply.ts`)
- Application validation → Database client: accepts database (evidence: `src/lib/applications.ts`)
- Application validation → Applications table: inserts row (evidence: `src/lib/applications.ts`)
- Database client → Applications table: configures schema (evidence: `src/lib/db.ts`)
- Apply endpoint → Confirmation page: redirects on success (evidence: `src/pages/api/apply.ts`)
- Content schema → Job postings: loads and validates (evidence: `src/content.config.ts`)
- Job helpers → Job types: uses type (evidence: `src/lib/jobs.ts`)
- Role listing → Job helpers: sorts postings
- Role detail → Job postings: shows posting
- Role detail → Job helpers: formats dates
