# papua-opensource/dapoer-papoea architecture

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

- Interactive diagram: https://gitdiagram.com/papua-opensource/dapoer-papoea
- Repository: https://github.com/papua-opensource/dapoer-papoea

## Overview

##### Main Components

a) Frontend Architecture:
- Static Site Generator (AstroJS) as the core
- Client-side Components
- Routing System
- Asset Management

b) Data Management:
- JSON Data Store
- Static Content
- Image Assets

**[Client Browser] <---> [Static Host]**

- v
**[Build Process (AstroJS)]**

**[Pages] [Components] [Assets]**

**[Data Store (JSON)]  [Static Files]**

##### Component Relationships

a) Core Components:
- Layout System (src/layouts)
- Page Components (src/pages)
- Reusable Components (src/components)
- Data Sources (src/data)

b) Static Assets:
- Public Directory (public/gambar)
- Image Categories (buku, ilustrasi, menu-harian)

##### Specific Implementation Details

Key architectural elements:
**[File-based Routing]**

- v
**[Pages Layer]**
- Dynamic Routes ([category]/[slug])
- Static Routes (kata-pengantar, tentang)

- v
**[Layout Layer]**
- Base Layout
- Component Composition

- v
**[Component Layer]**
- Navigation (Navbar, ChapterNavigation)
- Content (Hero, ArrowCard)
- Structure (BaseHead, Footer)

- v
**[Data Layer]**
- chapters.json
- recipes.json

##### Build Process Flow

Build process:
**[Source Files] -> [AstroJS Build] -> [Static Output]**

**[TailwindCSS] -> [Optimization] -> [Deployment]**

##### Important Notes

- Static nature of the final output
- Clear separation between build-time and runtime components
- Where TailwindCSS and Preline UI integrate
- Entry points for content management
- How dynamic routing is handled

## Diagram (Mermaid)

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

    subgraph "Static Host"
        StaticOutput["Static Output"]
    end

    subgraph "Build Process"
        AstroJS["AstroJS Build"]:::build
        TailwindCSS["TailwindCSS"]:::build
        PrelineUI["Preline UI"]:::build
        AstroConfig["Astro Config"]:::config
        TailwindConfig["Tailwind Config"]:::config
    end

    subgraph "Core Components"
        LayoutSystem["Layout System"]:::component
        PageComponents["Page Components"]:::component
        DynamicRoutes["Dynamic Routes"]:::component
        StaticRoutes["Static Routes"]:::component
    end

    subgraph "Component Layer"
        Navigation["Navigation Components"]:::component
        Content["Content Components"]:::component
        Structure["Structure Components"]:::component

        NavComponents["Navbar & Chapter Navigation"]:::component
        ContentComponents["Hero & Arrow Card"]:::component
        StructureComponents["BaseHead & Footer"]:::component
    end

    subgraph "Data Layer"
        DataStore["Data Store"]:::data
        ChaptersData["Chapters Data"]:::data
        RecipesData["Recipes Data"]:::data
    end

    subgraph "Static Assets"
        BookImages["Book Images"]:::asset
        Illustrations["Illustrations"]:::asset
        MenuImages["Daily Menu Images"]:::asset
    end

    %% Relationships
    Browser --> StaticOutput
    StaticOutput --> Browser

    AstroJS --> StaticOutput
    TailwindCSS --> AstroJS
    PrelineUI --> AstroJS

    LayoutSystem --> AstroJS
    PageComponents --> AstroJS
    DynamicRoutes --> PageComponents
    StaticRoutes --> PageComponents

    Navigation --> NavComponents
    Content --> ContentComponents
    Structure --> StructureComponents

    NavComponents --> LayoutSystem
    ContentComponents --> LayoutSystem
    StructureComponents --> LayoutSystem

    DataStore --> ChaptersData
    DataStore --> RecipesData
    DataStore --> PageComponents

    BookImages --> StaticOutput
    Illustrations --> StaticOutput
    MenuImages --> StaticOutput

    %% Click Events
    click LayoutSystem "https://github.com/papua-opensource/dapoer-papoea/blob/main/src/layouts/Layout.astro"
    click PageComponents "https://github.com/papua-opensource/dapoer-papoea/tree/main/src/pages"
    click DynamicRoutes "https://github.com/papua-opensource/dapoer-papoea/blob/main/src/pages/[category]/[slug].astro"
    click StaticRoutes "https://github.com/papua-opensource/dapoer-papoea/blob/main/src/pages/kata-pengantar.astro"
    click DataStore "https://github.com/papua-opensource/dapoer-papoea/tree/main/src/data"
    click ChaptersData "https://github.com/papua-opensource/dapoer-papoea/blob/main/src/data/chapters.json"
    click RecipesData "https://github.com/papua-opensource/dapoer-papoea/blob/main/src/data/recipes.json"
    click NavComponents "https://github.com/papua-opensource/dapoer-papoea/blob/main/src/components/Navbar.astro"
    click ContentComponents "https://github.com/papua-opensource/dapoer-papoea/blob/main/src/components/Hero.astro"
    click StructureComponents "https://github.com/papua-opensource/dapoer-papoea/blob/main/src/components/BaseHead.astro"
    click BookImages "https://github.com/papua-opensource/dapoer-papoea/tree/main/public/gambar/buku"
    click Illustrations "https://github.com/papua-opensource/dapoer-papoea/tree/main/public/gambar/ilustrasi"
    click MenuImages "https://github.com/papua-opensource/dapoer-papoea/tree/main/public/gambar/menu-harian"
    click AstroConfig "https://github.com/papua-opensource/dapoer-papoea/blob/main/astro.config.mjs"
    click TailwindConfig "https://github.com/papua-opensource/dapoer-papoea/blob/main/tailwind.config.mjs"

    %% Styles
    classDef component fill:#3498db,stroke:#2980b9,color:white
    classDef data fill:#2ecc71,stroke:#27ae60,color:white
    classDef asset fill:#e67e22,stroke:#d35400,color:white
    classDef build fill:#9b59b6,stroke:#8e44ad,color:white
    classDef config fill:#95a5a6,stroke:#7f8c8d,color:white
```
