# github-samples/tailspin-toys architecture

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

## Overview

Tailspin Toys is a static Astro crowdfunding-game catalog backed by local SQLite. Its principal workflow reads game records through data-access helpers and prerenders pages; database seeding and the Backer Concierge catalog export are separate supporting capabilities. Page and component source was not excerpted, so their internal routing and rendering relationships are not expanded beyond the README’s description.

Main entry points: [`src/lib/db.ts`](https://github.com/github-samples/tailspin-toys/blob/main/src/lib/db.ts) (Database client), [`db/seed.ts`](https://github.com/github-samples/tailspin-toys/blob/main/db/seed.ts) (Database seeder), [`src/lib/games.ts`](https://github.com/github-samples/tailspin-toys/blob/main/src/lib/games.ts) (Game queries), [`db/export-catalog.ts`](https://github.com/github-samples/tailspin-toys/blob/main/db/export-catalog.ts) (Catalog export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Static catalog"]
  node_pages["Astro pages"]
  node_ui["Shared UI"]
  node_ratings["Rating formatter<br/>[ratings.ts]"]
end

subgraph group_data["Catalog data"]
  node_queries["Game queries<br/>[games.ts]"]
  node_dbclient["Database client<br/>[db.ts]"]
  node_schema["Catalog schema<br/>[schema.ts]"]
  node_sqlite[("SQLite database")]
end

subgraph group_ops["Catalog preparation"]
  node_csv["Seed catalog<br/>[games.csv]"]
  node_transforms["Seed transforms<br/>[transforms.ts]"]
  node_seed["Database seeder<br/>[seed.ts]"]
  node_migration["Migration runner<br/>[migrate.ts]"]
end

subgraph group_concierge["Concierge export"]
  node_exporter["Catalog export<br/>[export-catalog.ts]"]
end

node_visitor(("Site visitor"))

node_visitor -->|"views"| node_pages
node_pages -->|"queries at build"| node_queries
node_queries -->|"uses client"| node_dbclient
node_queries -->|"queries tables"| node_schema
node_dbclient -->|"configures Drizzle"| node_schema
node_dbclient -->|"executes SQL"| node_sqlite
node_ui -->|"formats stars"| node_ratings
node_seed -->|"reads seed data"| node_csv
node_seed -->|"parses and derives"| node_transforms
node_seed -->|"writes records"| node_schema
node_seed -->|"creates connection"| node_dbclient
node_migration -->|"creates connection"| node_dbclient
node_migration -->|"applies migrations"| node_sqlite
node_exporter -->|"loads games"| node_queries
node_exporter -->|"formats ratings"| node_ratings
node_exporter -->|"creates connection"| node_dbclient

click node_pages "https://github.com/github-samples/tailspin-toys/tree/main/src/pages"
click node_ui "https://github.com/github-samples/tailspin-toys/tree/main/src/components"
click node_ratings "https://github.com/github-samples/tailspin-toys/blob/main/src/lib/ratings.ts"
click node_queries "https://github.com/github-samples/tailspin-toys/blob/main/src/lib/games.ts"
click node_dbclient "https://github.com/github-samples/tailspin-toys/blob/main/src/lib/db.ts"
click node_schema "https://github.com/github-samples/tailspin-toys/blob/main/db/schema.ts"
click node_csv "https://github.com/github-samples/tailspin-toys/blob/main/db/games.csv"
click node_transforms "https://github.com/github-samples/tailspin-toys/blob/main/db/transforms.ts"
click node_seed "https://github.com/github-samples/tailspin-toys/blob/main/db/seed.ts"
click node_migration "https://github.com/github-samples/tailspin-toys/blob/main/db/migrate.ts"
click node_exporter "https://github.com/github-samples/tailspin-toys/blob/main/db/export-catalog.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_pages,node_ui,node_ratings toneBlue
class node_queries,node_dbclient,node_schema,node_sqlite toneAmber
class node_csv,node_transforms,node_seed,node_migration toneMint
class node_exporter toneRose
class node_visitor toneIndigo
```

## Components

### Static catalog

- [Astro pages](https://github.com/github-samples/tailspin-toys/tree/main/src/pages): `src/pages`
- [Shared UI](https://github.com/github-samples/tailspin-toys/tree/main/src/components): `src/components`
- [Rating formatter](https://github.com/github-samples/tailspin-toys/blob/main/src/lib/ratings.ts): `src/lib/ratings.ts`

### Catalog data

- [Game queries](https://github.com/github-samples/tailspin-toys/blob/main/src/lib/games.ts): `src/lib/games.ts`
- [Database client](https://github.com/github-samples/tailspin-toys/blob/main/src/lib/db.ts): `src/lib/db.ts`
- [Catalog schema](https://github.com/github-samples/tailspin-toys/blob/main/db/schema.ts): `db/schema.ts`
- **SQLite database**

### Catalog preparation

- [Seed catalog](https://github.com/github-samples/tailspin-toys/blob/main/db/games.csv): `db/games.csv`
- [Seed transforms](https://github.com/github-samples/tailspin-toys/blob/main/db/transforms.ts): `db/transforms.ts`
- [Database seeder](https://github.com/github-samples/tailspin-toys/blob/main/db/seed.ts): `db/seed.ts`
- [Migration runner](https://github.com/github-samples/tailspin-toys/blob/main/db/migrate.ts): `db/migrate.ts`

### Concierge export

- [Catalog export](https://github.com/github-samples/tailspin-toys/blob/main/db/export-catalog.ts): `db/export-catalog.ts`

### Other components

- **Site visitor**

## Connections

- Site visitor → Astro pages: views (evidence: `README.md`)
- Astro pages → Game queries: queries at build (evidence: `README.md`)
- Game queries → Database client: uses client (evidence: `src/lib/games.ts`)
- Game queries → Catalog schema: queries tables (evidence: `src/lib/games.ts`)
- Database client → Catalog schema: configures Drizzle (evidence: `src/lib/db.ts`)
- Database client → SQLite database: executes SQL (evidence: `src/lib/db.ts`)
- Shared UI → Rating formatter: formats stars (evidence: `src/lib/ratings.ts`)
- Database seeder → Seed catalog: reads seed data (evidence: `db/seed.ts`)
- Database seeder → Seed transforms: parses and derives (evidence: `db/seed.ts`)
- Database seeder → Catalog schema: writes records (evidence: `db/seed.ts`)
- Database seeder → Database client: creates connection (evidence: `db/seed.ts`)
- Migration runner → Database client: creates connection (evidence: `db/migrate.ts`)
- Migration runner → SQLite database: applies migrations (evidence: `db/migrate.ts`)
- Catalog export → Game queries: loads games (evidence: `db/export-catalog.ts`)
- Catalog export → Rating formatter: formats ratings (evidence: `db/export-catalog.ts`)
- Catalog export → Database client: creates connection (evidence: `db/export-catalog.ts`)
