Skip to content

Repository files navigation

Data Engine Thinking — Samples

Sample code, design patterns, and solution patterns that accompany the book Data Engine Thinking by Roelant Vos and Dirk Lerner.

This repository builds the companion documentation site at docs.dataenginethinking.com.

Stack

  • Astro with Starlight
  • Content authored as Markdown/MDX under src/content/docs/
  • In-site search via Pagefind (built automatically on build)

Run it locally

This is a standard Astro project, so running it after a clone is just a few commands.

Prerequisites

  • Node.js ≥ 20.3 A version manager such as fnm or nvm is the easiest way to get a matching version.

  • pnpm — the package manager is pinned in package.json, so the simplest setup is to let Corepack provide it:

    corepack enable

Run

git clone https://github.com/data-engine-thinking/samples.git
cd samples
pnpm install      # install dependencies
pnpm dev          # starts dev server at http://localhost:2330

Then open http://localhost:2330. Changes to pages (src/content/docs/) and to code samples (code/) hot-reload in the browser.

To build and preview the site exactly as it is published:

pnpm build        # generate the static site into dist/
pnpm preview      # serve the built site locally

In-site search is generated by Pagefind during pnpm build, so it works in pnpm preview but not in pnpm dev.

Deploying

The site is hosted on all-inkl and is not deployed from GitHub — merging to main updates the source only. Publishing is an explicit step:

./deploy.sh          # builds, then shows what would change (uploads nothing)
./deploy.sh --go     # builds and uploads for real

The dry run is the default on purpose: it prints the full rsync diff, so you can see exactly what is about to change before anything is touched. --skip-build reuses the existing dist/ if you have just built and checked it, and ./deploy.sh --help lists the environment overrides for host and target path.

The upload runs with --delete, so the script refuses to continue unless dist/ looks like a complete build (index.html present, at least 50 pages) — otherwise a failed build could take the live site down with it.

Deploying needs SSH access to the allinkl host, so it only works from a machine with that key configured. To confirm what is actually live afterwards:

curl -s https://docs.dataenginethinking.com | grep -o 'Astro v[0-9.]*'

Layout

Path Contents
src/content/docs/ All pages: chapters, patterns, sample setup, about, license
code/ Standalone SQL / Handlebars / metadata samples, organized by chapter
astro.config.ts Site config, navigation sidebar, fonts
src/styles/custom.css Brand theme layer over Starlight

Code samples

The runnable samples live under code/, mirroring the chapter and pattern structure, so they can be opened, edited, and run on their own. Pages pull them in at build time (remark-code-import), so editing a file under code/ and rebuilding updates the corresponding page — the page and the file never drift.

Because they are plain files in the repository, you can browse or download any of them directly from GitHub under code/.

Contributing

This is a living library. Improvements, new patterns, and fixes are welcome by Pull Request — small edits (typos, clarity, examples) are just as valuable as new patterns.

License

Distributed under the GNU General Public License v3.0.

About

Practical examples supporting Data Engine Thinking.

Topics

Resources

Stars

9 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages