# souvik-dey-2029/medicine-reminder architecture

> Architecture diagram of the GitHub repository souvik-dey-2029/medicine-reminder, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/souvik-dey-2029/medicine-reminder
- Repository: https://github.com/souvik-dey-2029/medicine-reminder

## Overview

Medicine Reminder is an offline-first medicine adherence PWA. Users manage medicines and schedules, receive dose reminders, record adherence, and review analytics and achievements; voice commands and counterfeit checks provide additional capabilities. The app coordinates initialization and dashboard navigation, while domain modules use IndexedDB through DataStore. The source excerpts show several module-to-store calls and app dispatches; other README-listed capabilities are represented without inferred implementation links where wiring was not shown.

Main entry points: [`js/datastore.js`](https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/datastore.js) (IndexedDB Store), [`js/app.js`](https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/app.js) (App Coordinator), [`js/voice.js`](https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/voice.js) (Voice Commands), [`js/notifications.js`](https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/notifications.js) (Reminder Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app["App Coordinator<br/>[app.js]"]
  node_auth["Authentication<br/>[login.html]"]
  node_home["Dashboard UI<br/>[index.html]"]
  node_utils["Shared Utilities<br/>[utils.js]"]
  node_voice["Voice Commands<br/>[voice.js]"]
end

subgraph group_care["Medication Care"]
  node_medicines["Medicine Management<br/>[medicine.js]"]
  node_reminders["Reminder Service<br/>[notifications.js]"]
  node_store[("IndexedDB Store<br/>[datastore.js]")]
end

subgraph group_insights["Adherence Insights"]
  node_analytics["Adherence Analytics<br/>[analytics.js]"]
  node_achievements["Achievements<br/>[achievements.js]"]
end

subgraph group_safety["Safety and Offline"]
  node_counterfeit["Counterfeit Detector<br/>[counterfeit.js]"]
  node_offline["Offline Cache<br/>[service-worker.js]"]
end

node_user(("User"))
node_browser["Browser APIs"]

node_user -->|"uses"| node_home
node_user -->|"signs in"| node_auth
node_app -->|"initializes"| node_store
node_app -->|"refreshes"| node_analytics
node_app -->|"refreshes"| node_achievements
node_medicines -->|"reads and writes"| node_store
node_medicines -->|"checks"| node_achievements
node_reminders -->|"reads schedules"| node_store
node_reminders -->|"updates dashboard"| node_app
node_analytics -->|"reads adherence"| node_store
node_achievements -->|"reads progress"| node_store
node_voice -->|"navigates"| node_app
node_voice -->|"queries adherence"| node_store
node_offline -->|"caches assets"| node_browser
node_browser -.->|"delivers notifications"| node_reminders
node_browser -.->|"provides speech"| node_voice

click node_app "https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/app.js"
click node_auth "https://github.com/souvik-dey-2029/medicine-reminder/blob/main/login.html"
click node_home "https://github.com/souvik-dey-2029/medicine-reminder/blob/main/index.html"
click node_utils "https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/utils.js"
click node_medicines "https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/medicine.js"
click node_reminders "https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/notifications.js"
click node_store "https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/datastore.js"
click node_analytics "https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/analytics.js"
click node_achievements "https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/achievements.js"
click node_voice "https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/voice.js"
click node_counterfeit "https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/counterfeit.js"
click node_offline "https://github.com/souvik-dey-2029/medicine-reminder/blob/main/service-worker.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_app,node_auth,node_home,node_utils,node_voice,node_user,node_browser toneBlue
class node_medicines,node_reminders,node_store toneAmber
class node_analytics,node_achievements toneMint
class node_counterfeit,node_offline toneRose
```

## Components

### Application

- [App Coordinator](https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/app.js): `js/app.js`
- [Authentication](https://github.com/souvik-dey-2029/medicine-reminder/blob/main/login.html): `login.html`
- [Dashboard UI](https://github.com/souvik-dey-2029/medicine-reminder/blob/main/index.html): `index.html`
- [Shared Utilities](https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/utils.js): `js/utils.js`
- [Voice Commands](https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/voice.js): `js/voice.js`

### Medication Care

- [Medicine Management](https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/medicine.js): `js/medicine.js`
- [Reminder Service](https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/notifications.js): `js/notifications.js`
- [IndexedDB Store](https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/datastore.js): `js/datastore.js`

### Adherence Insights

- [Adherence Analytics](https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/analytics.js): `js/analytics.js`
- [Achievements](https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/achievements.js): `js/achievements.js`

### Safety and Offline

- [Counterfeit Detector](https://github.com/souvik-dey-2029/medicine-reminder/blob/main/js/counterfeit.js): `js/counterfeit.js`
- [Offline Cache](https://github.com/souvik-dey-2029/medicine-reminder/blob/main/service-worker.js): `service-worker.js`

### Other components

- **User**
- **Browser APIs**

## Connections

- User → Dashboard UI: uses (evidence: `README.md`)
- User → Authentication: signs in (evidence: `README.md`)
- App Coordinator → IndexedDB Store: initializes (evidence: `js/app.js`)
- App Coordinator → Adherence Analytics: refreshes (evidence: `js/app.js`)
- App Coordinator → Achievements: refreshes (evidence: `js/app.js`)
- Medicine Management → IndexedDB Store: reads and writes (evidence: `js/medicine.js`)
- Medicine Management → Achievements: checks (evidence: `js/medicine.js`)
- Reminder Service → IndexedDB Store: reads schedules (evidence: `js/notifications.js`)
- Reminder Service → App Coordinator: updates dashboard (evidence: `js/notifications.js`)
- Adherence Analytics → IndexedDB Store: reads adherence (evidence: `js/analytics.js`)
- Achievements → IndexedDB Store: reads progress (evidence: `js/achievements.js`)
- Voice Commands → App Coordinator: navigates (evidence: `js/voice.js`)
- Voice Commands → IndexedDB Store: queries adherence (evidence: `js/voice.js`)
- Offline Cache → Browser APIs: caches assets (evidence: `service-worker.js`)
- Browser APIs → Reminder Service: delivers notifications (evidence: `README.md`)
- Browser APIs → Voice Commands: provides speech (evidence: `README.md`)
