# rstudio/demo-co-quarto-report architecture

> Architecture diagram of the GitHub repository rstudio/demo-co-quarto-report, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rstudio/demo-co-quarto-report
- Repository: https://github.com/rstudio/demo-co-quarto-report

## Overview

1. **What this repo is**
   - This is a **Quarto document project** that produces a customer churn report for “DemoCo.”
   - The architecture is centered on a single source document, with supporting data, styling, and publication assets around it.

2. **Primary entrypoint**
   - `churn_report.qmd` is the main application surface.
   - It contains the analysis narrative, code execution chunks, plots/tables, and the report parameter that switches the product segment being shown.

3. **Data layer**
   - `data/churn.csv` is the report’s core input dataset.
   - `data/churn.R` is likely the data preparation or generation script for that CSV, separating raw/derived data logic from the report itself.
   - The report reads from this static data source rather than a live database or API.

4. **Execution and rendering flow**
   - Quarto executes the R code embedded in `churn_report.qmd`, transforms the results into a formatted document, then renders either HTML or PDF.
   - The repo includes a rendered artifact, `churn_report.pdf`, which indicates the output is checked in alongside the source.

5. **Parameterized report boundary**
   - The report is parameterized by `product` with values `Standard`, `Premium`, and `Professional`.
   - This makes the report behave like a small configurable application: the same source document produces different outputs depending on runtime parameter input.

6. **Output formats**
   - The project produces two distinct deliverables: an **HTML report** and a **PDF report**.
   - The README shows these are rendered as named Quarto targets (`democo-html` and `democo-pdf`), so the document has format-specific behavior rather than a single universal theme.

7. **Custom Quarto extension layer**
   - `_extensions/democo` contains the custom Quarto formatting package used by the report.
   - This is the main presentation boundary: it encapsulates shared branding and layout logic so the report content stays separate from theme implementation.

8. **HTML-specific theming**
   - Files like `custom.scss`, `logo.html`, `pagestyle.tex`, and `view-on-github.html` suggest the extension controls branding, page chrome, and navigation/utility elements.
   - `SourceSans3/` provides bundled font assets, which means the report’s visual identity does not depend on external font availability.

9. **PDF-specific theming**
   - `demopdf.tex` and related files define the PDF layout and color system.
   - The README notes separate logo assets for HTML and PDF, which means the HTML and PDF outputs are intentionally styled as different presentation targets sharing the same content source.

10. **Branding and assets**
   - `images/` contains report visuals such as screenshots and the published report diagram.
   - These assets support both documentation and in-report branding, but they are not part of the data pipeline itself.

11. **Development and environment setup**
   - `.Rproj` and `.Rprofile` indicate an R/Posit-oriented project workspace.
   - The intended authoring environment is RStudio/Posit tooling, with Quarto handling the document build process.

12. **Publishing/deployment path**
   - The README shows the report is published to **Posit Connect** and can be scheduled weekly there.
   - That means the deployment boundary is document publishing, not an application server: source code is rendered into static output and then hosted/scheduled by Connect.

13. **Repo architecture in one sentence**
   - The repo is a **parameterized Quarto reporting pipeline**: static churn data feeds a single report source, custom Quarto extensions control branding and format-specific output, and the rendered HTML/PDF reports are optionally published to Posit Connect.

Main entry points: [`churn_report.qmd`](https://github.com/rstudio/demo-co-quarto-report/blob/main/churn_report.qmd) (Churn report), [`README.md`](https://github.com/rstudio/demo-co-quarto-report/blob/main/README.md) (README), [`_extensions/democo/SourceSans3`](https://github.com/rstudio/demo-co-quarto-report/tree/main/_extensions/democo/SourceSans3) (Source Sans), [`data/churn.csv`](https://github.com/rstudio/demo-co-quarto-report/blob/main/data/churn.csv) (Churn data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g_report["Report"]
  node_n_qmd["Churn report<br/>Quarto source<br/>[churn_report.qmd]"]
  node_n_pdf["PDF report<br/>Rendered output<br/>[churn_report.pdf]"]
  node_n_quarto["Quarto config<br/>Build config<br/>[_quarto.yml]"]
end

subgraph group_g_data["Data"]
  node_n_csv[("Churn data<br/>Static dataset<br/>[churn.csv]")]
  node_n_data_r["Data script<br/>R prep<br/>[churn.R]"]
end

subgraph group_g_extension["Extension"]
  node_n_ext_yml["Extension config<br/>Quarto extension<br/>[_extension.yml]"]
  node_n_scss["HTML theme<br/>Stylesheet<br/>[custom.scss]"]
  node_n_logo_html["HTML logo<br/>Brand asset<br/>[logo.html]"]
  node_n_view_github["GitHub link<br/>UI fragment"]
  node_n_pagestyle["PDF page style<br/>TeX include<br/>[pagestyle.tex]"]
  node_n_demopdf_tex["PDF theme<br/>TeX template<br/>[demopdf.tex]"]
  node_n_fonts["Source Sans<br/>Font bundle"]
end

subgraph group_g_publishing["Publishing"]
  node_n_readme["README<br/>Usage guide<br/>[README.md]"]
  node_n_connect(("Posit Connect<br/>Publish target"))
  node_n_images["Images<br/>Asset folder"]
end

subgraph group_g_workspace["Workspace"]
  node_n_rproj["Project"]
  node_n_rprofile["Startup profile<br/>R config<br/>[.Rprofile]"]
end

node_n_data_r -->|"generates"| node_n_csv
node_n_csv -->|"feeds"| node_n_qmd
node_n_qmd -->|"renders"| node_n_pdf
node_n_quarto -->|"builds"| node_n_qmd
node_n_ext_yml -->|"extends"| node_n_qmd
node_n_scss -->|"styles"| node_n_qmd
node_n_logo_html -->|"brands"| node_n_qmd
node_n_view_github -->|"augments"| node_n_qmd
node_n_demopdf_tex -->|"formats"| node_n_qmd
node_n_pagestyle -->|"formats"| node_n_qmd
node_n_fonts -->|"supports"| node_n_scss
node_n_fonts -->|"supports"| node_n_demopdf_tex
node_n_images -->|"illustrates"| node_n_readme
node_n_readme -->|"describes"| node_n_connect
node_n_rproj -->|"loads"| node_n_rprofile
node_n_readme -->|"documents"| node_n_qmd
node_n_qmd -->|"publishes"| node_n_connect

click node_n_qmd "https://github.com/rstudio/demo-co-quarto-report/blob/main/churn_report.qmd"
click node_n_pdf "https://github.com/rstudio/demo-co-quarto-report/blob/main/churn_report.pdf"
click node_n_csv "https://github.com/rstudio/demo-co-quarto-report/blob/main/data/churn.csv"
click node_n_data_r "https://github.com/rstudio/demo-co-quarto-report/blob/main/data/churn.R"
click node_n_ext_yml "https://github.com/rstudio/demo-co-quarto-report/blob/main/_extensions/democo/_extension.yml"
click node_n_scss "https://github.com/rstudio/demo-co-quarto-report/blob/main/_extensions/democo/custom.scss"
click node_n_logo_html "https://github.com/rstudio/demo-co-quarto-report/blob/main/_extensions/democo/logo.html"
click node_n_view_github "https://github.com/rstudio/demo-co-quarto-report/blob/main/_extensions/democo/view-on-github.html"
click node_n_pagestyle "https://github.com/rstudio/demo-co-quarto-report/blob/main/_extensions/democo/pagestyle.tex"
click node_n_demopdf_tex "https://github.com/rstudio/demo-co-quarto-report/blob/main/_extensions/democo/demopdf.tex"
click node_n_fonts "https://github.com/rstudio/demo-co-quarto-report/tree/main/_extensions/democo/SourceSans3"
click node_n_readme "https://github.com/rstudio/demo-co-quarto-report/blob/main/README.md"
click node_n_rproj "https://github.com/rstudio/demo-co-quarto-report/blob/main/demo-co-quarto-report.Rproj"
click node_n_rprofile "https://github.com/rstudio/demo-co-quarto-report/blob/main/.Rprofile"
click node_n_quarto "https://github.com/rstudio/demo-co-quarto-report/blob/main/_quarto.yml"
click node_n_images "https://github.com/rstudio/demo-co-quarto-report/tree/main/images"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_n_qmd,node_n_pdf,node_n_quarto toneBlue
class node_n_csv,node_n_data_r toneAmber
class node_n_ext_yml,node_n_scss,node_n_logo_html,node_n_view_github,node_n_pagestyle,node_n_demopdf_tex,node_n_fonts toneMint
class node_n_readme,node_n_connect,node_n_images toneRose
class node_n_rproj,node_n_rprofile toneIndigo
```

## Components

### Report

Primary Quarto source and rendered deliverables

- [Churn report](https://github.com/rstudio/demo-co-quarto-report/blob/main/churn_report.qmd): Quarto source · Parameterized report with narrative, analysis code, and format-specific content · `churn_report.qmd`
- [PDF report](https://github.com/rstudio/demo-co-quarto-report/blob/main/churn_report.pdf): Rendered output · Checked-in rendered PDF artifact · `churn_report.pdf`
- [Quarto config](https://github.com/rstudio/demo-co-quarto-report/blob/main/_quarto.yml): Build config · Project-level Quarto build settings · `_quarto.yml`

### Data

Static input dataset and its preparation script

- [Churn data](https://github.com/rstudio/demo-co-quarto-report/blob/main/data/churn.csv): Static dataset · Core input data used by the report · `data/churn.csv`
- [Data script](https://github.com/rstudio/demo-co-quarto-report/blob/main/data/churn.R): R prep · Script that prepares or generates the churn dataset · `data/churn.R`

### Extension

Custom Quarto branding and format layer

- [Extension config](https://github.com/rstudio/demo-co-quarto-report/blob/main/_extensions/democo/_extension.yml): Quarto extension · Extension manifest for the Democo branding package · `_extensions/democo/_extension.yml`
- [HTML theme](https://github.com/rstudio/demo-co-quarto-report/blob/main/_extensions/democo/custom.scss): Stylesheet · Custom HTML styling and branding rules · `_extensions/democo/custom.scss`
- [HTML logo](https://github.com/rstudio/demo-co-quarto-report/blob/main/_extensions/democo/logo.html): Brand asset · HTML logo or header markup used by the extension · `_extensions/democo/logo.html`
- [GitHub link](https://github.com/rstudio/demo-co-quarto-report/blob/main/_extensions/democo/view-on-github.html): UI fragment · Navigation or utility fragment for the report chrome · `_extensions/democo/view-on-github.html`
- [PDF page style](https://github.com/rstudio/demo-co-quarto-report/blob/main/_extensions/democo/pagestyle.tex): TeX include · PDF page styling and layout customization · `_extensions/democo/pagestyle.tex`
- [PDF theme](https://github.com/rstudio/demo-co-quarto-report/blob/main/_extensions/democo/demopdf.tex): TeX template · PDF layout and color system for the extension · `_extensions/democo/demopdf.tex`
- [Source Sans](https://github.com/rstudio/demo-co-quarto-report/tree/main/_extensions/democo/SourceSans3): Font bundle · Bundled font assets for consistent rendering · `_extensions/democo/SourceSans3`

### Publishing

Documentation and deployment targets

- [README](https://github.com/rstudio/demo-co-quarto-report/blob/main/README.md): Usage guide · Explains rendering targets, branding, and Posit Connect publishing · `README.md`
- **Posit Connect**: Publish target · Scheduled hosting and publication boundary described in the documentation
- [Images](https://github.com/rstudio/demo-co-quarto-report/tree/main/images): Asset folder · Supporting visuals used by the report and documentation · `images`

### Workspace

R/Posit project setup

- [Project](https://github.com/rstudio/demo-co-quarto-report/blob/main/demo-co-quarto-report.Rproj): RStudio project · Workspace entrypoint for Posit/R authoring · `demo-co-quarto-report.Rproj`
- [Startup profile](https://github.com/rstudio/demo-co-quarto-report/blob/main/.Rprofile): R config · Project startup and environment configuration · `.Rprofile`

## Connections

- Data script → Churn data: generates · Preparation script produces the static dataset
- Churn data → Churn report: feeds · Report reads the churn data as its primary input
- Churn report → PDF report: renders · Quarto executes the report and emits a PDF artifact
- Quarto config → Churn report: builds · Project configuration drives report rendering
- Extension config → Churn report: extends · Custom extension provides shared formatting to the report
- HTML theme → Churn report: styles · HTML branding and visual theme are applied during render
- HTML logo → Churn report: brands · HTML markup contributes report identity
- GitHub link → Churn report: augments · Utility/navigation fragment adds report chrome
- PDF theme → Churn report: formats · PDF template controls the print layout
- PDF page style → Churn report: formats · PDF page styling is injected into the document build
- Source Sans → HTML theme: supports · Bundled fonts keep HTML rendering self-contained
- Source Sans → PDF theme: supports · Fonts also back the PDF presentation layer
- Images → README: illustrates · Screenshots and visual assets support documentation
- README → Posit Connect: describes · Documentation explains publication and scheduling on Posit Connect
- Project → Startup profile: loads · Project workspace uses startup configuration
- README → Churn report: documents · README explains the report targets and parameterized workflow
- Churn report → Posit Connect: publishes · Rendered report can be deployed to Connect as a static deliverable
