# europython/website architecture

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

- Interactive diagram: https://gitdiagram.com/europython/website
- Repository: https://github.com/europython/website

## Overview

##### Main components
- Frontend / Presentation Layer: Represented by the Astro-driven UI components and page layouts residing in the src/components, src/layouts, and src/pages directories. These include components such as headers, footers, hero sections, cards, and more.
- Content Management: The content collections housed in src/content (with pages, deadlines, speakers, sessions, etc.) serve as the primary data source for the website pages. Also include src/data (for configurations and additional JSON feeds).
- Build and Configuration Layer: Contains configuration files like astro.config.mjs, tailwind.config.mjs, tsconfig.json, and package.json, which drive the build process. Also include tooling setups like the Makefile, Dockerfile, docker-compose.yml, and various GitHub workflows in the .github/workflows folder.
- CI/CD Pipeline: Indicated by workflows (.github/workflows) and pre-commit configurations, this layer automates builds, deployments, and previews. It integrates with GitHub Actions to run tests, generate previews, and update data.
- Local & Containerized Development Environment: Instructions in the README and files like docker-compose.yml guide setting up a local development environment either directly with pnpm or via containerization (Docker).

##### Relationships and interactions
- The development process begins with the source code maintained in the src directory. When a developer runs “pnpm run dev” or uses Docker (via docker-compose), the Astro build process compiles the content (src/content), UI components (src/components), and layouts (src/layouts) into a static site that incorporates assets from the public directory.
- The CI/CD layer (GitHub Actions workflows) automates build and deployment processes using the configuration files, ensuring that code quality is maintained (pre-commit) and that all updates are previewed and deployed correctly.
- There is an integration between static content and components: the pages pull in mdx/markdown content from the src/content folder while using the defined components in src/components to render consistent UI sections.
- Configuration files and scripts in the root (e.g., Makefile, Dockerfile) orchestrate the entire build and deployment process, tying together dependency management (pnpm and pnpm-lock.yaml), pre-commit quality checks, and Docker-based deployments.

##### Important architectural patterns and design principles
- Component-based UI architecture: Reusable components (organized under src/components) build the interface, making it easier to extend or modify individual pieces of the website.
- Separation of content and presentation: The clear distinction between src/content (data and markdown files) and the Astro components/layouts (presentation) assists in better management and scalability.
- CI/CD and containerization: Docker support (Dockerfile and docker-compose) and predefined GitHub workflows ensure consistency between local development, testing, and production deployments.
- Static Website Generation with Astro: Using Astro as the site generator provides performance benefits and modern web development practices.

##### Essential elements
- Clear labels for major directories/content sections (e.g., "Components", "Pages", "Content", "Static Assets", "Configuration/Build Tools", "CI/CD Pipeline").

## Diagram (Mermaid)

```mermaid
graph TD
    %% Frontend / Presentation Layer
    subgraph "Frontend / Presentation Layer"
        F1("Components"):::frontend
        F2("Layouts"):::frontend
        F3("Pages"):::frontend
    end

    %% Content Management
    subgraph "Content Management"
        CM1("Content"):::content
        CM2("Data"):::content
    end

    %% Static Assets
    SA("Static Assets"):::assets

    %% Build and Configuration
    subgraph "Build and Configuration"
        BC1("Astro Config"):::config
        BC2("Tailwind Config"):::config
        BC3("TS Config"):::config
        BC4("Package.json"):::config
        BC5("Makefile"):::config
        BC6("Dockerfile"):::config
        BC7("Docker Compose"):::config
        BC8("GitHub Workflows"):::config
        Aggregator_BC("Build Config"):::config
    end

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        CICD1("GitHub Workflows"):::cicd
        CICD2("Pre-commit Config"):::cicd
        Aggregator_CICD("CI/CD Triggers"):::cicd
    end

    %% Local & Containerized Development
    subgraph "Local & Containerized Dev"
        LD1("Docker Compose"):::dev
        LD2("Dockerfile"):::dev
        LD3("README.md"):::dev
        Aggregator_LD("Local Dev Triggers"):::dev
    end

    %% Astro Build Process and Output
    ABP("Astro Build Process"):::final
    FS("Static Website"):::final

    %% Connections from Frontend to Astro Build Process
    F1 -->|"UIComponents"| ABP
    F2 -->|"UIComponents"| ABP
    F3 -->|"UIComponents"| ABP

    %% Connections from Content Management to Astro Build Process
    CM1 -->|"ContentData"| ABP
    CM2 -->|"ContentData"| ABP

    %% Connection from Static Assets to Astro Build Process
    SA -->|"StaticFiles"| ABP

    %% Build and Configuration aggregation
    BC1 --> Aggregator_BC
    BC2 --> Aggregator_BC
    BC3 --> Aggregator_BC
    BC4 --> Aggregator_BC
    BC5 --> Aggregator_BC
    BC6 --> Aggregator_BC
    BC7 --> Aggregator_BC
    BC8 --> Aggregator_BC
    Aggregator_BC -->|"BuildConfig"| ABP

    %% CI/CD Pipeline aggregation
    CICD1 --> Aggregator_CICD
    CICD2 --> Aggregator_CICD
    Aggregator_CICD -->|"CI/CDTrigger"| ABP

    %% Local & Containerized Development aggregation
    LD1 --> Aggregator_LD
    LD2 --> Aggregator_LD
    LD3 --> Aggregator_LD
    Aggregator_LD -->|"LocalDevTrigger"| ABP

    %% Final build output
    ABP -->|"CompiledOutput"| FS

    %% Click Events
    click F1 "https://github.com/europython/website/tree/ep2025/src/components"
    click F2 "https://github.com/europython/website/tree/ep2025/src/layouts"
    click F3 "https://github.com/europython/website/tree/ep2025/src/pages"
    click CM1 "https://github.com/europython/website/tree/ep2025/src/content"
    click CM2 "https://github.com/europython/website/tree/ep2025/src/data"
    click SA "https://github.com/europython/website/tree/ep2025/public"
    click BC1 "https://github.com/europython/website/blob/ep2025/astro.config.mjs"
    click BC2 "https://github.com/europython/website/blob/ep2025/tailwind.config.mjs"
    click BC3 "https://github.com/europython/website/blob/ep2025/tsconfig.json"
    click BC4 "https://github.com/europython/website/blob/ep2025/package.json"
    click BC5 "https://github.com/europython/website/tree/ep2025/Makefile"
    click BC6 "https://github.com/europython/website/tree/ep2025/Dockerfile"
    click BC7 "https://github.com/europython/website/blob/ep2025/docker-compose.yml"
    click BC8 "https://github.com/europython/website/tree/ep2025/.github/workflows"
    click CICD1 "https://github.com/europython/website/tree/ep2025/.github/workflows"
    click CICD2 "https://github.com/europython/website/blob/ep2025/.pre-commit-config.yaml"
    click LD1 "https://github.com/europython/website/blob/ep2025/docker-compose.yml"
    click LD2 "https://github.com/europython/website/tree/ep2025/Dockerfile"
    click LD3 "https://github.com/europython/website/blob/ep2025/README.md"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef content fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef assets fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef config fill:#ffeeba,stroke:#856404,stroke-width:2px;
    classDef cicd fill:#f5c6cb,stroke:#721c24,stroke-width:2px;
    classDef dev fill:#d1ecf1,stroke:#0c5460,stroke-width:2px;
    classDef final fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;
```
