5 Domain Architecture
CDI is modular by design. Each domain represents a real-world disciplineβsuch as economics, health informatics, or educationβand follows a consistent repository structure scaffolded from a shared CDI template.
5.1 π§ Template-Based Scaffolding
Each CDI domain repository is scaffolded from a shared, reusable template designed for clarity, reproducibility, and seamless collaboration. This structure ensures that every guideβregardless of domainβfollows consistent conventions and is easy to maintain, extend, and publish.
The standard scaffold includes:
data/β Example datasets used in Q&A entries
scripts/β Supporting R, Python, or shell scripts for preprocessing or analysis
images/β Exported plots, diagrams, and workflow graphics
library/β Reference files like.bib(citations) and.csl(citation styles)
- Domain-specific
.Rmdfiles β Structured Q&A content organized by topic
index-*.Rmdβ Bookdown entrypoints for building HTML or PDF guides
- Build scripts β Reproducible automation using
combo-build.shorMakefile
- GitHub Actions β CI/CD workflows for deploying guides to GitHub Pages
When applicable, a repo may also include:
Snakefileβ For workflow automation using Snakemake
Dockerfileβ For containerized, reproducible environments
.env,requirements.txt,environment.ymlβ Environment declarations
5.2 π Example Repository Tree
cdi-machine-learning/
βββ data/
β βββ titanic.csv
βββ scripts/
β βββ clean_titanic.R
βββ images/
β βββ ml_workflow.png
βββ library/
β βββ references.bib
β βββ apa.csl
βββ 01-0-preface.Rmd
βββ 01-1-machine-learning.Rmd
βββ index-ml-gitbook.Rmd
βββ _bookdown.yml
βββ _output.yml
βββ combo-build.sh
βββ Snakefile # Optional
βββ Dockerfile # Optional
βββ .github/
βββ workflows/
βββ deploy.yml
5.3 π± Built for Growth
This structure allows each domain to:
- Scale horizontally across fields like economics, health, or genomics
- Scale vertically by adding deeper layers or advanced modules
- Support reproducibility through Snakemake, Docker, and CI/CD
- Enable collaboration via consistent layout and templated setup
Whether youβre building a guide for machine learning or microbiome analysis, the CDI scaffold ensures a smooth, professional experience from start to deployment.