How cstack/db_tutorial works
Project type and purpose
• This is a mixed-content repository that combines:
• A static site/tour tutorial built with Jekyll (Markdown parts, layouts, includes, Sass, etc.)
• A “Let's Build a Simple Database” C implementation (db.c, Makefile) with an accompanying test suite (spec/main_spec.rb).
• Purpose: render a step-by-step tutorial website and provide the reference C code for a toy database engine.
Main components
a. Content & Site Generator (Jekyll)
• Source content:
• _parts/*.md (tutorial chapters)
• index.md, _includes/*, _layouts/*
• assets/css/style.scss, assets/images/*
• _config.yml
• Toolchain:
• Ruby + Bundler (Gemfile, Gemfile.lock)
• Jekyll (bundle exec jekyll serve)
• Output:
• Static HTML/CSS/JS served locally or deployed (e.g., GitHub Pages)
b. Database Engine (C)
• Source: db.c
• Build: Makefile invokes gcc/clang
• Test harness: spec/main_spec.rb (Ruby test script or RSpec)
c. Deployment / Site Delivery
• The generated feed.xml and rendered HTML pages
• Can be hosted on GitHub Pages or any static-site host
Relationships & data flow
• Markdown & assets → Jekyll → Static website (HTML/CSS/JS)
• C source + Makefile → Compiler → db executable
• Test suite → Runs against db executable → Verification reports
Architectural patterns & principles
• Static-site generator pattern: separation of content, presentation (layouts), and theming (Sass).
• Single-responsibility: Jekyll handles only site build; Makefile handles only C code build.
• Test-driven or behavior-driven snippet: the spec folder demonstrates testing of the C engine.