# manastech/handbook architecture

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

- Interactive diagram: https://gitdiagram.com/manastech/handbook
- Repository: https://github.com/manastech/handbook

## Overview

##### Main Components Identification

The system should be represented with these primary components:

a) Frontend Application Layer
- Next.js Application
- React Components
- Static Content
- Styling System

b) Content Management Layer
- Markdown Content Structure
- Internationalization System
- Asset Management

**┌─ Client Layer ─────────────────────┐**
- Browser                            │
- ┬───────────────────┘
- ↓
**┌─ Application Layer ────────────────┐**
- Next.js Framework                  │
- Pages Router                   │
- React Components              │
- Style Modules                 │
- ┬───────────────────┘
- ↓
**┌─ Content Layer ───────────────────┐**
- Markdown Files                 │
- English Content            │
- Spanish Content           │
- Static Assets                 │
- ┘

##### Component Relationships

Following interactions:
- Browser → Next.js (HTTP requests)
- Next.js → React Components (Component rendering)
- React Components → Content Layer (Content fetching)
- Style Modules → Components (Styling application)

##### Key Architectural Elements to Highlight

a) Component Structure:
- Core components (FootnoteDefinition, FootnoteReference, Handbook, etc.)
- Navigation system (Nav, LangSelector)
- Content rendering components (Paragraph, Link)

b) Content Organization:
- Bilingual content structure (en/es)
- Chapter-based organization

##### Technical Details

- Next.js as the main framework
- React for component architecture
- CSS Modules for styling
- Markdown for content management
- Multi-language support system

##### Development Workflow

A small section showing:
- GitHub Actions workflow (publish.yml)
- Development server setup
- Content update process

- Component relationships
- Content flow
- Build/deployment process
- Internationalization system

Keep the focus on how the content management system works with the technical implementation, as this is a documentation-focused application rather than a complex web application with multiple services.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Browser"]
    end

    subgraph Application["Application Layer"]
        NextJS["Next.js Core"]:::nextjs
        Router["Pages Router"]:::router
        Components["React Components"]:::components
        Styles["Style System"]:::styles
    end

    subgraph Content["Content Management"]
        MarkdownContent["Markdown Content"]:::content
        subgraph i18n["Internationalization"]
            EnContent["English Content"]:::content
            EsContent["Spanish Content"]:::content
        end
        Assets["Static Assets"]:::assets
    end

    %% Relationships
    Browser --> NextJS
    NextJS --> Router
    Router --> Components
    Components --> MarkdownContent
    Styles --> Components
    Components --> Assets

    %% Component Details
    subgraph CoreComponents["Core Components"]
        Footnotes["Footnote Components"]:::component
        HandbookComp["Handbook Component"]:::component
        Navigation["Navigation System"]:::component
        LangSwitch["Language Selector"]:::component
        ContentRender["Content Renderers"]:::component
    end

    Components --> CoreComponents
    MarkdownContent --> i18n

    %% Legend
    classDef nextjs fill:#1E40AF,color:#fff
    classDef router fill:#2563EB,color:#fff
    classDef components fill:#3B82F6,color:#fff
    classDef styles fill:#60A5FA,color:#fff
    classDef content fill:#F97316,color:#fff
    classDef assets fill:#FB923C,color:#fff
    classDef component fill:#93C5FD,color:#fff

    %% Click Events
    click NextJS "https://github.com/manastech/handbook/blob/master/pages/_app.js"
    click Router "https://github.com/manastech/handbook/blob/master/pages/index.js"
    click Styles "https://github.com/manastech/handbook/blob/master/styles/globals.css"
    click Footnotes "https://github.com/manastech/handbook/blob/master/components/FootnoteDefinition.js"
    click HandbookComp "https://github.com/manastech/handbook/blob/master/components/Handbook.js"
    click Navigation "https://github.com/manastech/handbook/blob/master/components/Nav.js"
    click LangSwitch "https://github.com/manastech/handbook/blob/master/components/LangSelector.js"
    click ContentRender "https://github.com/manastech/handbook/blob/master/components/Paragraph.js"
    click EnContent "https://github.com/manastech/handbook/tree/master/content/en"
    click EsContent "https://github.com/manastech/handbook/tree/master/content/es"
    click Assets "https://github.com/manastech/handbook/tree/master/public/icons"
```
