# guardian/dotcom-rendering architecture

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

- Interactive diagram: https://gitdiagram.com/guardian/dotcom-rendering
- Repository: https://github.com/guardian/dotcom-rendering

## Overview

##### High-Level Architecture Overview

a. Client-Side Applications
- Apps Rendering
- Dotcom Rendering
- Shared Components/Libraries

b. Server-Side Components
- Development Servers
- Production Servers
- CDN/Asset Delivery

c. Build & Development Infrastructure
- Webpack Configuration
- Storybook Integration
- Testing Framework

##### Key Components

Frontend Layer:

- Client Applications |

- Apps Rendering       |
- Dotcom Rendering    |
- Shared Components   |

Server Layer:

- Server Components    |

- Article Handlers     |
- Front Handlers       |
- Newsletter Handlers  |

Build System:

- Build Pipeline       |

- Webpack              |
- TypeScript           |
- Storybook           |

##### Component Relationships

Following connections:
- Data flow between client and server components
- Shared resource usage
- Build pipeline dependencies
- Testing infrastructure integration

##### Specific Implementation Details

Specialized components for:
- AMP rendering
- Apps-specific features
- Web-specific features
- Shared utilities and types

##### Development Tools Integration

Integration with:
- Storybook for component development
- Chromatic for visual regression testing
- Jest for unit testing
- Playwright for E2E testing

##### Important Connections

- Component dependencies
- Data flow
- Build process flow
- Testing coverage

##### Deployment Flow

A section showing:
- Build process
- Testing stages
- Deployment targets
- CDN integration

##### Development tooling integration

Remember to:
- Use consistent styling
- Brief descriptions for complex components
- Clear relationships between components

This will provide a comprehensive view of the system while maintaining clarity and usefulness for the principal software engineer.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        AR[Apps Rendering]
        DR[Dotcom Rendering]
        SC[Shared Components]
    end

    subgraph Server
        direction TB
        AH[Article Handlers]
        FH[Front Handlers]
        NH[Newsletter Handlers]
        
        subgraph Development
            DS[Development Servers]
        end
        
        subgraph Production
            PS[Production Servers]
        end
    end

    subgraph Infrastructure
        direction TB
        WP[Webpack]
        SB[Storybook]
        TF[Testing Framework]
    end

    %% Relationships
    AR --> SC
    DR --> SC
    AR --> AH
    DR --> AH
    DR --> FH
    DR --> NH
    AH --> DS
    FH --> DS
    NH --> DS
    AH --> PS
    FH --> PS
    NH --> PS
    WP --> AR
    WP --> DR
    SB --> SC
    TF --> AR
    TF --> DR

    %% Click Events
    click AR "https://github.com/guardian/dotcom-rendering/tree/main/apps-rendering/"
    click DR "https://github.com/guardian/dotcom-rendering/tree/main/dotcom-rendering/"
    click SC "https://github.com/guardian/dotcom-rendering/tree/main/dotcom-rendering/src/components/"
    click AH "https://github.com/guardian/dotcom-rendering/blob/main/dotcom-rendering/src/server/handler.article.web.ts"
    click FH "https://github.com/guardian/dotcom-rendering/blob/main/dotcom-rendering/src/server/handler.front.web.ts"
    click NH "https://github.com/guardian/dotcom-rendering/blob/main/dotcom-rendering/src/server/handler.allEditorialNewslettersPage.web.ts"
    click WP "https://github.com/guardian/dotcom-rendering/tree/main/dotcom-rendering/webpack/"
    click SB "https://github.com/guardian/dotcom-rendering/tree/main/dotcom-rendering/.storybook/"
    click TF "https://github.com/guardian/dotcom-rendering/tree/main/dotcom-rendering/src/components/"
    click DS "https://github.com/guardian/dotcom-rendering/blob/main/dotcom-rendering/src/server/server.dev.ts"
    click PS "https://github.com/guardian/dotcom-rendering/blob/main/dotcom-rendering/src/server/server.prod.ts"

    %% Styling
    classDef client fill:#a8d1ff,stroke:#333,stroke-width:2px
    classDef server fill:#90EE90,stroke:#333,stroke-width:2px
    classDef infra fill:#FFB347,stroke:#333,stroke-width:2px
    
    class AR,DR,SC client
    class AH,FH,NH,DS,PS server
    class WP,SB,TF infra

    %% Legend
    subgraph Legend
        C[Client Components]:::client
        S[Server Components]:::server
        I[Infrastructure]:::infra
    end
```
