# mardnts28/claro architecture

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

## Overview

Claro appears to be a health-conscious food product app, with a Flutter client, supporting edge services, and an informational website. The visible service workflow authenticates a request, routes health-profile operations, encrypts or decrypts health fields, and accesses Firestore; group-managed profiles add ownership and member checks. The README describes only a Flutter starter, and the tree omits the Dart application sources, so client features and the Gemini proxy’s role are not verifiable here. Website routes and documented privacy-policy capabilities are represented, but links between unsampled client features and services are omitted.

Main entry points: [`official-website/src/App.jsx`](https://github.com/mardnts28/claro/blob/main/official-website/src/App.jsx) (Website router), [`health-data-worker/src/index.ts`](https://github.com/mardnts28/claro/blob/main/health-data-worker/src/index.ts) (HTTP routes), [`official-website/src/pages/PrivacyPolicy.jsx`](https://github.com/mardnts28/claro/blob/main/official-website/src/pages/PrivacyPolicy.jsx) (Privacy policy), [`health-data-worker/src/groupMemberHealthProfile.ts`](https://github.com/mardnts28/claro/blob/main/health-data-worker/src/groupMemberHealthProfile.ts) (Group profile handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Claro client"]
  node_flutter_app["Flutter app"]
  node_mobile_shell["Native app shell<br/>[MainActivity.kt]"]
  node_food_product["Food product info"]
  node_product_scan["Product scanning"]
  node_health_groups["Health groups"]
  node_product_reports["Product reports"]
  node_admin_review["Admin review"]
end

subgraph group_worker["Health data service"]
  node_worker_entry["HTTP routes<br/>[index.ts]"]
  node_token_verify["Token verification<br/>[verifyToken.ts]"]
  node_health_handlers["Group profile handlers"]
  node_field_crypto["Field encryption<br/>[crypto.ts]"]
  node_firestore_access["Firestore access<br/>[firestore.ts]"]
end

subgraph group_proxy["AI proxy"]
  node_gemini_proxy["Gemini proxy<br/>[index.ts]"]
end

subgraph group_website["Public website"]
  node_website_app["Website router<br/>[App.jsx]"]
  node_home_page["Home page<br/>[Home.jsx]"]
  node_guide_page["User guide<br/>[UserGuide.jsx]"]
  node_privacy_page["Privacy policy<br/>[PrivacyPolicy.jsx]"]
  node_terms_page["Terms page"]
  node_contact_page["Contact page<br/>[ContactUs.jsx]"]
end

node_user(("App user"))
node_firestore[("Firestore")]
node_website_user(("Site visitor"))

node_user -.->|"uses"| node_flutter_app
node_mobile_shell -.->|"starts"| node_flutter_app
node_worker_entry -->|"verifies token"| node_token_verify
node_worker_entry -->|"reads profile"| node_firestore_access
node_worker_entry -->|"encrypts fields"| node_field_crypto
node_worker_entry -->|"routes group profile"| node_health_handlers
node_health_handlers -->|"checks and writes"| node_firestore_access
node_health_handlers -->|"encrypts fields"| node_field_crypto
node_firestore_access -->|"reads and writes"| node_firestore
node_website_user -->|"visits"| node_website_app
node_website_app -->|"routes to"| node_home_page
node_website_app -->|"routes to"| node_guide_page
node_website_app -->|"routes to"| node_privacy_page
node_website_app -->|"routes to"| node_terms_page
node_website_app -->|"routes to"| node_contact_page
node_home_page -->|"explains"| node_product_scan
node_home_page -->|"explains"| node_food_product
node_privacy_page -->|"describes controls"| node_health_groups
node_privacy_page -->|"describes review"| node_product_reports
node_privacy_page -->|"describes"| node_admin_review

click node_mobile_shell "https://github.com/mardnts28/claro/blob/main/android/app/src/main/kotlin/com/claro/claro/MainActivity.kt"
click node_worker_entry "https://github.com/mardnts28/claro/blob/main/health-data-worker/src/index.ts"
click node_token_verify "https://github.com/mardnts28/claro/blob/main/health-data-worker/src/verifyToken.ts"
click node_health_handlers "https://github.com/mardnts28/claro/blob/main/health-data-worker/src/groupMemberHealthProfile.ts"
click node_field_crypto "https://github.com/mardnts28/claro/blob/main/health-data-worker/src/crypto.ts"
click node_firestore_access "https://github.com/mardnts28/claro/blob/main/health-data-worker/src/firestore.ts"
click node_gemini_proxy "https://github.com/mardnts28/claro/blob/main/claro-gemini-proxy/src/index.ts"
click node_website_app "https://github.com/mardnts28/claro/blob/main/official-website/src/App.jsx"
click node_home_page "https://github.com/mardnts28/claro/blob/main/official-website/src/pages/Home.jsx"
click node_guide_page "https://github.com/mardnts28/claro/blob/main/official-website/src/pages/UserGuide.jsx"
click node_privacy_page "https://github.com/mardnts28/claro/blob/main/official-website/src/pages/PrivacyPolicy.jsx"
click node_terms_page "https://github.com/mardnts28/claro/blob/main/official-website/src/pages/TermsConditions.jsx"
click node_contact_page "https://github.com/mardnts28/claro/blob/main/official-website/src/pages/ContactUs.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_flutter_app,node_mobile_shell,node_food_product,node_product_scan,node_health_groups,node_product_reports,node_admin_review,node_user toneBlue
class node_worker_entry,node_token_verify,node_health_handlers,node_field_crypto,node_firestore_access,node_firestore toneAmber
class node_gemini_proxy toneMint
class node_website_app,node_home_page,node_guide_page,node_privacy_page,node_terms_page,node_contact_page toneRose
class node_website_user toneIndigo
```

## Components

### Claro client

- **Flutter app**
- [Native app shell](https://github.com/mardnts28/claro/blob/main/android/app/src/main/kotlin/com/claro/claro/MainActivity.kt): `android/app/src/main/kotlin/com/claro/claro/MainActivity.kt`
- **Food product info**
- **Product scanning**
- **Health groups**
- **Product reports**
- **Admin review**

### Health data service

- [HTTP routes](https://github.com/mardnts28/claro/blob/main/health-data-worker/src/index.ts): `health-data-worker/src/index.ts`
- [Token verification](https://github.com/mardnts28/claro/blob/main/health-data-worker/src/verifyToken.ts): `health-data-worker/src/verifyToken.ts`
- [Group profile handlers](https://github.com/mardnts28/claro/blob/main/health-data-worker/src/groupMemberHealthProfile.ts): `health-data-worker/src/groupMemberHealthProfile.ts`
- [Field encryption](https://github.com/mardnts28/claro/blob/main/health-data-worker/src/crypto.ts): `health-data-worker/src/crypto.ts`
- [Firestore access](https://github.com/mardnts28/claro/blob/main/health-data-worker/src/firestore.ts): `health-data-worker/src/firestore.ts`

### AI proxy

- [Gemini proxy](https://github.com/mardnts28/claro/blob/main/claro-gemini-proxy/src/index.ts): `claro-gemini-proxy/src/index.ts`

### Public website

- [Website router](https://github.com/mardnts28/claro/blob/main/official-website/src/App.jsx): `official-website/src/App.jsx`
- [Home page](https://github.com/mardnts28/claro/blob/main/official-website/src/pages/Home.jsx): `official-website/src/pages/Home.jsx`
- [User guide](https://github.com/mardnts28/claro/blob/main/official-website/src/pages/UserGuide.jsx): `official-website/src/pages/UserGuide.jsx`
- [Privacy policy](https://github.com/mardnts28/claro/blob/main/official-website/src/pages/PrivacyPolicy.jsx): `official-website/src/pages/PrivacyPolicy.jsx`
- [Terms page](https://github.com/mardnts28/claro/blob/main/official-website/src/pages/TermsConditions.jsx): `official-website/src/pages/TermsConditions.jsx`
- [Contact page](https://github.com/mardnts28/claro/blob/main/official-website/src/pages/ContactUs.jsx): `official-website/src/pages/ContactUs.jsx`

### Other components

- **App user**
- **Firestore**
- **Site visitor**

## Connections

- App user → Flutter app: uses
- Native app shell → Flutter app: starts
- HTTP routes → Token verification: verifies token (evidence: `health-data-worker/src/index.ts`)
- HTTP routes → Firestore access: reads profile (evidence: `health-data-worker/src/index.ts`)
- HTTP routes → Field encryption: encrypts fields (evidence: `health-data-worker/src/index.ts`)
- HTTP routes → Group profile handlers: routes group profile (evidence: `health-data-worker/src/index.ts`)
- Group profile handlers → Firestore access: checks and writes (evidence: `health-data-worker/src/groupMemberHealthProfile.ts`)
- Group profile handlers → Field encryption: encrypts fields (evidence: `health-data-worker/src/groupMemberHealthProfile.ts`)
- Firestore access → Firestore: reads and writes (evidence: `health-data-worker/src/firestore.ts`)
- Site visitor → Website router: visits (evidence: `official-website/src/App.jsx`)
- Website router → Home page: routes to (evidence: `official-website/src/App.jsx`)
- Website router → User guide: routes to (evidence: `official-website/src/App.jsx`)
- Website router → Privacy policy: routes to (evidence: `official-website/src/App.jsx`)
- Website router → Terms page: routes to (evidence: `official-website/src/App.jsx`)
- Website router → Contact page: routes to (evidence: `official-website/src/App.jsx`)
- Home page → Product scanning: explains (evidence: `official-website/src/pages/Home.jsx`)
- Home page → Food product info: explains (evidence: `official-website/src/pages/Home.jsx`)
- Privacy policy → Health groups: describes controls (evidence: `official-website/src/pages/PrivacyPolicy.jsx`)
- Privacy policy → Product reports: describes review (evidence: `official-website/src/pages/PrivacyPolicy.jsx`)
- Privacy policy → Admin review: describes (evidence: `official-website/src/pages/PrivacyPolicy.jsx`)
