SGCRP: Hierarchical Network Management (Demo)
Demo MVP to organize a network of people into a four-level hierarchy with per-branch data isolation.
The challenge
Managing a large network of people in lists and spreadsheets gives no per-branch isolation or change traceability, and moving a whole group from one owner to another is error-prone.
Technical decision
Model the hierarchy with `ltree` plus a parent-child relation in PostgreSQL, after evaluating and discarding recursive CTEs, nested sets and closure tables. Each user only sees their branch thanks to RLS policies that read the node path from JWT claims; moving a whole branch is an atomic transaction with locking and cycle checks; sensitive data is encrypted with pgcrypto and recorded in an insert-only audit log.
Impact & outcome
MVP with demo data; atomic reassignment of a 6-node branch was verified. Identity verification and offline mode are planned, not built.