# patllola/lilliputcry architecture

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

- Interactive diagram: https://gitdiagram.com/patllola/lilliputcry
- Repository: https://github.com/patllola/lilliputcry

## Overview

LilliputCry is a multi-client baby-care tracking product: caregivers select a baby, record and review feeding, sleep, pumping, medication, and milestone activity, while account, sharing, and subscription features govern access. The sampled API controllers show client requests flowing to feature services, with baby resolution where applicable; the pump service excerpt also shows authorization checks and persistence. The README describes feeding as the core product, while the tree shows broader capabilities. Frontend and mobile request wiring and unsampled feature internals are not fully evidenced, so their internal links are omitted.

Main entry points: [`backend/LilliputCry.Api/Data/AppDbContext.cs`](https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Data/AppDbContext.cs) (Application database), [`frontend/src/api/index.ts`](https://github.com/patllola/lilliputcry/blob/main/frontend/src/api/index.ts) (Web API client), [`mobile/src/api/index.ts`](https://github.com/patllola/lilliputcry/blob/main/mobile/src/api/index.ts) (Mobile API client), [`backend/LilliputCry.Api/Features/Pump/Services/PumpSessionService.cs`](https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Pump/Services/PumpSessionService.cs) (Pump sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Client applications"]
  node_web["Web app"]
  node_mobile["Mobile app"]
  node_web_api["Web API client<br/>[index.ts]"]
  node_mobile_api["Mobile API client<br/>[index.ts]"]
end

subgraph group_identity["Identity and sharing"]
  node_auth["Authentication<br/>[AuthService.cs]"]
  node_auth_routes["Auth endpoints<br/>[AuthController.cs]"]
  node_users["User management<br/>[UserService.cs]"]
  node_babies["Baby profiles<br/>[BabyService.cs]"]
  node_caregivers["Caregiver access"]
end

subgraph group_tracking["Care tracking"]
  node_feeding["Feeding logs"]
  node_sleep["Sleep logs<br/>[SleepLogService.cs]"]
  node_pump["Pump sessions"]
  node_medications["Medications"]
  node_milestones["Milestones"]
end

subgraph group_plans["Plans and operations"]
  node_subscriptions["Subscriptions"]
  node_plan_limits["Plan limits"]
  node_admin["Administration<br/>[AdminService.cs]"]
  node_api_start["API host<br/>[Program.cs]"]
end

subgraph group_persistence["Persistence"]
  node_database[("Application database<br/>[AppDbContext.cs]")]
end

node_caregiver(("Caregiver"))

node_caregiver -->|"uses"| node_web
node_caregiver -->|"uses"| node_mobile
node_web -->|"requests"| node_web_api
node_mobile -->|"requests"| node_mobile_api
node_web_api -->|"auth requests"| node_auth_routes
node_mobile_api -->|"auth requests"| node_auth_routes
node_auth_routes -->|"calls"| node_auth
node_auth -->|"reads/writes"| node_database
node_api_start -->|"configures"| node_database
node_web_api -->|"baby requests"| node_babies
node_mobile_api -->|"baby requests"| node_babies
node_web_api -->|"feeding requests"| node_feeding
node_mobile_api -->|"feeding requests"| node_feeding
node_web_api -->|"sleep requests"| node_sleep
node_mobile_api -->|"sleep requests"| node_sleep
node_web_api -->|"pump requests"| node_pump
node_mobile_api -->|"pump requests"| node_pump
node_web_api -->|"medication requests"| node_medications
node_mobile_api -->|"medication requests"| node_medications
node_web_api -->|"milestone requests"| node_milestones
node_mobile_api -->|"milestone requests"| node_milestones
node_web_api -->|"sharing requests"| node_caregivers
node_mobile_api -->|"sharing requests"| node_caregivers
node_web_api -->|"plan requests"| node_subscriptions
node_mobile_api -->|"plan requests"| node_subscriptions
node_babies -->|"reads/writes"| node_database
node_feeding -->|"reads/writes"| node_database
node_sleep -->|"reads/writes"| node_database
node_pump -->|"reads/writes"| node_database
node_pump -->|"checks access"| node_babies
node_pump -->|"checks history"| node_plan_limits
node_medications -->|"reads/writes"| node_database
node_milestones -->|"reads/writes"| node_database
node_caregivers -->|"reads/writes"| node_database
node_users -->|"reads/writes"| node_database
node_subscriptions -->|"reads/writes"| node_database
node_plan_limits -->|"reads"| node_database
node_admin -->|"reads/writes"| node_database

click node_web "https://github.com/patllola/lilliputcry/tree/main/frontend/src/app"
click node_mobile "https://github.com/patllola/lilliputcry/tree/main/mobile/app"
click node_web_api "https://github.com/patllola/lilliputcry/blob/main/frontend/src/api/index.ts"
click node_mobile_api "https://github.com/patllola/lilliputcry/blob/main/mobile/src/api/index.ts"
click node_auth "https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Users/Services/AuthService.cs"
click node_auth_routes "https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Users/Controllers/AuthController.cs"
click node_users "https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Users/Services/UserService.cs"
click node_babies "https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Babies/Services/BabyService.cs"
click node_caregivers "https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Caregivers/Services/CaregiverService.cs"
click node_feeding "https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Feeding/Services/FeedingLogService.cs"
click node_sleep "https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Sleep/Services/SleepLogService.cs"
click node_pump "https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Pump/Services/PumpSessionService.cs"
click node_medications "https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Medications/Services/MedicationService.cs"
click node_milestones "https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Milestones/Services/MilestoneService.cs"
click node_subscriptions "https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Subscriptions/Services/SubscriptionService.cs"
click node_plan_limits "https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Subscriptions/Services/PlanLimitService.cs"
click node_admin "https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Admin/Services/AdminService.cs"
click node_api_start "https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Program.cs"
click node_database "https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Data/AppDbContext.cs"

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_web,node_mobile,node_web_api,node_mobile_api toneBlue
class node_auth,node_auth_routes,node_users,node_babies,node_caregivers toneAmber
class node_feeding,node_sleep,node_pump,node_medications,node_milestones toneMint
class node_subscriptions,node_plan_limits,node_admin,node_api_start toneRose
class node_database,node_caregiver toneIndigo
```

## Components

### Client applications

- [Web app](https://github.com/patllola/lilliputcry/tree/main/frontend/src/app): `frontend/src/app`
- [Mobile app](https://github.com/patllola/lilliputcry/tree/main/mobile/app): `mobile/app`
- [Web API client](https://github.com/patllola/lilliputcry/blob/main/frontend/src/api/index.ts): `frontend/src/api/index.ts`
- [Mobile API client](https://github.com/patllola/lilliputcry/blob/main/mobile/src/api/index.ts): `mobile/src/api/index.ts`

### Identity and sharing

- [Authentication](https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Users/Services/AuthService.cs): `backend/LilliputCry.Api/Features/Users/Services/AuthService.cs`
- [Auth endpoints](https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Users/Controllers/AuthController.cs): `backend/LilliputCry.Api/Features/Users/Controllers/AuthController.cs`
- [User management](https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Users/Services/UserService.cs): `backend/LilliputCry.Api/Features/Users/Services/UserService.cs`
- [Baby profiles](https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Babies/Services/BabyService.cs): `backend/LilliputCry.Api/Features/Babies/Services/BabyService.cs`
- [Caregiver access](https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Caregivers/Services/CaregiverService.cs): `backend/LilliputCry.Api/Features/Caregivers/Services/CaregiverService.cs`

### Care tracking

- [Feeding logs](https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Feeding/Services/FeedingLogService.cs): `backend/LilliputCry.Api/Features/Feeding/Services/FeedingLogService.cs`
- [Sleep logs](https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Sleep/Services/SleepLogService.cs): `backend/LilliputCry.Api/Features/Sleep/Services/SleepLogService.cs`
- [Pump sessions](https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Pump/Services/PumpSessionService.cs): `backend/LilliputCry.Api/Features/Pump/Services/PumpSessionService.cs`
- [Medications](https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Medications/Services/MedicationService.cs): `backend/LilliputCry.Api/Features/Medications/Services/MedicationService.cs`
- [Milestones](https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Milestones/Services/MilestoneService.cs): `backend/LilliputCry.Api/Features/Milestones/Services/MilestoneService.cs`

### Plans and operations

- [Subscriptions](https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Subscriptions/Services/SubscriptionService.cs): `backend/LilliputCry.Api/Features/Subscriptions/Services/SubscriptionService.cs`
- [Plan limits](https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Subscriptions/Services/PlanLimitService.cs): `backend/LilliputCry.Api/Features/Subscriptions/Services/PlanLimitService.cs`
- [Administration](https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Features/Admin/Services/AdminService.cs): `backend/LilliputCry.Api/Features/Admin/Services/AdminService.cs`
- [API host](https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Program.cs): `backend/LilliputCry.Api/Program.cs`

### Persistence

- [Application database](https://github.com/patllola/lilliputcry/blob/main/backend/LilliputCry.Api/Data/AppDbContext.cs): `backend/LilliputCry.Api/Data/AppDbContext.cs`

### Other components

- **Caregiver**

## Connections

- Caregiver → Web app: uses
- Caregiver → Mobile app: uses
- Web app → Web API client: requests
- Mobile app → Mobile API client: requests
- Web API client → Auth endpoints: auth requests
- Mobile API client → Auth endpoints: auth requests
- Auth endpoints → Authentication: calls
- Authentication → Application database: reads/writes
- API host → Application database: configures
- Web API client → Baby profiles: baby requests
- Mobile API client → Baby profiles: baby requests
- Web API client → Feeding logs: feeding requests
- Mobile API client → Feeding logs: feeding requests
- Web API client → Sleep logs: sleep requests
- Mobile API client → Sleep logs: sleep requests
- Web API client → Pump sessions: pump requests
- Mobile API client → Pump sessions: pump requests
- Web API client → Medications: medication requests
- Mobile API client → Medications: medication requests
- Web API client → Milestones: milestone requests
- Mobile API client → Milestones: milestone requests
- Web API client → Caregiver access: sharing requests
- Mobile API client → Caregiver access: sharing requests
- Web API client → Subscriptions: plan requests
- Mobile API client → Subscriptions: plan requests
- Baby profiles → Application database: reads/writes
- Feeding logs → Application database: reads/writes
- Sleep logs → Application database: reads/writes
- Pump sessions → Application database: reads/writes
- Pump sessions → Baby profiles: checks access
- Pump sessions → Plan limits: checks history
- Medications → Application database: reads/writes
- Milestones → Application database: reads/writes
- Caregiver access → Application database: reads/writes
- User management → Application database: reads/writes
- Subscriptions → Application database: reads/writes
- Plan limits → Application database: reads
- Administration → Application database: reads/writes
