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 .Rmd files – Structured Q&A content organized by topic
  • index-*.Rmd – Bookdown entrypoints for building HTML or PDF guides
  • Build scripts – Reproducible automation using combo-build.sh or Makefile
  • 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.