Defence in depth
How read-only architecture, AES-256 encryption and RLS combine into a single security model
Security in Manalyx is not a feature shelf, it is an architecture choice that ripples into every module. The application is structurally read-only against external sources (no broker API write scopes, no PSD2 write tokens, no crypto signing layer), sensitive fields are encrypted before they reach the database, and Postgres Row-Level Security ensures one user's queries can only ever return one user's rows. The combined effect is that even a worst-case server compromise cannot move your funds and cannot leak another user's data into yours.
Row-Level Security as the last line of defence
Every table that holds user data carries an RLS policy keyed on auth.uid(). Queries from the application context are filtered automatically — no client-side filter that a forgotten WHERE clause could bypass. Roles such as admin live in a separate user_roles table behind a SECURITY DEFINER helper to prevent privilege escalation through self-elevation.
Edge Functions as the only path to external APIs
API keys for CoinGecko, Helius, Stripe and similar services live exclusively in Supabase secrets and are read inside Edge Functions. The browser never sees them. This means a stolen browser session cannot exfiltrate keys, and rate-limit abuse is bounded to what the cron jobs are willing to send — not to whatever a client decides to send.
Audit log append-only protection
The audit_logs table records sensitive actions (auth events, encryption-key reads, configuration changes) and its RLS policies allow inserts but block updates and deletes — even from elevated roles. If something goes wrong, the trail of what happened is preserved by design rather than by trust.