# asrarkhantscltd-del/check-in-app architecture

> Architecture diagram of the GitHub repository asrarkhantscltd-del/check-in-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/asrarkhantscltd-del/check-in-app
- Repository: https://github.com/asrarkhantscltd-del/check-in-app

## Overview

Check-In App is a private wellbeing service for web and Capacitor-based iOS/Android clients. The main user journey is to authenticate, submit a three-state check-in, and share it only with explicitly connected people; the service also supports communities, family plans, reminders and alerts, helplines, privacy controls, and administration. The graph follows the documented client/API/database layers and preserves major domain branches. Some route and scheduler internals were not sampled, so uncertain links are dashed rather than presented as verified calls.

Main entry points: [`server/storage/index.ts`](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/storage/index.ts) (Storage access), [`server/routes/index.ts`](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/routes/index.ts) (Route registry), [`server/routes/billing.ts`](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/routes/billing.ts) (Plans and billing), [`client/src/App.tsx`](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/client/src/App.tsx) (App router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_app["App router<br/>[App.tsx]"]
  node_authui["Auth context<br/>[auth-context.tsx]"]
  node_checkinui["Check-in screen<br/>[check-in.tsx]"]
  node_clientapi["API client<br/>[queryClient.ts]"]
  node_mobile["Capacitor bridge<br/>[capacitor.ts]"]
end

subgraph group_server["API and domain"]
  node_server["HTTP server<br/>[index.ts]"]
  node_routing["Route registry<br/>[index.ts]"]
  node_auth["Auth routes<br/>[auth.ts]"]
  node_checkins["Check-in routes<br/>[checkins.ts]"]
  node_social["Connections and communities"]
  node_family["Family management<br/>[family.ts]"]
  node_admin["Admin and organisations"]
  node_alerts["Alerts and reminders<br/>[notifications.ts]"]
  node_scheduler["Background scheduler<br/>[scheduler.ts]"]
  node_billing["Plans and billing<br/>[billing.ts]"]
end

subgraph group_data["Persistence"]
  node_storage["Storage access<br/>[index.ts]"]
  node_legacydata["Legacy data methods<br/>[storage-legacy.ts]"]
  node_postgres[("PostgreSQL")]
  node_schema["Shared schema<br/>[schema.ts]"]
end

subgraph group_services["External services"]
  node_sms["SMS Works"]
  node_revenuecat["RevenueCat"]
  node_stripe["Stripe"]
end

node_person(("User"))

node_person -->|"uses"| node_app
node_app -->|"provides auth"| node_authui
node_app -.->|"routes to"| node_checkinui
node_checkinui -.->|"requests data"| node_clientapi
node_authui -->|"uses"| node_clientapi
node_mobile -->|"wraps bundle"| node_app
node_clientapi -->|"sends REST requests"| node_server
node_server -->|"registers routes"| node_routing
node_routing -->|"mounts"| node_auth
node_routing -->|"mounts"| node_checkins
node_routing -->|"mounts"| node_social
node_routing -->|"mounts"| node_family
node_routing -->|"mounts"| node_admin
node_routing -->|"mounts"| node_billing
node_auth -->|"sends verification"| node_sms
node_auth -->|"reads and writes"| node_storage
node_billing -->|"handles purchases"| node_revenuecat
node_billing -->|"handles legacy billing"| node_stripe
node_billing -->|"reads and writes"| node_storage
node_checkins -.->|"uses data access"| node_storage
node_social -.->|"uses data access"| node_storage
node_family -->|"uses data access"| node_storage
node_admin -->|"uses data access"| node_storage
node_scheduler -.->|"runs notifications"| node_alerts
node_server -->|"starts"| node_scheduler
node_storage -->|"composes methods"| node_legacydata
node_legacydata -->|"queries"| node_postgres
node_storage -->|"queries"| node_postgres
node_postgres -->|"uses tables"| node_schema

click node_app "https://github.com/asrarkhantscltd-del/check-in-app/blob/main/client/src/App.tsx"
click node_authui "https://github.com/asrarkhantscltd-del/check-in-app/blob/main/client/src/lib/auth-context.tsx"
click node_checkinui "https://github.com/asrarkhantscltd-del/check-in-app/blob/main/client/src/pages/check-in.tsx"
click node_clientapi "https://github.com/asrarkhantscltd-del/check-in-app/blob/main/client/src/lib/queryClient.ts"
click node_mobile "https://github.com/asrarkhantscltd-del/check-in-app/blob/main/client/src/lib/capacitor.ts"
click node_server "https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/index.ts"
click node_routing "https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/routes/index.ts"
click node_auth "https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/routes/auth.ts"
click node_checkins "https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/routes/checkins.ts"
click node_social "https://github.com/asrarkhantscltd-del/check-in-app/tree/main/server/routes"
click node_family "https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/routes/family.ts"
click node_admin "https://github.com/asrarkhantscltd-del/check-in-app/tree/main/server/routes/admin"
click node_alerts "https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/notifications.ts"
click node_scheduler "https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/scheduler.ts"
click node_billing "https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/routes/billing.ts"
click node_storage "https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/storage/index.ts"
click node_legacydata "https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/storage-legacy.ts"
click node_schema "https://github.com/asrarkhantscltd-del/check-in-app/blob/main/shared/schema.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_app,node_authui,node_checkinui,node_clientapi,node_mobile,node_person toneBlue
class node_server,node_routing,node_auth,node_checkins,node_social,node_family,node_admin,node_alerts,node_scheduler,node_billing toneAmber
class node_storage,node_legacydata,node_postgres,node_schema toneMint
class node_sms,node_revenuecat,node_stripe toneRose
```

## Components

### Client experience

- [App router](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Auth context](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/client/src/lib/auth-context.tsx): `client/src/lib/auth-context.tsx`
- [Check-in screen](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/client/src/pages/check-in.tsx): `client/src/pages/check-in.tsx`
- [API client](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/client/src/lib/queryClient.ts): `client/src/lib/queryClient.ts`
- [Capacitor bridge](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/client/src/lib/capacitor.ts): `client/src/lib/capacitor.ts`

### API and domain

- [HTTP server](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/index.ts): `server/index.ts`
- [Route registry](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/routes/index.ts): `server/routes/index.ts`
- [Auth routes](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/routes/auth.ts): `server/routes/auth.ts`
- [Check-in routes](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/routes/checkins.ts): `server/routes/checkins.ts`
- [Connections and communities](https://github.com/asrarkhantscltd-del/check-in-app/tree/main/server/routes): `server/routes`
- [Family management](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/routes/family.ts): `server/routes/family.ts`
- [Admin and organisations](https://github.com/asrarkhantscltd-del/check-in-app/tree/main/server/routes/admin): `server/routes/admin`
- [Alerts and reminders](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/notifications.ts): `server/notifications.ts`
- [Background scheduler](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/scheduler.ts): `server/scheduler.ts`
- [Plans and billing](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/routes/billing.ts): `server/routes/billing.ts`

### Persistence

- [Storage access](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/storage/index.ts): `server/storage/index.ts`
- [Legacy data methods](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/server/storage-legacy.ts): `server/storage-legacy.ts`
- **PostgreSQL**
- [Shared schema](https://github.com/asrarkhantscltd-del/check-in-app/blob/main/shared/schema.ts): `shared/schema.ts`

### External services

- **SMS Works**
- **RevenueCat**
- **Stripe**

### Other components

- **User**

## Connections

- User → App router: uses (evidence: `README.md`)
- App router → Auth context: provides auth (evidence: `client/src/App.tsx`)
- App router → Check-in screen: routes to
- Check-in screen → API client: requests data
- Auth context → API client: uses (evidence: `client/src/lib/auth-context.tsx`)
- Capacitor bridge → App router: wraps bundle (evidence: `README.md`)
- API client → HTTP server: sends REST requests (evidence: `README.md`)
- HTTP server → Route registry: registers routes (evidence: `server/index.ts`)
- Route registry → Auth routes: mounts (evidence: `server/routes/index.ts`)
- Route registry → Check-in routes: mounts (evidence: `server/routes/index.ts`)
- Route registry → Connections and communities: mounts (evidence: `server/routes/index.ts`)
- Route registry → Family management: mounts (evidence: `server/routes/index.ts`)
- Route registry → Admin and organisations: mounts (evidence: `server/routes/index.ts`)
- Route registry → Plans and billing: mounts (evidence: `server/routes/index.ts`)
- Auth routes → SMS Works: sends verification (evidence: `server/routes/auth.ts`)
- Auth routes → Storage access: reads and writes (evidence: `server/routes/auth.ts`)
- Plans and billing → RevenueCat: handles purchases (evidence: `server/routes/billing.ts`)
- Plans and billing → Stripe: handles legacy billing (evidence: `server/routes/billing.ts`)
- Plans and billing → Storage access: reads and writes (evidence: `server/routes/billing.ts`)
- Check-in routes → Storage access: uses data access
- Connections and communities → Storage access: uses data access (evidence: `server/routes/auth.ts`)
- Family management → Storage access: uses data access
- Admin and organisations → Storage access: uses data access (evidence: `server/routes/admin/core.ts`)
- Background scheduler → Alerts and reminders: runs notifications
- HTTP server → Background scheduler: starts (evidence: `server/index.ts`)
- Storage access → Legacy data methods: composes methods (evidence: `server/storage/index.ts`)
- Legacy data methods → PostgreSQL: queries (evidence: `README.md`)
- Storage access → PostgreSQL: queries (evidence: `README.md`)
- PostgreSQL → Shared schema: uses tables
