# surath83/medi_query architecture

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

- Interactive diagram: https://gitdiagram.com/surath83/medi_query
- Repository: https://github.com/surath83/medi_query

## Overview

MediQuery is a React Native/Expo medicine enquiry app with an optional Express and MongoDB backend. The main enquiry flow is medicine search and detail lookup, with composition-based alternatives; separate tabs provide pharmacy discovery, reminders, and health-profile tools. The sampled code shows the medicine and pharmacy API calls, backend database access, and Overpass lookup. Profile capabilities are documented in the README but its implementation was not sampled, so those details and their wiring are represented only at the subsystem level.

Main entry points: [`Frontend/components/med.jsx`](https://github.com/surath83/medi_query/blob/main/Frontend/components/med.jsx) (Medicine search), [`Frontend/app/(tabs)/maps.jsx`](https://github.com/surath83/medi_query/blob/main/Frontend/app/(tabs)/maps.jsx) (Pharmacy locator), [`Backend/services/server.js`](https://github.com/surath83/medi_query/blob/main/Backend/services/server.js) (Medicine API), [`Frontend/app/(tabs)/reminder.jsx`](https://github.com/surath83/medi_query/blob/main/Frontend/app/(tabs)/reminder.jsx) (Dose reminders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Mobile app"]
  node_home["Home screen<br/>[index.tsx]"]
  node_app_shell["App navigation<br/>[_layout.tsx]"]
  node_api_config["API configuration<br/>[config.js]"]
  node_maps_ui["Pharmacy locator<br/>[maps.jsx]"]
end

subgraph group_medicine["Medicine enquiry"]
  node_medicine_ui["Medicine search<br/>[med.jsx]"]
end

subgraph group_backend["Backend services"]
  node_medicine_api["Medicine API<br/>[server.js]"]
  node_medicine_db[("Medicine collection")]
  node_shop_api["Nearby shops API<br/>[server.js]"]
end

subgraph group_health["Health tools"]
  node_reminders["Dose reminders<br/>[reminder.jsx]"]
  node_local_storage[("Local app storage")]
  node_profile["Profile and metrics<br/>[profile.jsx]"]
end

node_user(("App user"))
node_overpass["Overpass service"]
node_notifications["Device notifications"]
node_maps_app["Device maps"]

node_user -->|"opens"| node_app_shell
node_app_shell -.->|"routes to"| node_home
node_home -->|"renders"| node_medicine_ui
node_medicine_ui -->|"requests details"| node_medicine_api
node_medicine_ui -->|"requests suggestions"| node_medicine_api
node_medicine_ui -->|"uses endpoint"| node_api_config
node_medicine_api -->|"queries"| node_medicine_db
node_maps_ui -->|"uses endpoint"| node_api_config
node_maps_ui -->|"sends coordinates"| node_shop_api
node_shop_api -->|"fetches shops"| node_overpass
node_reminders -->|"reads and writes"| node_local_storage
node_reminders -->|"schedules alerts"| node_notifications
node_maps_ui -->|"opens directions"| node_maps_app

click node_home "https://github.com/surath83/medi_query/blob/main/Frontend/app/(tabs)/index.tsx"
click node_app_shell "https://github.com/surath83/medi_query/blob/main/Frontend/app/_layout.tsx"
click node_api_config "https://github.com/surath83/medi_query/blob/main/Frontend/config.js"
click node_medicine_ui "https://github.com/surath83/medi_query/blob/main/Frontend/components/med.jsx"
click node_medicine_api "https://github.com/surath83/medi_query/blob/main/Backend/services/server.js"
click node_maps_ui "https://github.com/surath83/medi_query/blob/main/Frontend/app/(tabs)/maps.jsx"
click node_shop_api "https://github.com/surath83/medi_query/blob/main/Backend/services/server.js"
click node_reminders "https://github.com/surath83/medi_query/blob/main/Frontend/app/(tabs)/reminder.jsx"
click node_profile "https://github.com/surath83/medi_query/blob/main/Frontend/app/(tabs)/profile.jsx"

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_app_shell,node_api_config,node_maps_ui,node_user toneBlue
class node_medicine_ui toneAmber
class node_medicine_api,node_medicine_db,node_shop_api toneMint
class node_reminders,node_local_storage,node_profile toneRose
class node_overpass,node_notifications,node_maps_app toneIndigo
```

## Components

### Mobile app

- [Home screen](https://github.com/surath83/medi_query/blob/main/Frontend/app/(tabs)/index.tsx): `Frontend/app/(tabs)/index.tsx`
- [App navigation](https://github.com/surath83/medi_query/blob/main/Frontend/app/_layout.tsx): `Frontend/app/_layout.tsx`
- [API configuration](https://github.com/surath83/medi_query/blob/main/Frontend/config.js): `Frontend/config.js`
- [Pharmacy locator](https://github.com/surath83/medi_query/blob/main/Frontend/app/(tabs)/maps.jsx): `Frontend/app/(tabs)/maps.jsx`

### Medicine enquiry

- [Medicine search](https://github.com/surath83/medi_query/blob/main/Frontend/components/med.jsx): `Frontend/components/med.jsx`

### Backend services

- [Medicine API](https://github.com/surath83/medi_query/blob/main/Backend/services/server.js): `Backend/services/server.js`
- **Medicine collection**
- [Nearby shops API](https://github.com/surath83/medi_query/blob/main/Backend/services/server.js): `Backend/services/server.js`

### Health tools

- [Dose reminders](https://github.com/surath83/medi_query/blob/main/Frontend/app/(tabs)/reminder.jsx): `Frontend/app/(tabs)/reminder.jsx`
- **Local app storage**
- [Profile and metrics](https://github.com/surath83/medi_query/blob/main/Frontend/app/(tabs)/profile.jsx): `Frontend/app/(tabs)/profile.jsx`

### Other components

- **App user**
- **Overpass service**
- **Device notifications**
- **Device maps**

## Connections

- App user → App navigation: opens (evidence: `README.md`)
- App navigation → Home screen: routes to
- Home screen → Medicine search: renders (evidence: `Frontend/app/(tabs)/index.tsx`)
- Medicine search → Medicine API: requests details (evidence: `Frontend/components/med.jsx`)
- Medicine search → Medicine API: requests suggestions (evidence: `Frontend/components/med.jsx`)
- Medicine search → API configuration: uses endpoint (evidence: `Frontend/components/med.jsx`)
- Medicine API → Medicine collection: queries (evidence: `Backend/services/server.js`)
- Pharmacy locator → API configuration: uses endpoint (evidence: `Frontend/app/(tabs)/maps.jsx`)
- Pharmacy locator → Nearby shops API: sends coordinates (evidence: `Frontend/app/(tabs)/maps.jsx`)
- Nearby shops API → Overpass service: fetches shops (evidence: `Backend/services/server.js`)
- Dose reminders → Local app storage: reads and writes (evidence: `Frontend/app/(tabs)/reminder.jsx`)
- Dose reminders → Device notifications: schedules alerts (evidence: `Frontend/app/(tabs)/reminder.jsx`)
- Pharmacy locator → Device maps: opens directions (evidence: `Frontend/app/(tabs)/maps.jsx`)
