# github-samples/pets-workshop architecture

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

- Interactive diagram: https://gitdiagram.com/github-samples/pets-workshop
- Repository: https://github.com/github-samples/pets-workshop

## Overview

This repository combines guided GitHub workshops with a fictional dog-shelter website used as their hands-on project. A visitor browses dog listings and details through an Astro client backed by a Flask API and SQLite/SQLAlchemy models. The workshop materials cover Copilot, day-to-day GitHub development processes, and Actions-based CI/CD. Page and component internals were not sampled, so client-to-API links reflect the documented frontend/backend architecture rather than inspected call sites.

Main entry points: [`app/server/app.py`](https://github.com/github-samples/pets-workshop/blob/main/app/server/app.py) (Dog API), [`app/client/src/pages/index.astro`](https://github.com/github-samples/pets-workshop/blob/main/app/client/src/pages/index.astro) (Dog listings), [`app/client/src/pages/dog/[id].astro`](https://github.com/github-samples/pets-workshop/blob/main/app/client/src/pages/dog/%5Bid%5D.astro) (Dog details), [`app/client/src/layouts/Layout.astro`](https://github.com/github-samples/pets-workshop/blob/main/app/client/src/layouts/Layout.astro) (Shared layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workshops["Workshop curricula"]
  node_hour["One-hour Copilot"]
  node_fullday["Full-day GitHub"]
  node_actions["Actions CI/CD"]
  node_workshopguide["Workshop entry guide<br/>[README.md]"]
end

subgraph group_client["Astro website"]
  node_home["Dog listings<br/>[index.astro]"]
  node_details["Dog details<br/>[&#91;id&#93;.astro]"]
  node_about["About page<br/>[about.astro]"]
  node_doglist["Listing component<br/>[DogList.astro]"]
  node_dogdetails["Details component<br/>[DogDetails.astro]"]
  node_layout["Shared layout<br/>[Layout.astro]"]
end

subgraph group_server["Flask API"]
  node_api["Dog API<br/>[app.py]"]
end

subgraph group_domain["Shelter data"]
  node_dogmodel["Dog model<br/>[dog.py]"]
  node_breedmodel["Breed model<br/>[breed.py]"]
  node_basemodel["Model validation<br/>[base.py]"]
  node_dbinit["Database setup<br/>[__init__.py]"]
  node_shelterdb[("Shelter database<br/>[dogshelter.db]")]
end

node_learner(("Workshop learner"))
node_visitor(("Shelter visitor"))

node_learner -->|"opens"| node_workshopguide
node_learner -->|"follows"| node_hour
node_learner -->|"follows"| node_fullday
node_learner -->|"follows"| node_actions
node_visitor -->|"browses"| node_home
node_visitor -->|"views"| node_details
node_visitor -->|"visits"| node_about
node_home -->|"renders"| node_doglist
node_details -->|"renders"| node_dogdetails
node_home -->|"uses"| node_layout
node_details -->|"uses"| node_layout
node_about -->|"uses"| node_layout
node_home -->|"requests listings"| node_api
node_details -->|"requests dog"| node_api
node_api -->|"queries"| node_dogmodel
node_api -->|"joins breed"| node_breedmodel
node_api -->|"reads"| node_shelterdb
node_dbinit -->|"creates tables"| node_shelterdb
node_dogmodel -->|"inherits"| node_basemodel
node_breedmodel -->|"inherits"| node_basemodel

click node_hour "https://github.com/github-samples/pets-workshop/tree/main/content/1-hour"
click node_fullday "https://github.com/github-samples/pets-workshop/tree/main/content/full-day"
click node_actions "https://github.com/github-samples/pets-workshop/tree/main/content/github-actions"
click node_workshopguide "https://github.com/github-samples/pets-workshop/blob/main/content/README.md"
click node_home "https://github.com/github-samples/pets-workshop/blob/main/app/client/src/pages/index.astro"
click node_details "https://github.com/github-samples/pets-workshop/blob/main/app/client/src/pages/dog/%5Bid%5D.astro"
click node_about "https://github.com/github-samples/pets-workshop/blob/main/app/client/src/pages/about.astro"
click node_doglist "https://github.com/github-samples/pets-workshop/blob/main/app/client/src/components/DogList.astro"
click node_dogdetails "https://github.com/github-samples/pets-workshop/blob/main/app/client/src/components/DogDetails.astro"
click node_layout "https://github.com/github-samples/pets-workshop/blob/main/app/client/src/layouts/Layout.astro"
click node_api "https://github.com/github-samples/pets-workshop/blob/main/app/server/app.py"
click node_dogmodel "https://github.com/github-samples/pets-workshop/blob/main/app/server/models/dog.py"
click node_breedmodel "https://github.com/github-samples/pets-workshop/blob/main/app/server/models/breed.py"
click node_basemodel "https://github.com/github-samples/pets-workshop/blob/main/app/server/models/base.py"
click node_dbinit "https://github.com/github-samples/pets-workshop/blob/main/app/server/models/__init__.py"
click node_shelterdb "https://github.com/github-samples/pets-workshop/blob/main/app/server/dogshelter.db"

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_hour,node_fullday,node_actions,node_workshopguide toneBlue
class node_home,node_details,node_about,node_doglist,node_dogdetails,node_layout toneAmber
class node_api toneMint
class node_dogmodel,node_breedmodel,node_basemodel,node_dbinit,node_shelterdb toneRose
class node_learner,node_visitor toneIndigo
```

## Components

### Workshop curricula

- [One-hour Copilot](https://github.com/github-samples/pets-workshop/tree/main/content/1-hour): `content/1-hour`
- [Full-day GitHub](https://github.com/github-samples/pets-workshop/tree/main/content/full-day): `content/full-day`
- [Actions CI/CD](https://github.com/github-samples/pets-workshop/tree/main/content/github-actions): `content/github-actions`
- [Workshop entry guide](https://github.com/github-samples/pets-workshop/blob/main/content/README.md): `content/README.md`

### Astro website

- [Dog listings](https://github.com/github-samples/pets-workshop/blob/main/app/client/src/pages/index.astro): `app/client/src/pages/index.astro`
- [Dog details](https://github.com/github-samples/pets-workshop/blob/main/app/client/src/pages/dog/%5Bid%5D.astro): `app/client/src/pages/dog/[id].astro`
- [About page](https://github.com/github-samples/pets-workshop/blob/main/app/client/src/pages/about.astro): `app/client/src/pages/about.astro`
- [Listing component](https://github.com/github-samples/pets-workshop/blob/main/app/client/src/components/DogList.astro): `app/client/src/components/DogList.astro`
- [Details component](https://github.com/github-samples/pets-workshop/blob/main/app/client/src/components/DogDetails.astro): `app/client/src/components/DogDetails.astro`
- [Shared layout](https://github.com/github-samples/pets-workshop/blob/main/app/client/src/layouts/Layout.astro): `app/client/src/layouts/Layout.astro`

### Flask API

- [Dog API](https://github.com/github-samples/pets-workshop/blob/main/app/server/app.py): `app/server/app.py`

### Shelter data

- [Dog model](https://github.com/github-samples/pets-workshop/blob/main/app/server/models/dog.py): `app/server/models/dog.py`
- [Breed model](https://github.com/github-samples/pets-workshop/blob/main/app/server/models/breed.py): `app/server/models/breed.py`
- [Model validation](https://github.com/github-samples/pets-workshop/blob/main/app/server/models/base.py): `app/server/models/base.py`
- [Database setup](https://github.com/github-samples/pets-workshop/blob/main/app/server/models/__init__.py): `app/server/models/__init__.py`
- [Shelter database](https://github.com/github-samples/pets-workshop/blob/main/app/server/dogshelter.db): `app/server/dogshelter.db`

### Other components

- **Workshop learner**
- **Shelter visitor**

## Connections

- Workshop learner → Workshop entry guide: opens
- Workshop learner → One-hour Copilot: follows
- Workshop learner → Full-day GitHub: follows
- Workshop learner → Actions CI/CD: follows
- Shelter visitor → Dog listings: browses
- Shelter visitor → Dog details: views
- Shelter visitor → About page: visits
- Dog listings → Listing component: renders
- Dog details → Details component: renders
- Dog listings → Shared layout: uses
- Dog details → Shared layout: uses
- About page → Shared layout: uses
- Dog listings → Dog API: requests listings
- Dog details → Dog API: requests dog
- Dog API → Dog model: queries
- Dog API → Breed model: joins breed
- Dog API → Shelter database: reads
- Database setup → Shelter database: creates tables
- Dog model → Model validation: inherits
- Breed model → Model validation: inherits
