Building
Subdomain
2026
Connexu
A CRM for schools, giving every institution its own subdomain
connexu.hei.dev.br
A CRM a school uses to manage students, classes, schedules, teachers and groups. Every registered school is served on its own subdomain, and the address is what decides whose data you see.
The problem
A volleyball school, a music school and a language school all administer the same things: who is enrolled, who teaches, at what time, who missed class. In practice that lives in notebooks and spreadsheets. And once several schools share one system, the boundary between them is usually a single column in a table that any slip can cross.
The solution
A CRM built on top of that vocabulary: student, class, schedule, attendance, trial lesson. Three access profiles, admin, front desk and teacher, each seeing only what they need to do the job.
How it was built
Multi-tenant SaaS on a single database, with tenant_id on every table from the first migration. Each school is served on a subdomain, and host parsing is kept separate from the request so it can be tested: hosts outside the configured domain, bare IP addresses and multi-level subdomains are all rejected, so a forged Host header cannot pick a school. Next.js runs front and back in one process, which keeps it to a single deploy.
Stack
- Next.js
- TypeScript
- PostgreSQL
- Prisma
- Docker
- Vitest
- Isolation
- tenant_id on every table
- Routing
- One subdomain per school