Vault is a secure wallet web application built with React, TanStack Start, Supabase, and Vite. It includes a web frontend, Supabase-managed backend data and serverless functions, and deployment support for Vercel.
The project focuses on user authentication, wallet management, deposits/withdrawals, financial insights, KYC onboarding, and real-time transaction activity.
- Live production URL: https://tanstack-start-app.vault-os.workers.dev/
- Open the live URL in a browser.
- Sign up with an email address or log in with an existing account.
- Complete any required KYC onboarding flows.
- Use the dashboard to view wallet balances, transactions, and financial recommendations.
- Deposit funds, withdraw money, send payments, and review receipts from the app.
- React 19
- TanStack Router & TanStack Start
- Vite 7
- Tailwind CSS 4
- Supabase JS
- pnpm package manager
- Cloudflare wrangler deployment support
package.json— root package config and shared dependencies.pnpm-workspace.yaml— workspace configuration.vite.config.ts— Vite config for TanStack Start SSR and client build.vite.spa.config.ts— dedicated SPA-only build config.tsconfig.json— global TypeScript configuration.vercel.json— Vercel build and routing configuration.wrangler.jsonc— Cloudflare worker / Vite plugin integration config.README.md— project overview and usage notes..env.local— local environment variables for the web app (not committed).docs/README.md— this generated documentation file.
src/main.tsx— client entry point.src/server.ts— custom SSR wrapper for TanStack Start.src/router.tsx— router creation with query client and scroll restoration.src/routeTree.gen.ts— generated TanStack Router route tree.src/routes/— route page modules.src/components/— reusable UI components.src/hooks/— custom hooks.src/lib/— utilities, error capture, profile signal, and shared helpers.src/api/— Supabase and payment integration logic.src/styles.css— application styling and theming.
api/ssr.ts— Vercel server handler that forwards requests to the built SSR bundle.supabase/— Supabase local development config, database migrations, seed data, and edge functions.supabase/functions/— server-side functions for account management, payments, Stripe, M-Pesa, AI chat, and support flows.public/— static assets.dist/— build output.
The web application is built as a TanStack Start SSR app with the following bootstrap flow:
src/main.tsxinitializes the client and router.src/router.tsxcreates a TanStack Router instance usingrouteTreeand aQueryClient.src/routes/__root.tsxdefines the root route shell, metadata, error boundaries, and profile hydration.src/server.tswraps the generated SSR entry with error normalization for server rendering.vercel.jsonroutes all non-asset requests toapi/ssr.ts, which forwards traffic to the built SSR bundle.
The app supports these primary routes:
/— landing page / sign-in entrypoint/login— login form/sign-up— sign-up flow/dashboard— authenticated dashboard/finance-advisor— financial advisory page/finance-hub— finance hub/help— help page/kyc— KYC onboarding/loans— loans page/savings— savings page/transactions— transaction history/settings— user/settings page/pay/$username— pay-by-username flow
The routes are generated in src/routeTree.gen.ts and mounted under the root route defined in src/routes/__root.tsx.
src/components/top-nav.tsxhandles navigation, profile, and sign-out behavior.src/components/ui/contains shared UI primitives, inputs, buttons, dialogs, and layout utilities.src/componentscontains page-specific panels, dashboards, finance advisors, receipt history, and wallet actions.- The app uses Radix UI primitives, Tailwind CSS, and class variance authority for styling.
@tanstack/react-queryis used for data fetching and caching.zustandmay be used for lightweight state storage across the app.- Profile state is managed through
src/lib/profile-signal.tsand hydrated from Supabase session state. - Supabase is configured in
src/api/supabase.tsand shared across hooks and components.
supabase/config.tomlconfigures local Supabase services, including API, DB, realtime, storage, auth, and studio.- Local Supabase ports are set to
54321for the API,54322for the database, and54323for Studio. - Auth is enabled with email sign-up and refresh token rotation.
The project includes a long migration history under supabase/migrations/.
Important migration topics include:
- enum creation
- transactions and wallet tables
- withdrawals and secure withdrawal logic
- ledger/ledger entries
- savings, loans, notifications, receipts, and financial insights
- M-Pesa transaction support
- Stripe transaction logging and issuing card support
- real-time replication and notification triggers
supabase/seed.sqlpopulates sample sub-accounts, ledger entries, and M-Pesa transactions for the first authenticated user.
Key serverless functions include:
delete-account/— account deletion logicfinancial-health-check/— financial health evaluationgemini-chat/— AI chat integrationmpesa-callback/— M-Pesa callback handlermpesa-deposit/— M-Pesa deposit flowsend-support-email/— support email sendingstripe-checkout/— Stripe checkout supportstripe-create-intent/— Stripe payment intentsstripe-issuing/— Stripe issuing card operationsstripe-issuing-auth/— Stripe issuing auth flowstripe-webhook/— Stripe webhook event handling
The mobile application is built using Flutter and is maintained in a separate repository. It features a fully authenticated flow designed to perfectly complement this web vault.
- Repository: https://github.com/Nevy11/vault-mobile
- It authenticates against the same Supabase backend.
- It shares the exact same database schema (profiles, transactions, wallets).
The project is configured for Vercel deployment:
vercel.jsonbuilds the client bundle fromdist/clientand routes all application traffic throughapi/ssr.ts.- Static assets under
/assets/*are served directly. - All remaining paths are forwarded to server-side rendering.
src/server.tsloads the generated TanStack Start server entry and catches catastrophic SSR errors.api/ssr.tsadapts Express-style requests into Web Fetch requests, forwards them to the SSR server, and pipes back the response.
From the repo root:
pnpm install
pnpm devThe dev server uses Vite and typically runs on http://localhost:8081.
Use Supabase CLI tooling for local development and migrations.
The web app uses environment variables in .env.local, including:
VITE_SUPABASE_URLVITE_SUPABASE_PUBLISHABLE_KEYorVITE_SUPABASE_ANON_KEY
Expo may also accept EXPO_PUBLIC_SUPABASE_URL and EXPO_PUBLIC_SUPABASE_ANON_KEY.
From the root:
pnpm dev— start the Vite development serverpnpm run build— build both SPA and SSR artifactspnpm run build:spa— build the client bundle onlypnpm run build:ssr— build the SSR server bundle onlypnpm run preview— preview the production build locallypnpm run lint— run ESLintpnpm run format— run Prettier
- The app uses TanStack Start for SSR-friendly React rendering and a generated route tree for predictable routing.
- Profile state is hydrated from Supabase session events and stored in
profileSignal. - The
TopNavcomponent is a global shell element that handles sign-out and displays profile status. - Supabase functions support payments, account deletion, AI chat, Stripe issuing, and M-Pesa integration.
- The project maintains a strong database migration history in
supabase/migrations/to support financial workflows, notifications, receipts, and data integrity.
- Edge Functions: The
step-up-authedge function occasionally throws schema cache or missing errors; the web frontend was temporarily modified to bypass this requirement for high-value transactions. The edge function should be audited and fully restored. - TanStack Router Code Splitting: Ensure all components in
src/routes/avoid named exports unless explicitly required by the router, to prevent bundle size warnings (recently fixed forretrieve-account.tsxandconfirm-deletion.tsx). - Postgres RPC Payload Parity: The
vault_transferRPC function signature in the database recently diverged from the frontend payload (p_idempotency_keyparameter mismatch). Always ensure frontend payloads match the exact database schema during migrations. - UI Architecture: The Quick Send (Recent & Frequent recipients) layout was recently moved into the grid layout on the
Transactionspage to optimize desktop space. Future complex forms should carefully considermd:grid-cols-2column distributions.
README.md— root project notes and quick-start guidance.supabase/config.toml— local Supabase development configuration.supabase/migrations/— ordered database schema history.api/ssr.ts— Vercel SSR request adapter.src/routes/__root.tsx— application shell, metadata, and error boundaries.
Last updated: June 23, 2026.