Back to projects
Multi-branch Private repository
Multi-branch Barbershop
Multi-branch version of the barbershop system: companies, branches and data separated per branch.
- Type
- Custom system
- Database
- PostgreSQL
- Data models
- 32 models in PostgreSQL
What it solves
When a barbershop grows to several locations, each branch needs its own schedule, cash register and staff without mixing data. This system adapts the barbershop system's foundation to a multi-branch model without rewriting it.
Key features
- Companies and branches: each user works within the branch they have active.
- Branch selector in the panel for owners and front desk.
- All operations (bookings, cash, inventory, staff) are separated per branch.
- Historical data import: appointments, barbers and customers from the previous system.
Architecture and technical decisions
- A middleware using AsyncLocalStorage captures the x-branch-id header on every request.
- A Prisma extension filters reads and assigns the branch on writes, without touching the 22 inherited modules.
- An HTTP interceptor in Angular injects the active branch into every call.
- NestJS 11, Prisma 6 and PostgreSQL 16, with Angular 21 and Tailwind on the panel.
- Deployed with Docker Compose.