# roitolin/lifecyle architecture

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

- Interactive diagram: https://gitdiagram.com/roitolin/lifecyle
- Repository: https://github.com/roitolin/lifecyle

## Overview

LifeCycle is a funeral-service coordination product for families, funeral shops, and administrators, delivered as mobile and web apps backed by Supabase. The user workflow covers sign-in, shop and product discovery, cart/checkout, service-request submission and tracking; separate branches support shop operations and administration. The graph also shows authentication, scheduling, and payment layers where source excerpts expose their links. README statements support broad capability branches; unsampled implementation details and relationships are left at subsystem level.

Main entry points: [`LIFECYCLE_WEB/src/App.tsx`](https://github.com/roitolin/lifecyle/blob/main/LIFECYCLE_WEB/src/App.tsx) (Web app routes), [`src/navigation`](https://github.com/roitolin/lifecyle/tree/main/src/navigation) (Mobile navigation), [`App.tsx`](https://github.com/roitolin/lifecyle/blob/main/App.tsx) (Mobile app), [`src/context/AuthContext.tsx`](https://github.com/roitolin/lifecyle/blob/main/src/context/AuthContext.tsx) (Authentication context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry"]
  node_mobile_app["Mobile app<br/>[App.tsx]"]
  node_mobile_nav["Mobile navigation"]
  node_mobile_providers["App providers"]
  node_web_app["Web app routes<br/>[App.tsx]"]
end

subgraph group_family["Family services"]
  node_web_discovery["Shop and product discovery"]
  node_web_cart["Cart and checkout<br/>[CartPage.tsx]"]
  node_web_requests["Family service requests"]
  node_mobile_browse["Funeral browsing"]
  node_mobile_requests["Request tracking"]
  node_request_details["Request details"]
  node_schedule_fields["Schedule fields"]
  node_schedule_rules["Schedule rules"]
end

subgraph group_shops["Shop operations"]
  node_shop_management["Shop management"]
  node_seller_web["Seller centre"]
end

subgraph group_admin["Administration"]
  node_admin_tools["Admin tools"]
  node_web_admin["Web administration"]
end

subgraph group_platform["Identity and platform"]
  node_auth_context["Authentication context<br/>[AuthContext.tsx]"]
  node_supabase_client["Supabase client<br/>[supabaseClient.ts]"]
  node_user_profile["User profiles<br/>[userProfile.ts]"]
  node_push_notifications["Push notifications"]
  node_service_payment_ui["Service payment sheet"]
  node_service_payment["Service checkout service<br/>[serviceXendit.ts]"]
  node_storage["Media storage<br/>[supabaseStorage.ts]"]
  node_supabase[("Supabase backend")]
end

node_families(("Families"))
node_shops_actor(("Funeral shops"))
node_admins_actor(("Administrators"))

node_families -->|"use"| node_mobile_app
node_shops_actor -->|"use"| node_mobile_app
node_admins_actor -->|"use"| node_mobile_app
node_families -->|"use"| node_web_app
node_shops_actor -->|"use"| node_web_app
node_admins_actor -->|"use"| node_web_app
node_mobile_app -->|"loads"| node_mobile_nav
node_mobile_app -->|"loads"| node_mobile_providers
node_web_app -->|"routes to"| node_web_discovery
node_web_app -->|"routes to"| node_web_cart
node_web_app -->|"routes to"| node_web_requests
node_web_app -->|"routes to"| node_seller_web
node_web_app -->|"routes to"| node_web_admin
node_mobile_nav -->|"routes to"| node_mobile_browse
node_mobile_nav -->|"routes to"| node_mobile_requests
node_mobile_nav -->|"routes to"| node_shop_management
node_mobile_nav -->|"routes to"| node_admin_tools
node_mobile_requests -->|"renders"| node_schedule_fields
node_request_details -->|"renders"| node_schedule_fields
node_schedule_fields -->|"serializes dates"| node_schedule_rules
node_auth_context -->|"authenticates with"| node_supabase_client
node_auth_context -->|"loads profile"| node_user_profile
node_auth_context -->|"updates token"| node_push_notifications
node_service_payment_ui -->|"starts checkout"| node_service_payment
node_service_payment -->|"uses"| node_supabase_client
node_storage -->|"uploads media"| node_supabase
node_supabase_client -.->|"connects"| node_supabase

click node_mobile_app "https://github.com/roitolin/lifecyle/blob/main/App.tsx"
click node_mobile_nav "https://github.com/roitolin/lifecyle/tree/main/src/navigation"
click node_mobile_providers "https://github.com/roitolin/lifecyle/tree/main/src/providers"
click node_web_app "https://github.com/roitolin/lifecyle/blob/main/LIFECYCLE_WEB/src/App.tsx"
click node_web_discovery "https://github.com/roitolin/lifecyle/tree/main/LIFECYCLE_WEB/src/pages"
click node_web_cart "https://github.com/roitolin/lifecyle/blob/main/LIFECYCLE_WEB/src/pages/CartPage.tsx"
click node_web_requests "https://github.com/roitolin/lifecyle/blob/main/LIFECYCLE_WEB/src/pages/MyServiceRequestsPage.tsx"
click node_mobile_browse "https://github.com/roitolin/lifecyle/tree/main/src/screens/funeral"
click node_mobile_requests "https://github.com/roitolin/lifecyle/blob/main/src/screens/funeral/FuneralMyServiceRequestsScreen.tsx"
click node_request_details "https://github.com/roitolin/lifecyle/blob/main/src/screens/funeral/FuneralServiceRequestDetailsScreen.tsx"
click node_schedule_fields "https://github.com/roitolin/lifecyle/blob/main/src/components/ServiceRequestScheduleFields.tsx"
click node_schedule_rules "https://github.com/roitolin/lifecyle/blob/main/src/utils/serviceRequestSchedule.ts"
click node_shop_management "https://github.com/roitolin/lifecyle/tree/main/src/screens/funeral"
click node_seller_web "https://github.com/roitolin/lifecyle/blob/main/LIFECYCLE_WEB/src/pages/SellerCentrePage.tsx"
click node_admin_tools "https://github.com/roitolin/lifecyle/tree/main/src/screens/admin"
click node_web_admin "https://github.com/roitolin/lifecyle/tree/main/LIFECYCLE_WEB/src/pages/admin"
click node_auth_context "https://github.com/roitolin/lifecyle/blob/main/src/context/AuthContext.tsx"
click node_supabase_client "https://github.com/roitolin/lifecyle/blob/main/src/services/supabaseClient.ts"
click node_user_profile "https://github.com/roitolin/lifecyle/blob/main/src/services/userProfile.ts"
click node_push_notifications "https://github.com/roitolin/lifecyle/blob/main/src/services/pushNotifications.ts"
click node_service_payment_ui "https://github.com/roitolin/lifecyle/blob/main/src/components/ServiceXenditSheet.tsx"
click node_service_payment "https://github.com/roitolin/lifecyle/blob/main/src/services/serviceXendit.ts"
click node_storage "https://github.com/roitolin/lifecyle/blob/main/src/services/supabaseStorage.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_mobile_app,node_mobile_nav,node_mobile_providers,node_web_app toneBlue
class node_web_discovery,node_web_cart,node_web_requests,node_mobile_browse,node_mobile_requests,node_request_details,node_schedule_fields,node_schedule_rules toneAmber
class node_shop_management,node_seller_web toneMint
class node_admin_tools,node_web_admin toneRose
class node_auth_context,node_supabase_client,node_user_profile,node_push_notifications,node_service_payment_ui,node_service_payment,node_storage,node_supabase,node_families,node_shops_actor,node_admins_actor toneIndigo
```

## Components

### App entry

- [Mobile app](https://github.com/roitolin/lifecyle/blob/main/App.tsx): `App.tsx`
- [Mobile navigation](https://github.com/roitolin/lifecyle/tree/main/src/navigation): `src/navigation`
- [App providers](https://github.com/roitolin/lifecyle/tree/main/src/providers): `src/providers`
- [Web app routes](https://github.com/roitolin/lifecyle/blob/main/LIFECYCLE_WEB/src/App.tsx): `LIFECYCLE_WEB/src/App.tsx`

### Family services

- [Shop and product discovery](https://github.com/roitolin/lifecyle/tree/main/LIFECYCLE_WEB/src/pages): `LIFECYCLE_WEB/src/pages`
- [Cart and checkout](https://github.com/roitolin/lifecyle/blob/main/LIFECYCLE_WEB/src/pages/CartPage.tsx): `LIFECYCLE_WEB/src/pages/CartPage.tsx`
- [Family service requests](https://github.com/roitolin/lifecyle/blob/main/LIFECYCLE_WEB/src/pages/MyServiceRequestsPage.tsx): `LIFECYCLE_WEB/src/pages/MyServiceRequestsPage.tsx`
- [Funeral browsing](https://github.com/roitolin/lifecyle/tree/main/src/screens/funeral): `src/screens/funeral`
- [Request tracking](https://github.com/roitolin/lifecyle/blob/main/src/screens/funeral/FuneralMyServiceRequestsScreen.tsx): `src/screens/funeral/FuneralMyServiceRequestsScreen.tsx`
- [Request details](https://github.com/roitolin/lifecyle/blob/main/src/screens/funeral/FuneralServiceRequestDetailsScreen.tsx): `src/screens/funeral/FuneralServiceRequestDetailsScreen.tsx`
- [Schedule fields](https://github.com/roitolin/lifecyle/blob/main/src/components/ServiceRequestScheduleFields.tsx): `src/components/ServiceRequestScheduleFields.tsx`
- [Schedule rules](https://github.com/roitolin/lifecyle/blob/main/src/utils/serviceRequestSchedule.ts): `src/utils/serviceRequestSchedule.ts`

### Shop operations

- [Shop management](https://github.com/roitolin/lifecyle/tree/main/src/screens/funeral): `src/screens/funeral`
- [Seller centre](https://github.com/roitolin/lifecyle/blob/main/LIFECYCLE_WEB/src/pages/SellerCentrePage.tsx): `LIFECYCLE_WEB/src/pages/SellerCentrePage.tsx`

### Administration

- [Admin tools](https://github.com/roitolin/lifecyle/tree/main/src/screens/admin): `src/screens/admin`
- [Web administration](https://github.com/roitolin/lifecyle/tree/main/LIFECYCLE_WEB/src/pages/admin): `LIFECYCLE_WEB/src/pages/admin`

### Identity and platform

- [Authentication context](https://github.com/roitolin/lifecyle/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Supabase client](https://github.com/roitolin/lifecyle/blob/main/src/services/supabaseClient.ts): `src/services/supabaseClient.ts`
- [User profiles](https://github.com/roitolin/lifecyle/blob/main/src/services/userProfile.ts): `src/services/userProfile.ts`
- [Push notifications](https://github.com/roitolin/lifecyle/blob/main/src/services/pushNotifications.ts): `src/services/pushNotifications.ts`
- [Service payment sheet](https://github.com/roitolin/lifecyle/blob/main/src/components/ServiceXenditSheet.tsx): `src/components/ServiceXenditSheet.tsx`
- [Service checkout service](https://github.com/roitolin/lifecyle/blob/main/src/services/serviceXendit.ts): `src/services/serviceXendit.ts`
- [Media storage](https://github.com/roitolin/lifecyle/blob/main/src/services/supabaseStorage.ts): `src/services/supabaseStorage.ts`
- **Supabase backend**

### Other components

- **Families**
- **Funeral shops**
- **Administrators**

## Connections

- Families → Mobile app: use
- Funeral shops → Mobile app: use
- Administrators → Mobile app: use
- Families → Web app routes: use
- Funeral shops → Web app routes: use
- Administrators → Web app routes: use
- Mobile app → Mobile navigation: loads (evidence: `App.tsx`)
- Mobile app → App providers: loads (evidence: `App.tsx`)
- Web app routes → Shop and product discovery: routes to (evidence: `LIFECYCLE_WEB/src/App.tsx`)
- Web app routes → Cart and checkout: routes to (evidence: `LIFECYCLE_WEB/src/App.tsx`)
- Web app routes → Family service requests: routes to (evidence: `LIFECYCLE_WEB/src/App.tsx`)
- Web app routes → Seller centre: routes to (evidence: `LIFECYCLE_WEB/src/App.tsx`)
- Web app routes → Web administration: routes to (evidence: `LIFECYCLE_WEB/src/App.tsx`)
- Mobile navigation → Funeral browsing: routes to
- Mobile navigation → Request tracking: routes to
- Mobile navigation → Shop management: routes to
- Mobile navigation → Admin tools: routes to
- Request tracking → Schedule fields: renders (evidence: `src/screens/funeral/FuneralMyServiceRequestsScreen.tsx`)
- Request details → Schedule fields: renders (evidence: `src/screens/funeral/FuneralServiceRequestDetailsScreen.tsx`)
- Schedule fields → Schedule rules: serializes dates (evidence: `src/components/ServiceRequestScheduleFields.tsx`)
- Authentication context → Supabase client: authenticates with (evidence: `src/context/AuthContext.tsx`)
- Authentication context → User profiles: loads profile (evidence: `src/context/AuthContext.tsx`)
- Authentication context → Push notifications: updates token (evidence: `src/context/AuthContext.tsx`)
- Service payment sheet → Service checkout service: starts checkout (evidence: `src/components/ServiceXenditSheet.tsx`)
- Service checkout service → Supabase client: uses (evidence: `src/services/serviceXendit.ts`)
- Media storage → Supabase backend: uploads media (evidence: `src/services/supabaseStorage.ts`)
- Supabase client → Supabase backend: connects
