Live App Breakdown

AWS Motor Club

This document renders from the same config file and live database as the app β€” it cannot drift out of date. Theme and term rules are two-way: saving here rewrites config/app-config.json / the term_rules table, and the app uses the new values immediately. ← back to the app

Identity & theme

Palette is applied by the app at boot from config. Change a color, hit save, reload the app tab.

 

Term rules β€” the core business logic

Term length is derived from what the product cost the dealer. An exact dealer-cost match uses that rule; no match falls back to the product default (flagged unmatched for review). Rules are data, not code β€” edits apply to new registrations; existing expirations keep their dates.

Live state (straight from the database)

By product

ProductUnitsActive

Dealerships

DealerUnitsProfit

Pipelines & statuses read-only β€” lives in code

Coverage (derived from expires_on)

activeexpires today or later (days remaining shown)
expiredpast expiry (days since shown)
unknownregistration has no expiry date

Term source on a registration

ruledealer cost matched a price rule exactly
defaultproduct has no rules; default term applies (GlassGuard)
unmatchedproduct has rules but cost matched none β€” review

Claim lifecycle

new β†’ in_progress β†’ awaiting_customer β†’ approvedopen
closed_paid / closed_deniedclosed (payout = sum of claim items)

Data model

customersperson + address (lat/lng for roadside ranking)
products / term_rulesTireGuard, GlassGuard + price→term rules
registrationsa sold contract: VIN, deal date, costs, expiry
claims / claim_itemsissue + itemized payouts
activitycalls, texts, emails, notes, status changes
dealerships / roadside_vendorssellers + road rangers

Routes

Ops

node server/server.jsrun the app (port 8788, PORT env overrides)
data/aws-motor-club.dbSQLite database (seeded with demo data on first run)
/breakdownthis document