How kenoplug/keno-vault works
Purpose and Entry Points
Keno Vault is a static, browser-based personal net-worth tracker with free/pro feature gating. The primary user entry is index.html; authenticated dashboard and settings views are under pages/dashboard.html and pages/settings.html. Vercel serves the frontend and routes serverless endpoints via vercel.json and server.js.
Frontend Application Shell
The vanilla JavaScript client owns UI rendering, authentication state, asset CRUD, dashboard KPIs, charts, history, exports, and plan-aware feature access. js/app.js is the central application coordinator, with finance computations separated into js/calculators.js. Shared deployment, Supabase, admin, and site constants are configured in js/config.js.
Paths:
• index.html
• js/app.js
• js/config.js
Dashboard and Financial Intelligence
Dashboard presentation is split from the core client behavior: pages/dashboard.html supplies the dashboard view and css/dashboard.css provides dedicated styling. Financial modeling—including retirement, debt, allocation, depreciation, tax, and net-worth-related calculations—is concentrated in js/calculators.js, allowing UI flows to consume computed results rather than embed formulas.
Paths:
• pages/dashboard.html
• css/dashboard.css
• js/calculators.js
Identity, Data, and Authorization Boundary
Supabase provides Google authentication, PostgreSQL persistence, synchronization, and row-level security. supabase-migration.sql defines the backend schema/policies, while the browser uses the configured public Supabase credentials. The frontend should remain limited to user-scoped operations protected by RLS; privileged subscription updates and account deletion run in Edge Functions.
Paths:
• supabase-migration.sql
• js/config.js
• supabase/functions/delete-account/index.ts
Security and Local Privacy Controls
Sensitive client-side controls—session auto-lock, PIN/privacy behavior, and encrypted backup mechanisms—are organized in js/security.js. Encryption uses the browser Web Crypto API, keeping encryption/decryption in the client boundary rather than requiring a separate cryptographic service.
Paths:
• js/security.js
• js/app.js
• pages/settings.html
Subscription and Payment Flow
A user initiates Pro purchase through a Supabase Edge Function that creates a Bachs checkout. Bachs asynchronously calls the webhook function after payment; that trusted server-side path activates or updates the subscription record. The client then reads subscription state to enforce free limits and unlock Pro modules. Bachs supports cards, bank transfers, mobile money, and crypto.
Paths:
• supabase/functions/create-checkout/index.ts
• supabase/functions/bachs-webhook/index.ts
• supabase-migration.sql
Server-Side Automation and Integrations
Supabase Edge Functions isolate external integrations and privileged actions from the static frontend. ai-advisor provides an AI-backed advisory boundary, while send-notification supports outbound notification workflows. The frontend additionally obtains foreign-exchange data from open.er-api.com; Chart.js renders client-side visualizations.
Paths:
• supabase/functions/ai-advisor/index.ts
• supabase/functions/send-notification/index.ts
• supabase/functions/bachs-webhook/index.ts
Runtime and Deployment
The product is primarily a static HTML/CSS/JavaScript application deployed on Vercel. Supabase hosts auth, database, and Deno/TypeScript Edge Functions; Vercel configuration and the Node server file define deployment/runtime integration points. Tailwind is loaded from CDN, with custom CSS retained for dashboard-specific behavior.
Paths:
• vercel.json
• server.js
• css/dashboard.css
Main entry points: app.js App coordinator · vercel.json Vercel deployment · index.html Public entry · dashboard.html Dashboard view
Components 19
Browser App
Static vanilla JavaScript client.
- Public entry
index.html - App coordinator · Owns UI, auth state, assets, exports, and plan access.
js/app.js - Client configuration · Supabase and deployment constants.
js/config.js - Dashboard view
pages/dashboard.html - Dashboard styling
css/dashboard.css - Financial calculators · Net-worth, retirement, debt, allocation, tax, and depreciation models.
js/calculators.js - Local privacy controls · Auto-lock, PIN/privacy behavior, and encrypted backups via Web Crypto.
js/security.js - Settings view
pages/settings.html
Supabase Backend
Identity, user-scoped data, and privileged functions.
- Auth, PostgreSQL & RLS · Google identity and user-scoped persistence protected by row-level security.
supabase-migration.sql - Create checkout · Creates Bachs Pro checkout sessions.
supabase/functions/create-checkout/index.ts - Payment webhook · Trusted payment handler that updates subscriptions.
supabase/functions/bachs-webhook/index.ts - Delete account · Privileged account deletion.
supabase/functions/delete-account/index.ts - AI advisor · Server-side AI advisory boundary.
supabase/functions/ai-advisor/index.ts - Notifications · Outbound notification workflow.
supabase/functions/send-notification/index.ts
External Services
- Bachs payments · Supports cards, transfers, mobile money, and crypto.
- Exchange-rate API
- Chart.js
Hosting
- Vercel deployment · Serves the frontend and serverless routes.
vercel.json - Node server integration
server.js
Connections 19
- Public entry → App coordinator: loads
- App coordinator → Client configuration: reads
- App coordinator → Dashboard view: renders
- Dashboard view → Dashboard styling: styled by
- App coordinator → Financial calculators: uses
- App coordinator → Local privacy controls: uses
- Settings view → Local privacy controls: configures
- App coordinator → Auth, PostgreSQL & RLS: user-scoped auth and data
- App coordinator → Create checkout: starts Pro purchase
- Create checkout → Bachs payments: creates checkout
- Bachs payments → Payment webhook: payment event
- Payment webhook → Auth, PostgreSQL & RLS: activates subscription
- App coordinator → Delete account: requests deletion
- App coordinator → AI advisor: requests advice
- App coordinator → Notifications: triggers
- App coordinator → Exchange-rate API: fetches rates
- App coordinator → Chart.js: renders charts
- Vercel deployment → Public entry: serves
- Vercel deployment → Node server integration: routes runtime