# riefki-123/bunpin architecture

> Architecture diagram of the GitHub repository riefki-123/bunpin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/riefki-123/bunpin
- Repository: https://github.com/riefki-123/bunpin

## Overview

BundaPintar is a browser-based maternal and child health education and monitoring application. A caregiver uses the Layanan hub to enter child growth measurements or pregnancy dates, review results and history, and complete educational modules and quizzes that award XP and badges. Growth history and gamification state persist in browser local storage. The README also describes BidanBot, but its implementation and connection are not visible in the sampled source; that branch is shown as documented capability only.

Main entry points: [`js/layanan.js`](https://github.com/riefki-123/bunpin/blob/main/js/layanan.js) (Monitoring and learning logic), [`js/store.js`](https://github.com/riefki-123/bunpin/blob/main/js/store.js) (State manager), [`js/main.js`](https://github.com/riefki-123/bunpin/blob/main/js/main.js) (Shared menu), [`layanan.html`](https://github.com/riefki-123/bunpin/blob/main/layanan.html) (Layanan hub)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_home["Home<br/>[index.html]"]
  node_services["Layanan hub<br/>[layanan.html]"]
  node_about["About<br/>[about.html]"]
  node_contact["Contact<br/>[contact.html]"]
  node_shared_ui["Shared menu<br/>[main.js]"]
end

subgraph group_monitoring["Health monitoring"]
  node_health_logic["Monitoring and learning logic<br/>[layanan.js]"]
  node_growth_refs["Growth references<br/>[layanan.js]"]
  node_fetal_tracking["Jejak Janin<br/>[layanan.js]"]
  node_growth_history["Growth history<br/>[layanan.js]"]
end

subgraph group_learning["Education and rewards"]
  node_education_data["Education modules<br/>[data_edukasi.json]"]
  node_academy["Akademi Bunda<br/>[layanan.js]"]
  node_quiz["Module quizzes<br/>[layanan.js]"]
  node_progress["XP and badges<br/>[layanan.js]"]
  node_bidanbot["BidanBot assistant"]
end

subgraph group_state["Local state"]
  node_store["State manager<br/>[store.js]"]
  node_browser_storage[("Local storage")]
end

node_caregiver(("Caregiver"))
node_chartjs["Chart.js"]
node_youtube["YouTube"]
node_caregiver_ai["AI service"]

node_caregiver -->|"opens"| node_home
node_caregiver -->|"uses"| node_services
node_caregiver -->|"opens"| node_about
node_caregiver -->|"opens"| node_contact
node_home -->|"loads"| node_shared_ui
node_services -->|"loads"| node_shared_ui
node_about -->|"loads"| node_shared_ui
node_contact -->|"loads"| node_shared_ui
node_services -->|"loads"| node_health_logic
node_health_logic -->|"checks measurements"| node_growth_refs
node_health_logic -->|"calculates dates"| node_fetal_tracking
node_health_logic -->|"records measurements"| node_growth_history
node_health_logic -->|"reads and updates"| node_store
node_health_logic -->|"renders chart"| node_chartjs
node_health_logic -->|"fetches modules"| node_education_data
node_health_logic -->|"renders modules"| node_academy
node_academy -->|"opens quizzes"| node_quiz
node_quiz -->|"awards XP"| node_store
node_health_logic -->|"updates progress"| node_store
node_health_logic -.->|"links videos"| node_youtube
node_store -->|"reads and writes"| node_browser_storage
node_caregiver -.->|"asks questions"| node_bidanbot
node_bidanbot -.->|"consults"| node_caregiver_ai

click node_home "https://github.com/riefki-123/bunpin/blob/main/index.html"
click node_services "https://github.com/riefki-123/bunpin/blob/main/layanan.html"
click node_about "https://github.com/riefki-123/bunpin/blob/main/about.html"
click node_contact "https://github.com/riefki-123/bunpin/blob/main/contact.html"
click node_shared_ui "https://github.com/riefki-123/bunpin/blob/main/js/main.js"
click node_health_logic "https://github.com/riefki-123/bunpin/blob/main/js/layanan.js"
click node_growth_refs "https://github.com/riefki-123/bunpin/blob/main/js/layanan.js"
click node_fetal_tracking "https://github.com/riefki-123/bunpin/blob/main/js/layanan.js"
click node_growth_history "https://github.com/riefki-123/bunpin/blob/main/js/layanan.js"
click node_education_data "https://github.com/riefki-123/bunpin/blob/main/data_edukasi.json"
click node_academy "https://github.com/riefki-123/bunpin/blob/main/js/layanan.js"
click node_quiz "https://github.com/riefki-123/bunpin/blob/main/js/layanan.js"
click node_progress "https://github.com/riefki-123/bunpin/blob/main/js/layanan.js"
click node_bidanbot "https://github.com/riefki-123/bunpin/tree/main/js"
click node_store "https://github.com/riefki-123/bunpin/blob/main/js/store.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_home,node_services,node_about,node_contact,node_shared_ui toneBlue
class node_health_logic,node_growth_refs,node_fetal_tracking,node_growth_history toneAmber
class node_education_data,node_academy,node_quiz,node_progress,node_bidanbot toneMint
class node_store,node_browser_storage toneRose
class node_caregiver,node_chartjs,node_youtube,node_caregiver_ai toneIndigo
```

## Components

### Web experience

- [Home](https://github.com/riefki-123/bunpin/blob/main/index.html): `index.html`
- [Layanan hub](https://github.com/riefki-123/bunpin/blob/main/layanan.html): `layanan.html`
- [About](https://github.com/riefki-123/bunpin/blob/main/about.html): `about.html`
- [Contact](https://github.com/riefki-123/bunpin/blob/main/contact.html): `contact.html`
- [Shared menu](https://github.com/riefki-123/bunpin/blob/main/js/main.js): `js/main.js`

### Health monitoring

- [Monitoring and learning logic](https://github.com/riefki-123/bunpin/blob/main/js/layanan.js): `js/layanan.js`
- [Growth references](https://github.com/riefki-123/bunpin/blob/main/js/layanan.js): `js/layanan.js`
- [Jejak Janin](https://github.com/riefki-123/bunpin/blob/main/js/layanan.js): `js/layanan.js`
- [Growth history](https://github.com/riefki-123/bunpin/blob/main/js/layanan.js): `js/layanan.js`

### Education and rewards

- [Education modules](https://github.com/riefki-123/bunpin/blob/main/data_edukasi.json): `data_edukasi.json`
- [Akademi Bunda](https://github.com/riefki-123/bunpin/blob/main/js/layanan.js): `js/layanan.js`
- [Module quizzes](https://github.com/riefki-123/bunpin/blob/main/js/layanan.js): `js/layanan.js`
- [XP and badges](https://github.com/riefki-123/bunpin/blob/main/js/layanan.js): `js/layanan.js`
- [BidanBot assistant](https://github.com/riefki-123/bunpin/tree/main/js): `js`

### Local state

- [State manager](https://github.com/riefki-123/bunpin/blob/main/js/store.js): `js/store.js`
- **Local storage**

### Other components

- **Caregiver**
- **Chart.js**
- **YouTube**
- **AI service**

## Connections

- Caregiver → Home: opens
- Caregiver → Layanan hub: uses
- Caregiver → About: opens
- Caregiver → Contact: opens
- Home → Shared menu: loads
- Layanan hub → Shared menu: loads
- About → Shared menu: loads
- Contact → Shared menu: loads
- Layanan hub → Monitoring and learning logic: loads
- Monitoring and learning logic → Growth references: checks measurements
- Monitoring and learning logic → Jejak Janin: calculates dates
- Monitoring and learning logic → Growth history: records measurements
- Monitoring and learning logic → State manager: reads and updates
- Monitoring and learning logic → Chart.js: renders chart
- Monitoring and learning logic → Education modules: fetches modules
- Monitoring and learning logic → Akademi Bunda: renders modules
- Akademi Bunda → Module quizzes: opens quizzes
- Module quizzes → State manager: awards XP
- Monitoring and learning logic → State manager: updates progress
- Monitoring and learning logic → YouTube: links videos
- State manager → Local storage: reads and writes
- Caregiver → BidanBot assistant: asks questions
- BidanBot assistant → AI service: consults
