# tascott/london-doodles-decap architecture

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

- Interactive diagram: https://gitdiagram.com/tascott/london-doodles-decap
- Repository: https://github.com/tascott/london-doodles-decap

## Overview

##### Analyzing the File Structure
- The top-level files and directories (e.g., next.config.js, pages, public, styles, and content) clearly indicate a traditional Next.js project structure:
- The “pages” directory contains the application’s entry points (_app.js, _document.js, index.js).
- The “public” folder includes static assets such as the admin interface (with its own README, config.yml, and index.html) plus images.
- The “content” directory holds Markdown files, the source of dynamic content for the site.
- The “styles” folder contains SCSS files structured using a modular approach (variables, mixins, and component-specific styles).
- There is an emphasis on modern SCSS architecture and configuration files that indicate deployment on Netlify with continuous integration.

##### Main Components
a. Next.js Frontend:
- Core Next.js application. Label it clearly and include subcomponents like:
- Pages and routing (pages/_app.js, _document.js, index.js)
- Styling layer (SCSS files, including globals.scss and component-specific styles)
- Image optimization (Next.js Image component)
b. Content Management System:
- The admin interface served from public/admin (with its config.yml and index.html).
- Its connection to the content stored as Markdown in the content folder.
- Instructions in the README about local development with npx netlify-cms-proxy-server.
c. External Services and Integrations:
- Integration with:
- Formspree for the contact form.
- Netlify Identity for authentication.
d. Deployment and Build Pipeline:
- That the site is continuously deployed on Netlify.
- That any CMS updates or commit pushes trigger a new build.

##### Architectural Relationships and Interactions
- From the content management system (Decap CMS) to the “content” folder, indicating that editors update markdown content.
- From the Next.js application to static assets (from public/images and CSS assets) and from API calls (if any) to formspree.
- From the user interacting with the front-end (responsive design) to backend integrations (CMS and external services).
- Deployment flow from GitHub → Netlify (continuous deployment).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Nodes
    User("User (Browser)"):::user

    %% Next.js Frontend Layer
    subgraph "Next.js Frontend"
        NextApp("Next.js Application"):::frontend

        subgraph "Pages & Routing"
            App("pages/_app.js"):::frontend
            Document("pages/_document.js"):::frontend
            Index("pages/index.js"):::frontend
        end

        subgraph "Styling Layer"
            Globals("styles/globals.scss"):::frontend
            Components("styles/components/"):::frontend
        end

        ImageOpt("Next.js Image Optimization"):::frontend

        NextApp -->|"uses"| App
        NextApp -->|"uses"| Document
        NextApp -->|"uses"| Index
        NextApp -->|"applies"| Globals
        NextApp -->|"applies"| Components
        NextApp -->|"optimizes"| ImageOpt
    end

    %% Content Management System Layer
    subgraph "Content Management System"
        CMSAdmin("Decap CMS Admin Interface"):::cms
        subgraph "Admin Files"
            AdminConfig("public/admin/config.yml"):::cms
            AdminIndex("public/admin/index.html"):::cms
            AdminReadme("public/admin/README.md"):::cms
        end
        Content("Content (Markdown Files)"):::cms

        CMSAdmin -->|"includes"| AdminConfig
        CMSAdmin -->|"includes"| AdminIndex
        CMSAdmin -->|"includes"| AdminReadme
        CMSAdmin -->|"updates"| Content
    end

    %% External Services and Integrations
    subgraph "External Services & Integrations"
        Formspree("Formspree (Contact Form)"):::external
        NetlifyID("Netlify Identity (Authentication)"):::external
        GoogleFonts("Google Fonts"):::external
        MaterialIcons("Material Icons"):::external
    end

    %% Deployment Pipeline
    subgraph "Deployment Pipeline"
        Repo("GitHub Repository"):::deploy
        Netlify("Netlify Deployment"):::deploy
        Repo -->|"triggers_build"| Netlify
    end

    %% Interactions between Components
    User -->|"interacts"| NextApp
    NextApp -->|"renders_content_from"| Content
    NextApp -->|"integrates_with"| Formspree
    NextApp -->|"integrates_with"| NetlifyID
    NextApp -->|"loads"| GoogleFonts
    NextApp -->|"loads"| MaterialIcons
    CMSAdmin -->|"triggers_build"| Repo

    %% Click Events for Component Mapping
    click App "https://github.com/tascott/london-doodles-decap/blob/main/pages/_app.js"
    click Document "https://github.com/tascott/london-doodles-decap/blob/main/pages/_document.js"
    click Index "https://github.com/tascott/london-doodles-decap/blob/main/pages/index.js"
    click Globals "https://github.com/tascott/london-doodles-decap/blob/main/styles/globals.scss"
    click Components "https://github.com/tascott/london-doodles-decap/tree/main/styles/components/"
    click AdminConfig "https://github.com/tascott/london-doodles-decap/blob/main/public/admin/config.yml"
    click AdminIndex "https://github.com/tascott/london-doodles-decap/blob/main/public/admin/index.html"
    click AdminReadme "https://github.com/tascott/london-doodles-decap/blob/main/public/admin/README.md"
    click Content "https://github.com/tascott/london-doodles-decap/blob/main/content/home.md"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef cms fill:#FADBD8,stroke:#000,stroke-width:2px;
    classDef external fill:#D5F5E3,stroke:#000,stroke-width:2px;
    classDef deploy fill:#F9E79F,stroke:#000,stroke-width:2px;
    classDef user fill:#D6EAF8,stroke:#000,stroke-width:2px;
```
