# marp-team/marp architecture

> Architecture diagram of the GitHub repository marp-team/marp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/marp-team/marp
- Repository: https://github.com/marp-team/marp

## Overview

##### Project type and purpose
- This is the **Marp entrance repository**, primarily hosting the **public website** (`/website`) for the Marp ecosystem.
- The website is a **Next.js-based** static/SSR React application that renders documentation, blog posts, and landing pages. It uses Markdown files under `/website/docs` and `/website/blog` as content sources.

##### File structure
- **Top-level files & configs** (root):
- CI/CD: `.github/workflows/test.yml` (GitHub Actions)
- Deployment: `netlify.toml` (Netlify)
- Linting/formatting: `.eslintrc.js`, `.prettierrc`, `.editorconfig`
- TypeScript: `tsconfig.json`
- **Website folder** (`/website`):
- `pages/` – Next.js page routes (`index.tsx`, `blog/[slug].tsx`, `docs/[[...slug]].tsx`)
- `components/` – Reusable React components (UI, blog, docs, Markdown renderers)
- `utils/markdown/` – Custom Markdown parser & renderer modules
- `public/` – Static assets (images, videos, blog–specific files)
- `css/`, `postcss.config.js`, `tailwind.config.js` – Styling with Tailwind CSS + PostCSS
- Environment: `.env.development`, `.env.production`

##### README for additional insights
- Confirms that `/website` is the official web front for Marp.
- Encourages contributions and points to ecosystem projects, but no deep architecture description is given.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Actor
    Developer["Developer"]:::external

    %% Source Code Repository
    Developer -->|"push code"| GitHub["GitHub Repo"]:::external

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        direction TB
        GitHub -->|triggers| GH_Actions["GitHub Actions\n(test.yml)"]:::pipeline
        GH_Actions -->|on success| Netlify_Build["Netlify Build\n(netlify.toml)"]:::pipeline
    end

    %% Build Process
    subgraph "Next.js Build Process"
        direction TB

        subgraph "Content Sources" 
            direction TB
            DocsMD["Documentation Markdown"]:::source
            BlogMD["Blog Markdown"]:::source
            Assets["Static Assets\n(images, videos)"]:::source
        end

        DocsMD --> Parser["Markdown Parser & Utilities"]:::source
        BlogMD --> Parser
        Assets --> NextBuild["Next.js Build"]:::pipeline

        click DocsMD "https://github.com/marp-team/marp/tree/main/website/docs"
        click BlogMD "https://github.com/marp-team/marp/tree/main/website/blog"
        click Assets "https://github.com/marp-team/marp/tree/main/website/public/assets"
        click Parser "https://github.com/marp-team/marp/tree/main/website/utils/markdown"

        subgraph "App Components"
            direction TB
            Pages["Next.js Page Routes"]:::source
            Components["React Components\n(UI & Layout)"]:::source
            MD_Components["Markdown Renderers"]:::source
            Docs_Components["Docs Components"]:::source
            Blog_Components["Blog Components"]:::source
            Top_Components["Top Landing Components"]:::source
            Utilities["Date Util"]:::source
            URL_Util["URL Util"]:::source
            Hooks["Custom Hooks"]:::source
        end

        click Pages "https://github.com/marp-team/marp/tree/main/website/pages"
        click Components "https://github.com/marp-team/marp/tree/main/website/components"
        click MD_Components "https://github.com/marp-team/marp/tree/main/website/components/markdown"
        click Docs_Components "https://github.com/marp-team/marp/tree/main/website/components/docs"
        click Blog_Components "https://github.com/marp-team/marp/tree/main/website/components/blog"
        click Top_Components "https://github.com/marp-team/marp/tree/main/website/components/top"
        click Utilities "https://github.com/marp-team/marp/blob/main/website/utils/date.ts"
        click URL_Util "https://github.com/marp-team/marp/blob/main/website/utils/url.ts"
        click Hooks "https://github.com/marp-team/marp/tree/main/website/utils/hooks"

        Parser --> MD_Components
        MD_Components --> NextBuild
        Pages --> NextBuild
        Components --> NextBuild
        Docs_Components --> NextBuild
        Blog_Components --> NextBuild
        Top_Components --> NextBuild
        Utilities --> NextBuild
        URL_Util --> NextBuild
        Hooks --> NextBuild

        subgraph "Styling Pipeline"
            direction TB
            TailwindCSS["Tailwind CSS"]:::source
            PostCSS["PostCSS Config"]:::source
            TW_Config["Tailwind Config"]:::source
        end

        click TailwindCSS "https://github.com/marp-team/marp/blob/main/website/css/index.css"
        click PostCSS "https://github.com/marp-team/marp/blob/main/website/postcss.config.js"
        click TW_Config "https://github.com/marp-team/marp/blob/main/website/tailwind.config.js"

        TailwindCSS --> NextBuild
        PostCSS --> NextBuild
        TW_Config --> NextBuild
    end

    %% Deployment & Hosting
    Netlify_Build -->|"builds static site"| NextBuild
    NextBuild -->|"publish assets"| CDN["Netlify CDN"]:::hosting
    CDN -->|"serves content"| EndUsers["End Users"]:::external

    %% Config & Linting (Optional)
    subgraph "Configs & Tooling"
        direction TB
        TS_Root["TS Config (root)"]:::source
        TS_Web["TS Config (website)"]:::source
        ESLint_Root["ESLint Config (root)"]:::source
        ESLint_Web["ESLint Config (website)"]:::source
        Prettier["Prettier Config"]:::source
        NextConfig["Next.js Config"]:::source
        EnvDev["Env Dev"]:::source
        EnvProd["Env Prod"]:::source
    end

    click TS_Root "https://github.com/marp-team/marp/blob/main/tsconfig.json"
    click TS_Web "https://github.com/marp-team/marp/blob/main/website/tsconfig.json"
    click ESLint_Root "https://github.com/marp-team/marp/blob/main/.eslintrc.js"
    click ESLint_Web "https://github.com/marp-team/marp/blob/main/website/.eslintrc.js"
    click Prettier "https://github.com/marp-team/marp/blob/main/.prettierrc"
    click NextConfig "https://github.com/marp-team/marp/blob/main/website/next.config.js"
    click EnvDev "https://github.com/marp-team/marp/blob/main/website/.env.development"
    click EnvProd "https://github.com/marp-team/marp/blob/main/website/.env.production"

    Netlify_Build --> Configs["Configs & Tooling"]

    %% Styles
    classDef source fill:#BBDEFB,stroke:#1E88E5,stroke-width:2px
    classDef pipeline fill:#C8E6C9,stroke:#388E3C,stroke-width:2px
    classDef hosting fill:#FFE0B2,stroke:#FB8C00,stroke-width:2px
    classDef external fill:#E0E0E0,stroke:#757575,stroke-width:2px
```
