Skip to content

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 uses toMoney()/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.

LayerVecnet locationResponsibility
Domainsrc/service/ (pure TS) and supabase/functions/_sharedBusiness logic: fee calc, journal generation, settlement math. No framework deps.
ApplicationEdge Functions (supabase/functions/*) + Postgres functionsEntry points: HTTP handlers, queue consumers, cron jobs.
Portssrc/repository/I*.tsInterfaces between domain and infra. I prefix retained.
Infrastructuresrc/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.

Vecnet — Build Spec v0.2 · Obsidian Terminal