# shivam-kumar-emf-portrait/healthypick architecture

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

- Interactive diagram: https://gitdiagram.com/shivam-kumar-emf-portrait/healthypick
- Repository: https://github.com/shivam-kumar-emf-portrait/healthypick

## Overview

Healthy Pick is a product-catalog and shopping application with web, mobile, and landing-site surfaces backed by a NestJS API. The principal workflow is browsing or searching products and categories, opening product details, and managing favorites; administrators also maintain catalog content and upload images. Authentication, advertisements, and AI assistance are additional capabilities. The source excerpts establish several backend calls and mobile API usage, but do not show the full web/mobile routing or backend module wiring, so those links are omitted or marked unverified.

Main entry points: [`backend/src/prisma/prisma.service.ts`](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/prisma/prisma.service.ts) (Prisma database access), [`mobile-app/app/(tabs)/index.tsx`](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/mobile-app/app/(tabs)/index.tsx) (Mobile shopping), [`backend/src/products/products.controller.ts`](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/products/products.controller.ts) (Product endpoints), [`frontend/src/app/(store)/page.tsx`](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/frontend/src/app/(store)/page.tsx) (Web storefront)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Client applications"]
  node_webshop["Web storefront<br/>[page.tsx]"]
  node_webadmin["Web admin<br/>[page.tsx]"]
  node_mobile["Mobile shopping<br/>[index.tsx]"]
  node_mobileapi["Mobile API client<br/>[api.ts]"]
  node_landing["Landing site<br/>[page.tsx]"]
  node_chatui["AI chat interface<br/>[AiChatbot.tsx]"]
end

subgraph group_catalog["Catalog and shopping"]
  node_products["Product endpoints"]
  node_productlogic["Product operations"]
  node_categories["Category endpoints"]
  node_categorylogic["Category operations"]
  node_ads["Advertisement endpoints"]
  node_adlogic["Advertisement operations"]
  node_favorites["Favorites"]
end

subgraph group_identity["Identity and users"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_authguard["Token verification<br/>[jwt-auth.guard.ts]"]
  node_users["User operations<br/>[users.service.ts]"]
end

subgraph group_services["AI and media"]
  node_ai["AI assistant<br/>[ai.service.ts]"]
  node_images["Image endpoints"]
  node_imagelogic["Image handling<br/>[images.service.ts]"]
end

subgraph group_data["Persistence"]
  node_database[("Prisma database access<br/>[prisma.service.ts]")]
end

node_shopper(("Shopper"))
node_administrator(("Administrator"))

node_shopper -->|"browses"| node_webshop
node_shopper -->|"browses"| node_mobile
node_administrator -->|"manages catalog"| node_webadmin
node_mobile -->|"uses"| node_mobileapi
node_mobile -.->|"manages favorites"| node_favorites
node_webshop -.->|"requests catalog"| node_products
node_webadmin -.->|"manages products"| node_products
node_products -->|"delegates to"| node_productlogic
node_categories -->|"delegates to"| node_categorylogic
node_ads -->|"delegates to"| node_adlogic
node_favorites -->|"reads and writes"| node_database
node_productlogic -->|"uses"| node_database
node_categorylogic -->|"uses"| node_database
node_adlogic -->|"uses"| node_database
node_authguard -->|"finds or creates"| node_users
node_auth -->|"uses"| node_database
node_ai -->|"queries"| node_database
node_chatui -.->|"requests assistance"| node_ai
node_images -->|"uploads or deletes"| node_imagelogic

click node_webshop "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/frontend/src/app/(store)/page.tsx"
click node_webadmin "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/frontend/src/app/admin/products/page.tsx"
click node_mobile "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/mobile-app/app/(tabs)/index.tsx"
click node_mobileapi "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/mobile-app/lib/api.ts"
click node_landing "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/landing-website/src/app/page.tsx"
click node_products "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/products/products.controller.ts"
click node_productlogic "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/products/products.service.ts"
click node_categories "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/categories/categories.controller.ts"
click node_categorylogic "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/categories/categories.service.ts"
click node_ads "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/advertisements/advertisements.controller.ts"
click node_adlogic "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/advertisements/advertisements.service.ts"
click node_favorites "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/favorites/favorites.service.ts"
click node_auth "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/auth/auth.service.ts"
click node_authguard "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/auth/guards/jwt-auth.guard.ts"
click node_users "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/users/users.service.ts"
click node_ai "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/ai/ai.service.ts"
click node_chatui "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/frontend/src/components/chat/AiChatbot.tsx"
click node_images "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/images/images.controller.ts"
click node_imagelogic "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/images/images.service.ts"
click node_database "https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/prisma/prisma.service.ts"

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_webshop,node_webadmin,node_mobile,node_mobileapi,node_landing,node_chatui toneBlue
class node_products,node_productlogic,node_categories,node_categorylogic,node_ads,node_adlogic,node_favorites toneAmber
class node_auth,node_authguard,node_users toneMint
class node_ai,node_images,node_imagelogic toneRose
class node_database,node_shopper,node_administrator toneIndigo
```

## Components

### Client applications

- [Web storefront](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/frontend/src/app/(store)/page.tsx): `frontend/src/app/(store)/page.tsx`
- [Web admin](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/frontend/src/app/admin/products/page.tsx): `frontend/src/app/admin/products/page.tsx`
- [Mobile shopping](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/mobile-app/app/(tabs)/index.tsx): `mobile-app/app/(tabs)/index.tsx`
- [Mobile API client](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/mobile-app/lib/api.ts): `mobile-app/lib/api.ts`
- [Landing site](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/landing-website/src/app/page.tsx): `landing-website/src/app/page.tsx`
- [AI chat interface](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/frontend/src/components/chat/AiChatbot.tsx): `frontend/src/components/chat/AiChatbot.tsx`

### Catalog and shopping

- [Product endpoints](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/products/products.controller.ts): `backend/src/products/products.controller.ts`
- [Product operations](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/products/products.service.ts): `backend/src/products/products.service.ts`
- [Category endpoints](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/categories/categories.controller.ts): `backend/src/categories/categories.controller.ts`
- [Category operations](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/categories/categories.service.ts): `backend/src/categories/categories.service.ts`
- [Advertisement endpoints](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/advertisements/advertisements.controller.ts): `backend/src/advertisements/advertisements.controller.ts`
- [Advertisement operations](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/advertisements/advertisements.service.ts): `backend/src/advertisements/advertisements.service.ts`
- [Favorites](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/favorites/favorites.service.ts): `backend/src/favorites/favorites.service.ts`

### Identity and users

- [Authentication](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/auth/auth.service.ts): `backend/src/auth/auth.service.ts`
- [Token verification](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/auth/guards/jwt-auth.guard.ts): `backend/src/auth/guards/jwt-auth.guard.ts`
- [User operations](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/users/users.service.ts): `backend/src/users/users.service.ts`

### AI and media

- [AI assistant](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/ai/ai.service.ts): `backend/src/ai/ai.service.ts`
- [Image endpoints](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/images/images.controller.ts): `backend/src/images/images.controller.ts`
- [Image handling](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/images/images.service.ts): `backend/src/images/images.service.ts`

### Persistence

- [Prisma database access](https://github.com/shivam-kumar-emf-portrait/healthypick/blob/main/backend/src/prisma/prisma.service.ts): `backend/src/prisma/prisma.service.ts`

### Other components

- **Shopper**
- **Administrator**

## Connections

- Shopper → Web storefront: browses
- Shopper → Mobile shopping: browses
- Administrator → Web admin: manages catalog
- Mobile shopping → Mobile API client: uses (evidence: `mobile-app/app/(tabs)/index.tsx`)
- Mobile shopping → Favorites: manages favorites
- Web storefront → Product endpoints: requests catalog
- Web admin → Product endpoints: manages products
- Product endpoints → Product operations: delegates to (evidence: `backend/src/products/products.controller.ts`)
- Category endpoints → Category operations: delegates to (evidence: `backend/src/categories/categories.controller.ts`)
- Advertisement endpoints → Advertisement operations: delegates to (evidence: `backend/src/advertisements/advertisements.controller.ts`)
- Favorites → Prisma database access: reads and writes (evidence: `backend/src/favorites/favorites.service.ts`)
- Product operations → Prisma database access: uses
- Category operations → Prisma database access: uses (evidence: `backend/src/categories/categories.service.ts`)
- Advertisement operations → Prisma database access: uses (evidence: `backend/src/advertisements/advertisements.service.ts`)
- Token verification → User operations: finds or creates (evidence: `backend/src/auth/guards/jwt-auth.guard.ts`)
- Authentication → Prisma database access: uses (evidence: `backend/src/auth/auth.service.ts`)
- AI assistant → Prisma database access: queries (evidence: `backend/src/ai/ai.service.ts`)
- AI chat interface → AI assistant: requests assistance
- Image endpoints → Image handling: uploads or deletes (evidence: `backend/src/images/images.controller.ts`)
