# manuelsatta05-glitch/snakekeeper architecture

> Architecture diagram of the GitHub repository manuelsatta05-glitch/snakekeeper, 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/manuelsatta05-glitch/snakekeeper
- Repository: https://github.com/manuelsatta05-glitch/snakekeeper

## Overview

SnakeKeeper is a browser-based snake-breeding and care-management app delivered as a PWA, with sales, transfers, fair-event, and subscription workflows. Users manage their collection and its records in the main app; they can also transfer sold-snake details, register for paid plans, or use the separate fair page. The sampled source shows the app’s Supabase and Stripe interactions and several server-side workflows. The README is empty and app.js excerpts are partial, so some feature wiring and database structure cannot be confirmed.

Main entry points: [`app.js`](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/app.js) (App runtime), [`supabase/functions/usage-monitor/index.ts`](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/usage-monitor/index.ts) (Usage monitor), [`supabase/functions/cancel-subscription/index.ts`](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/cancel-subscription/index.ts) (Cancel subscription), [`index.html`](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/index.html) (Main app page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Care Management"]
  node_main_page["Main app page<br/>[index.html]"]
  node_app_runtime["App runtime<br/>[app.js]"]
  node_care_records["Care records<br/>[app.js]"]
  node_breeding["Breeding records<br/>[app.js]"]
end

subgraph group_commerce["Sales and Plans"]
  node_sales["Sold snakes<br/>[app.js]"]
  node_transfers["Snake transfers<br/>[app.js]"]
  node_fair_page["Fair events<br/>[fiera.html]"]
  node_plans["Plan management<br/>[app.js]"]
  node_checkout["Create checkout<br/>[index.ts]"]
  node_checkout_verify["Verify checkout<br/>[index.ts]"]
  node_stripe_webhook["Stripe event handler<br/>[index.ts]"]
  node_cancel_subscription["Cancel subscription<br/>[index.ts]"]
  node_delete_account["Delete account<br/>[index.ts]"]
  node_transfer_service["Transfer service<br/>[index.ts]"]
end

subgraph group_operations["Platform Operations"]
  node_health_check["Daily health check<br/>[index.ts]"]
  node_usage_monitor["Usage monitor<br/>[index.ts]"]
  node_monitor_page["Monitor page<br/>[monitor.html]"]
end

subgraph group_content["Guides and PWA"]
  node_guides["Snake care guides"]
  node_service_worker["PWA service worker<br/>[sw.js]"]
end

node_user(("Snake keeper"))
node_supabase[("Supabase")]
node_stripe["Stripe"]
node_resend["Resend email"]
node_uptimerobot["UptimeRobot"]

node_user -->|"opens"| node_main_page
node_user -->|"uses"| node_fair_page
node_main_page -->|"loads"| node_app_runtime
node_app_runtime -->|"manages"| node_care_records
node_app_runtime -->|"manages"| node_breeding
node_app_runtime -->|"manages"| node_sales
node_app_runtime -->|"manages"| node_transfers
node_app_runtime -->|"manages"| node_plans
node_app_runtime -->|"reads/writes"| node_supabase
node_app_runtime -->|"requests checkout"| node_checkout
node_app_runtime -->|"verifies payment"| node_checkout_verify
node_app_runtime -->|"requests cancellation"| node_cancel_subscription
node_app_runtime -->|"requests deletion"| node_delete_account
node_app_runtime -->|"requests transfer"| node_transfer_service
node_checkout -->|"creates session"| node_stripe
node_checkout -->|"checks limits/logs"| node_supabase
node_checkout_verify -->|"checks session"| node_stripe
node_checkout_verify -->|"updates plan"| node_supabase
node_stripe -->|"sends events"| node_stripe_webhook
node_stripe_webhook -->|"updates plan/logs events"| node_supabase
node_stripe_webhook -.->|"sends email"| node_resend
node_cancel_subscription -->|"cancels/refunds"| node_stripe
node_cancel_subscription -->|"checks user/logs"| node_supabase
node_cancel_subscription -.->|"sends email"| node_resend
node_delete_account -->|"cancels subscription"| node_stripe
node_delete_account -->|"deletes account data"| node_supabase
node_transfer_service -->|"reads/writes transfers"| node_supabase
node_transfer_service -.->|"sends invitation"| node_resend
node_health_check -->|"reads logs/counts"| node_supabase
node_health_check -.->|"sends report"| node_resend
node_usage_monitor -->|"checks rate limit"| node_supabase
node_usage_monitor -->|"reads revenue"| node_stripe
node_usage_monitor -->|"reads monitor usage"| node_uptimerobot
node_usage_monitor -->|"reads email usage"| node_resend
node_user -->|"opens"| node_monitor_page
node_monitor_page -->|"requests metrics"| node_usage_monitor
node_user -->|"reads"| node_guides
node_main_page -.->|"registers PWA"| node_service_worker

click node_main_page "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/index.html"
click node_app_runtime "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/app.js"
click node_care_records "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/app.js"
click node_breeding "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/app.js"
click node_sales "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/app.js"
click node_transfers "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/app.js"
click node_fair_page "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/fiera.html"
click node_plans "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/app.js"
click node_checkout "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/create-checkout/index.ts"
click node_checkout_verify "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/verify-checkout/index.ts"
click node_stripe_webhook "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/stripe-webhook/index.ts"
click node_cancel_subscription "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/cancel-subscription/index.ts"
click node_delete_account "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/delete-account/index.ts"
click node_transfer_service "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/transfer-snake/index.ts"
click node_health_check "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/daily-health-check/index.ts"
click node_usage_monitor "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/usage-monitor/index.ts"
click node_monitor_page "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/monitor.html"
click node_guides "https://github.com/manuelsatta05-glitch/snakekeeper/tree/main/guide"
click node_service_worker "https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/sw.js"

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_main_page,node_app_runtime,node_care_records,node_breeding toneBlue
class node_sales,node_transfers,node_fair_page,node_plans,node_checkout,node_checkout_verify,node_stripe_webhook,node_cancel_subscription,node_delete_account,node_transfer_service,node_supabase toneAmber
class node_health_check,node_usage_monitor,node_monitor_page toneMint
class node_guides,node_service_worker toneRose
class node_user,node_stripe,node_resend,node_uptimerobot toneIndigo
```

## Components

### Care Management

- [Main app page](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/index.html): `index.html`
- [App runtime](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/app.js): `app.js`
- [Care records](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/app.js): `app.js`
- [Breeding records](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/app.js): `app.js`

### Sales and Plans

- [Sold snakes](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/app.js): `app.js`
- [Snake transfers](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/app.js): `app.js`
- [Fair events](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/fiera.html): `fiera.html`
- [Plan management](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/app.js): `app.js`
- [Create checkout](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/create-checkout/index.ts): `supabase/functions/create-checkout/index.ts`
- [Verify checkout](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/verify-checkout/index.ts): `supabase/functions/verify-checkout/index.ts`
- [Stripe event handler](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/stripe-webhook/index.ts): `supabase/functions/stripe-webhook/index.ts`
- [Cancel subscription](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/cancel-subscription/index.ts): `supabase/functions/cancel-subscription/index.ts`
- [Delete account](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/delete-account/index.ts): `supabase/functions/delete-account/index.ts`
- [Transfer service](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/transfer-snake/index.ts): `supabase/functions/transfer-snake/index.ts`

### Platform Operations

- [Daily health check](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/daily-health-check/index.ts): `supabase/functions/daily-health-check/index.ts`
- [Usage monitor](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/supabase/functions/usage-monitor/index.ts): `supabase/functions/usage-monitor/index.ts`
- [Monitor page](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/monitor.html): `monitor.html`

### Guides and PWA

- [Snake care guides](https://github.com/manuelsatta05-glitch/snakekeeper/tree/main/guide): `guide`
- [PWA service worker](https://github.com/manuelsatta05-glitch/snakekeeper/blob/main/sw.js): `sw.js`

### Other components

- **Snake keeper**
- **Supabase**
- **Stripe**
- **Resend email**
- **UptimeRobot**

## Connections

- Snake keeper → Main app page: opens
- Snake keeper → Fair events: uses
- Main app page → App runtime: loads
- App runtime → Care records: manages
- App runtime → Breeding records: manages
- App runtime → Sold snakes: manages
- App runtime → Snake transfers: manages
- App runtime → Plan management: manages
- App runtime → Supabase: reads/writes
- App runtime → Create checkout: requests checkout
- App runtime → Verify checkout: verifies payment
- App runtime → Cancel subscription: requests cancellation
- App runtime → Delete account: requests deletion
- App runtime → Transfer service: requests transfer
- Create checkout → Stripe: creates session
- Create checkout → Supabase: checks limits/logs
- Verify checkout → Stripe: checks session
- Verify checkout → Supabase: updates plan
- Stripe → Stripe event handler: sends events
- Stripe event handler → Supabase: updates plan/logs events
- Stripe event handler → Resend email: sends email
- Cancel subscription → Stripe: cancels/refunds
- Cancel subscription → Supabase: checks user/logs
- Cancel subscription → Resend email: sends email
- Delete account → Stripe: cancels subscription
- Delete account → Supabase: deletes account data
- Transfer service → Supabase: reads/writes transfers
- Transfer service → Resend email: sends invitation
- Daily health check → Supabase: reads logs/counts
- Daily health check → Resend email: sends report
- Usage monitor → Supabase: checks rate limit
- Usage monitor → Stripe: reads revenue
- Usage monitor → UptimeRobot: reads monitor usage
- Usage monitor → Resend email: reads email usage
- Snake keeper → Monitor page: opens
- Monitor page → Usage monitor: requests metrics
- Snake keeper → Snake care guides: reads
- Main app page → PWA service worker: registers PWA
