Step 1: Solve the entire mathematical field of https://en.wikipedia.org/wiki/Topology
This isn’t just basic CRUD software that just needs some Postgres constraints to model trivial business logic. These are genuinely hard problems that mathematicians have been working on for decades.