# adynu182/manage-obat architecture

> Architecture diagram of the GitHub repository adynu182/manage-obat, 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/adynu182/manage-obat
- Repository: https://github.com/adynu182/manage-obat

## Overview

Pantau Obat is a per-account medication and stock dashboard. Users sign in, configure medicines and dose schedules, then record doses; dose completion updates stock and date-specific adherence history. The app also supports stock corrections and restocking, daily notes, and printing a summary. The runtime is concentrated in app.js, with UI markup in index.html and Firebase settings in firebase-config.js. The README is empty and the source excerpts are partial, so the diagram shows only documented capabilities and evidenced Firebase interactions.

Main entry points: [`app.js`](https://github.com/adynu182/manage-obat/blob/main/app.js) (App runtime), [`index.html`](https://github.com/adynu182/manage-obat/blob/main/index.html) (Dashboard UI), [`firebase-config.js`](https://github.com/adynu182/manage-obat/blob/main/firebase-config.js) (Firebase config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Dashboard interface"]
  node_markup["Dashboard UI<br/>[index.html]"]
  node_runtime["App runtime<br/>[app.js]"]
  node_account["Account access<br/>[app.js]"]
  node_daily_notes["Daily notes<br/>[app.js]"]
  node_print_summary["Printable summary<br/>[app.js]"]
end

subgraph group_medication["Medication tracking"]
  node_med_catalog["Medicine definitions<br/>[app.js]"]
  node_schedule["Dose schedule<br/>[app.js]"]
  node_dose_log["Dose tracking<br/>[app.js]"]
  node_adherence["Adherence history<br/>[app.js]"]
end

subgraph group_inventory["Stock management"]
  node_stock["Stock tracking<br/>[app.js]"]
  node_restock["Restock records<br/>[app.js]"]
end

subgraph group_platform["Firebase services"]
  node_firebase_config["Firebase config<br/>[firebase-config.js]"]
  node_firebase_app["Firebase app"]
  node_auth["Firebase Auth"]
  node_firestore[("Firestore user data")]
end

node_user(("User"))

node_user -->|"uses"| node_markup
node_markup -->|"events"| node_runtime
node_firebase_config -->|"provides settings"| node_runtime
node_runtime -->|"initializes"| node_firebase_app
node_runtime -->|"authenticates"| node_auth
node_runtime -->|"reads and writes"| node_firestore
node_runtime -->|"handles"| node_account
node_runtime -->|"manages"| node_med_catalog
node_runtime -->|"manages"| node_schedule
node_runtime -->|"records doses"| node_dose_log
node_runtime -->|"computes history"| node_adherence
node_runtime -->|"saves notes"| node_daily_notes
node_runtime -->|"updates stock"| node_stock
node_runtime -->|"records restocks"| node_restock
node_runtime -->|"builds print view"| node_print_summary
node_account -->|"sign-in and reset"| node_auth
node_dose_log -->|"deducts quantities"| node_stock

click node_markup "https://github.com/adynu182/manage-obat/blob/main/index.html"
click node_runtime "https://github.com/adynu182/manage-obat/blob/main/app.js"
click node_firebase_config "https://github.com/adynu182/manage-obat/blob/main/firebase-config.js"
click node_account "https://github.com/adynu182/manage-obat/blob/main/app.js"
click node_med_catalog "https://github.com/adynu182/manage-obat/blob/main/app.js"
click node_schedule "https://github.com/adynu182/manage-obat/blob/main/app.js"
click node_dose_log "https://github.com/adynu182/manage-obat/blob/main/app.js"
click node_adherence "https://github.com/adynu182/manage-obat/blob/main/app.js"
click node_daily_notes "https://github.com/adynu182/manage-obat/blob/main/app.js"
click node_stock "https://github.com/adynu182/manage-obat/blob/main/app.js"
click node_restock "https://github.com/adynu182/manage-obat/blob/main/app.js"
click node_print_summary "https://github.com/adynu182/manage-obat/blob/main/app.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_markup,node_runtime,node_account,node_daily_notes,node_print_summary,node_user toneBlue
class node_med_catalog,node_schedule,node_dose_log,node_adherence toneAmber
class node_stock,node_restock toneMint
class node_firebase_config,node_firebase_app,node_auth,node_firestore toneRose
```

## Components

### Dashboard interface

- [Dashboard UI](https://github.com/adynu182/manage-obat/blob/main/index.html): `index.html`
- [App runtime](https://github.com/adynu182/manage-obat/blob/main/app.js): `app.js`
- [Account access](https://github.com/adynu182/manage-obat/blob/main/app.js): `app.js`
- [Daily notes](https://github.com/adynu182/manage-obat/blob/main/app.js): `app.js`
- [Printable summary](https://github.com/adynu182/manage-obat/blob/main/app.js): `app.js`

### Medication tracking

- [Medicine definitions](https://github.com/adynu182/manage-obat/blob/main/app.js): `app.js`
- [Dose schedule](https://github.com/adynu182/manage-obat/blob/main/app.js): `app.js`
- [Dose tracking](https://github.com/adynu182/manage-obat/blob/main/app.js): `app.js`
- [Adherence history](https://github.com/adynu182/manage-obat/blob/main/app.js): `app.js`

### Stock management

- [Stock tracking](https://github.com/adynu182/manage-obat/blob/main/app.js): `app.js`
- [Restock records](https://github.com/adynu182/manage-obat/blob/main/app.js): `app.js`

### Firebase services

- [Firebase config](https://github.com/adynu182/manage-obat/blob/main/firebase-config.js): `firebase-config.js`
- **Firebase app**
- **Firebase Auth**
- **Firestore user data**

### Other components

- **User**

## Connections

- User → Dashboard UI: uses
- Dashboard UI → App runtime: events
- Firebase config → App runtime: provides settings
- App runtime → Firebase app: initializes
- App runtime → Firebase Auth: authenticates
- App runtime → Firestore user data: reads and writes
- App runtime → Account access: handles
- App runtime → Medicine definitions: manages
- App runtime → Dose schedule: manages
- App runtime → Dose tracking: records doses
- App runtime → Adherence history: computes history
- App runtime → Daily notes: saves notes
- App runtime → Stock tracking: updates stock
- App runtime → Restock records: records restocks
- App runtime → Printable summary: builds print view
- Account access → Firebase Auth: sign-in and reset
- Dose tracking → Stock tracking: deducts quantities
