# System map — Chalarangelo/30-seconds-of-code

> Canonical page: https://codevetter.com/unpack/30-seconds-of-code/system-map

# System map — Chalarangelo/30-seconds-of-code

Scanned commit bd756f8b2283a38560efe83cb30af38324d4e9e9 (2026-09-09). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

The system is a two-phase static site generator: bin/prepare transforms content/ Markdown and YAML into .content/ JSON artifacts, then astro build renders pages whose getStaticPaths read those JSONs. A custom model layer (Model/RecordSet), page adapters, and serializers mediate between raw content and Astro routes. Client interactivity is a few vanilla JS scripts (omnisearch, hotkeys, toc) loaded via <script src> in Astro components — there are no framework islands. Hosting is static (Cloudflare build hook triggered from GitHub Actions), and tests run under Vitest against spec/ fixtures.
- Astro is configured with srcDir 'src/astro', site https://www.30secondsofcode.org, compressHTML, and inlineStylesheets 'always'. — [astro.config.mjs](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/astro.config.mjs) [src/astro/settings.js](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/astro/settings.js)
- bin/prepare is the build orchestrator CLI with commands: full, dev, content, watch, assets, create, create-component, help. — [bin/prepare#L8-30](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/bin/prepare#L8-L30)
- npm scripts wire preparation into lifecycle hooks: predev/prebuild run bin/prepare (dev/full), dev/start run 'astro dev --port 8000', build runs 'astro build', test runs 'vitest', console runs bin/console. — [package.json#L43-57](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/package.json#L43-L57)
- The project is pure ESM ('type': 'module'), requires Node >=22.14.0, and uses '#src/*' and '#spec/*' subpath imports mirrored in jsconfig paths. — [package.json#L8](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/package.json#L8) [package.json#L35-42](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/package.json#L35-L42) [package.json#L69-71](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/package.json#L69-L71) [jsconfig.json](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/jsconfig.json)
- A custom in-process data layer exists: Model keeps static instances/indexedInstances/getterCache registries, caches getters via WeakMap redefinition, and exposes all/where/order/scope/find/search class APIs. — [src/core/model.js](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/core/model.js)
- RecordSet extends Array with where (equality, array-membership, or predicate functions), order, pluck, shuffle, first/last — it is the query primitive used by every model scope. — [src/core/recordSet.js](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/core/recordSet.js)
- The model registry is exactly five classes: ContentModel (abstract base), Collection, CollectionSnippet (join model), Language, Snippet. — [src/models/models.js](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/models/models.js) [src/models/contentModel.js](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/models/contentModel.js)
- Loader.importData reads .content/content.json and hydrates model instances through a JSON.parse reviver keyed on each record's 'model' discriminator field. — [src/lib/loader.js#L43-54](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/lib/loader.js#L43-L54) [src/models/models.js](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/models/models.js)
- Page adapters form a registry: Page.register stores classes by name and Page.from(object) resolves the adapter as `${object.constructor.name}Page`; PageSerializer emits {params, props} where props includes structuredData (schema.org JSON-LD). — [src/adapters/page.js](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/adapters/page.js) [src/adapters/page/snippetPage.js#L4-8](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/adapters/page/snippetPage.js#L4-L8) [src/serializers/pageSerializer.js](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/serializers/pageSerializer.js)
- AstroContent.generate writes three JSON artifacts consumed by Astro routes: .content/pages/index.json, [lang]/[...listing].json, and [lang]/s/[snippet].json. — [src/lib/astroContent.js](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/lib/astroContent.js) [src/config/settings.js#L43-48](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/config/settings.js#L43-L48)
- The search stack is hand-rolled and shared between build and browser: server.js tokenizes content into 'token:count' strings, DocumentIndex builds term + trigram inverted indexes, and documentSearch scores with TF-IDF blended with n-gram similarity. — [src/lib/search/server.js](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/lib/search/server.js) [src/lib/search/documentIndex.js](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/lib/search/documentIndex.js) [src/lib/search/documentSearch.js](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/lib/search/documentSearch.js)
- Deployment is a scheduled GitHub Actions workflow (cron '20 18 * * *' plus workflow_dispatch) that executes bin/deploy, a bash script that POSTs to a Cloudflare build hook URL stored in the CF_BUILD_HOOK_URL secret. — [.github/workflows/deploy-production.yml](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/.github/workflows/deploy-production.yml) [bin/deploy](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/bin/deploy)
- Client-side behavior is delivered by three plain scripts referenced from components via <script src>: omnisearch.js (search modal), hotkeys.js (keyboard nav), toc.js (table of contents). — [src/astro/scripts/omnisearch.js](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/astro/scripts/omnisearch.js) [src/astro/scripts/hotkeys.js](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/astro/scripts/hotkeys.js) [src/astro/scripts/toc.js](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/astro/scripts/toc.js) [src/astro/components/Omnisearch.astro#L23](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/astro/components/Omnisearch.astro#L23) [src/astro/components/Header.astro#L42](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/astro/components/Header.astro#L42)
- Generated artifacts live in gitignored paths: .content/, src/astro/timestamp.js, public/search-data.json, public/sitemap.xml, public/feed.xml, public/_redirects, public/components. — [.gitignore](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/.gitignore) [src/lib/timestampDump.js](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/lib/timestampDump.js) [src/config/settings.js#L49-53](https://github.com/Chalarangelo/30-seconds-of-code/blob/bd756f8b2283a38560efe83cb30af38324d4e9e9/src/config/settings.js#L49-L53)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
