# papajammm/chickintel-2026 architecture

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

- Interactive diagram: https://gitdiagram.com/papajammm/chickintel-2026
- Repository: https://github.com/papajammm/chickintel-2026

## Overview

ChickIntel is an Expo app for managing poultry-farm operations and flock health. The principal workflow is a farmer entering the app, reviewing farm information, and using dedicated screens to manage batches, eggs, inventory, schedules, and health records; scanning and reporting provide additional capabilities. Authentication and Supabase-backed data access form an internal layer. The README mainly describes the Expo starter and UI, so several domain capabilities are identified from the repository tree rather than documented workflows; their connections are not asserted where source evidence was unavailable.

Main entry points: [`lib/supabase.ts`](https://github.com/papajammm/chickintel-2026/blob/main/lib/supabase.ts) (Supabase Client), [`utils/supabase-batches.ts`](https://github.com/papajammm/chickintel-2026/blob/main/utils/supabase-batches.ts) (Chicken Batches), [`utils/breed-image-inference.ts`](https://github.com/papajammm/chickintel-2026/blob/main/utils/breed-image-inference.ts) (Breed Inference), [`utils/supabase-admin.ts`](https://github.com/papajammm/chickintel-2026/blob/main/utils/supabase-admin.ts) (Admin Data Access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Home"]
  node_entry["App Entry<br/>[index.tsx]"]
  node_auth["Authentication<br/>[auth-provider.tsx]"]
  node_login["Sign In<br/>[loginscreen.tsx]"]
  node_home["Farm Home<br/>[index.tsx]"]
  node_admin["Admin Dashboard<br/>[dashboard.tsx]"]
end

subgraph group_operations["Farm Operations"]
  node_batches["Chicken Batches"]
  node_batchstore[("Batch Store<br/>[batch-store.ts]")]
  node_egg["Egg Batches<br/>[&#91;color&#93;.tsx]"]
  node_inventory["Inventory<br/>[inventory.tsx]"]
  node_schedule["Schedule<br/>[schedule.tsx]"]
  node_journal["Journal<br/>[index.tsx]"]
  node_reports["Reports<br/>[reports.tsx]"]
end

subgraph group_flock["Flock Intelligence"]
  node_scanner["Scan Workflow<br/>[scanner.tsx]"]
  node_breed["Breed Inference"]
  node_breedfn["Breed Inference Function<br/>[index.ts]"]
  node_healthscan["Health Scan<br/>[index.tsx]"]
  node_healthrules["Health Rule Engine"]
  node_healthimage["Health Image Inference"]
  node_healthfn["Health Inference Function<br/>[index.ts]"]
  node_monitoring["Health Monitoring<br/>[index.tsx]"]
  node_healthrecords[("Monitoring Records")]
end

subgraph group_data["Data and Services"]
  node_supabase["Supabase Client<br/>[supabase.ts]"]
  node_adminservice["Admin Data Access<br/>[supabase-admin.ts]"]
  node_breedcards["Recent Breed Scans"]
end

node_farmer(("Farmer"))

node_farmer -.->|"opens app"| node_entry
node_entry -->|"checks session"| node_auth
node_auth -->|"uses client"| node_supabase
node_farmer -.->|"signs in"| node_login
node_home -->|"fetches batches"| node_batches
node_batches -->|"queries data"| node_supabase
node_batches -->|"uses store"| node_batchstore
node_egg -->|"uses store"| node_batchstore
node_egg -->|"uses batch data"| node_batches
node_monitoring -->|"loads records"| node_healthrecords
node_healthrecords -.->|"queries data"| node_supabase
node_healthscan -.->|"resolves symptoms"| node_healthrules
node_healthrules -->|"uses predictions"| node_healthimage
node_breed -->|"uses client"| node_supabase
node_admin -->|"loads farmers"| node_adminservice
node_admin -->|"toggles status"| node_adminservice
node_adminservice -.->|"uses client"| node_supabase
node_scanner -->|"adds recent scans"| node_breedcards
node_scanner -.->|"runs inference"| node_breed
node_breed -.->|"invokes function"| node_breedfn
node_healthimage -.->|"invokes function"| node_healthfn

click node_entry "https://github.com/papajammm/chickintel-2026/blob/main/app/index.tsx"
click node_auth "https://github.com/papajammm/chickintel-2026/blob/main/providers/auth-provider.tsx"
click node_login "https://github.com/papajammm/chickintel-2026/blob/main/app/loginscreen.tsx"
click node_home "https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/index.tsx"
click node_admin "https://github.com/papajammm/chickintel-2026/blob/main/app/admin/dashboard.tsx"
click node_batches "https://github.com/papajammm/chickintel-2026/blob/main/utils/supabase-batches.ts"
click node_batchstore "https://github.com/papajammm/chickintel-2026/blob/main/utils/batch-store.ts"
click node_egg "https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/eggbatchitem/%5Bcolor%5D.tsx"
click node_inventory "https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/inventory.tsx"
click node_schedule "https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/schedule.tsx"
click node_journal "https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/journal/index.tsx"
click node_reports "https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/reports.tsx"
click node_scanner "https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/scanner.tsx"
click node_breed "https://github.com/papajammm/chickintel-2026/blob/main/utils/breed-image-inference.ts"
click node_breedfn "https://github.com/papajammm/chickintel-2026/blob/main/supabase/functions/roboflow-breed-inference/index.ts"
click node_healthscan "https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/scanned-health/index.tsx"
click node_healthrules "https://github.com/papajammm/chickintel-2026/blob/main/utils/health-rule-engine.ts"
click node_healthimage "https://github.com/papajammm/chickintel-2026/blob/main/utils/health-image-inference.ts"
click node_healthfn "https://github.com/papajammm/chickintel-2026/blob/main/supabase/functions/roboflow-health-inference/index.ts"
click node_monitoring "https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/health-monitoring/index.tsx"
click node_healthrecords "https://github.com/papajammm/chickintel-2026/blob/main/utils/supabase-health-monitoring.ts"
click node_supabase "https://github.com/papajammm/chickintel-2026/blob/main/lib/supabase.ts"
click node_adminservice "https://github.com/papajammm/chickintel-2026/blob/main/utils/supabase-admin.ts"
click node_breedcards "https://github.com/papajammm/chickintel-2026/blob/main/utils/recent-breed-scans.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_entry,node_auth,node_login,node_home,node_admin toneBlue
class node_batches,node_batchstore,node_egg,node_inventory,node_schedule,node_journal,node_reports toneAmber
class node_scanner,node_breed,node_breedfn,node_healthscan,node_healthrules,node_healthimage,node_healthfn,node_monitoring,node_healthrecords toneMint
class node_supabase,node_adminservice,node_breedcards toneRose
class node_farmer toneIndigo
```

## Components

### Access and Home

- [App Entry](https://github.com/papajammm/chickintel-2026/blob/main/app/index.tsx): `app/index.tsx`
- [Authentication](https://github.com/papajammm/chickintel-2026/blob/main/providers/auth-provider.tsx): `providers/auth-provider.tsx`
- [Sign In](https://github.com/papajammm/chickintel-2026/blob/main/app/loginscreen.tsx): `app/loginscreen.tsx`
- [Farm Home](https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/index.tsx): `app/(tabs)/index.tsx`
- [Admin Dashboard](https://github.com/papajammm/chickintel-2026/blob/main/app/admin/dashboard.tsx): `app/admin/dashboard.tsx`

### Farm Operations

- [Chicken Batches](https://github.com/papajammm/chickintel-2026/blob/main/utils/supabase-batches.ts): `utils/supabase-batches.ts`
- [Batch Store](https://github.com/papajammm/chickintel-2026/blob/main/utils/batch-store.ts): `utils/batch-store.ts`
- [Egg Batches](https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/eggbatchitem/%5Bcolor%5D.tsx): `app/(tabs)/eggbatchitem/[color].tsx`
- [Inventory](https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/inventory.tsx): `app/(tabs)/inventory.tsx`
- [Schedule](https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/schedule.tsx): `app/(tabs)/schedule.tsx`
- [Journal](https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/journal/index.tsx): `app/(tabs)/journal/index.tsx`
- [Reports](https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/reports.tsx): `app/(tabs)/reports.tsx`

### Flock Intelligence

- [Scan Workflow](https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/scanner.tsx): `app/(tabs)/scanner.tsx`
- [Breed Inference](https://github.com/papajammm/chickintel-2026/blob/main/utils/breed-image-inference.ts): `utils/breed-image-inference.ts`
- [Breed Inference Function](https://github.com/papajammm/chickintel-2026/blob/main/supabase/functions/roboflow-breed-inference/index.ts): `supabase/functions/roboflow-breed-inference/index.ts`
- [Health Scan](https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/scanned-health/index.tsx): `app/(tabs)/scanned-health/index.tsx`
- [Health Rule Engine](https://github.com/papajammm/chickintel-2026/blob/main/utils/health-rule-engine.ts): `utils/health-rule-engine.ts`
- [Health Image Inference](https://github.com/papajammm/chickintel-2026/blob/main/utils/health-image-inference.ts): `utils/health-image-inference.ts`
- [Health Inference Function](https://github.com/papajammm/chickintel-2026/blob/main/supabase/functions/roboflow-health-inference/index.ts): `supabase/functions/roboflow-health-inference/index.ts`
- [Health Monitoring](https://github.com/papajammm/chickintel-2026/blob/main/app/(tabs)/health-monitoring/index.tsx): `app/(tabs)/health-monitoring/index.tsx`
- [Monitoring Records](https://github.com/papajammm/chickintel-2026/blob/main/utils/supabase-health-monitoring.ts): `utils/supabase-health-monitoring.ts`

### Data and Services

- [Supabase Client](https://github.com/papajammm/chickintel-2026/blob/main/lib/supabase.ts): `lib/supabase.ts`
- [Admin Data Access](https://github.com/papajammm/chickintel-2026/blob/main/utils/supabase-admin.ts): `utils/supabase-admin.ts`
- [Recent Breed Scans](https://github.com/papajammm/chickintel-2026/blob/main/utils/recent-breed-scans.ts): `utils/recent-breed-scans.ts`

### Other components

- **Farmer**

## Connections

- Farmer → App Entry: opens app
- App Entry → Authentication: checks session (evidence: `app/index.tsx`)
- Authentication → Supabase Client: uses client (evidence: `providers/auth-provider.tsx`)
- Farmer → Sign In: signs in
- Farm Home → Chicken Batches: fetches batches (evidence: `app/(tabs)/index.tsx`)
- Chicken Batches → Supabase Client: queries data (evidence: `utils/supabase-batches.ts`)
- Chicken Batches → Batch Store: uses store (evidence: `utils/supabase-batches.ts`)
- Egg Batches → Batch Store: uses store (evidence: `app/(tabs)/eggbatchitem/[color].tsx`)
- Egg Batches → Chicken Batches: uses batch data (evidence: `app/(tabs)/eggbatchitem/[color].tsx`)
- Health Monitoring → Monitoring Records: loads records (evidence: `app/(tabs)/health-monitoring/index.tsx`)
- Monitoring Records → Supabase Client: queries data
- Health Scan → Health Rule Engine: resolves symptoms
- Health Rule Engine → Health Image Inference: uses predictions (evidence: `utils/health-rule-engine.ts`)
- Breed Inference → Supabase Client: uses client (evidence: `utils/breed-image-inference.ts`)
- Admin Dashboard → Admin Data Access: loads farmers (evidence: `app/admin/dashboard.tsx`)
- Admin Dashboard → Admin Data Access: toggles status (evidence: `app/admin/dashboard.tsx`)
- Admin Data Access → Supabase Client: uses client
- Scan Workflow → Recent Breed Scans: adds recent scans (evidence: `README.md`)
- Scan Workflow → Breed Inference: runs inference
- Breed Inference → Breed Inference Function: invokes function
- Health Image Inference → Health Inference Function: invokes function
