Appearance
Tech stack & conventions
Platform
- Database / backend: Supabase — Postgres 15+, Row Level Security, Auth, Realtime, Edge Functions (Deno), Storage,
pg_cron,pgmq,pg_net. - Frontend: React + TypeScript (Next.js App Router recommended). Two apps, or one app with role-gated routes — see Surfaces.
- Design system: Obsidian Terminal (dark-first; Syne / DM Sans / JetBrains Mono; Signal Teal / Forge Amber / Ember Coral / Deep Violet). All dashboards, admin, and documents use it.
- Money: never use floats for money in app code. Store amounts as
numeric(20,4)in Postgres; in TS use a decimal library (e.g.decimal.js) at boundaries. (Tonder usestoMoney()/toRate()Decimal helpers — keep the discipline.) - IDs: UUID v7 for journals, ledger entries, processes, settlements (time-sortable).
- Language: code / comments in English; user-facing copy bilingual ES/EN.
Repos / environments
- Mirror Tonder's stage model:
dev,stage,pdn(prod). Supabase project per stage (or branching). - Conventional commits (
feat,fix,refactor,docs,test,chore); pre-commit lint + format (ESLint + Prettier). - Migrations are versioned SQL under
supabase/migrations. RLS policies live in migrations, never applied by hand.
Layering (hexagonal, adapted)
Keep Tonder's hexagonal discipline; drop the AWS / RxJS specifics.
| Layer | Vecnet location | Responsibility |
|---|---|---|
| Domain | src/service/ (pure TS) and supabase/functions/_shared | Business logic: fee calc, journal generation, settlement math. No framework deps. |
| Application | Edge Functions (supabase/functions/*) + Postgres functions | Entry points: HTTP handlers, queue consumers, cron jobs. |
| Ports | src/repository/I*.ts | Interfaces between domain and infra. I prefix retained. |
| Infrastructure | src/gateway/ | Adapters: Supabase client, Storage, pgmq, rail webhook clients. |
Naming conventions carry over from Tonder: I-prefixed interfaces, PascalCase classes/services, camelCase methods. ESLint limits (no any, explicit return types, function-length caps) carry over.