What it is
Hostel ERP started as software for one real hostel. I rebuilt it into a product any PG or hostel chain could run: branches, rooms, cots, a seven-step admission wizard, fee schedules with electricity charges and late-fee rules, complaints with a full lifecycle, vacate with financial settlement, and a student portal beside the admin one.
The operational core is a nightly job. At 2 AM a guarded nine-stage pipeline generates payment schedules, accrues two kinds of late fees, marks overdue accounts, fires templated reminders, purges expired archives, and releases beds whose checkout time has passed, rewriting branch occupancy counters as it goes. The owner wakes up to a hostel that already did its paperwork.
Before writing the product I wrote the business case: a pricing model researched against 14 competitors, with regional pricing in five currencies. Building the product and deciding what it should cost are the same job.
Architecture
Decisions that mattered
Branch scoping as a hard boundary
Every request carries the user's accessible branches, and every query intersects with them. A manager of two branches cannot see a third, and a super admin bypass is explicit, not accidental. The multi-hostel tenancy seam is documented in code for the day it is needed.
Page-level RBAC that owners configure themselves
Roles map to pages with Full, ReadOnly or None, checked before a route renders. Hostel owners build their own roles from that matrix instead of calling me.
Billing as an unattended pipeline
Recurring billing lives on the admission record and feeds a payment schedule with a full late-fee trail. The nightly cron is guarded against double runs and ordered so each stage feeds the next, ending with beds auto-releasing after checkout.
Webhooks, because software talks to software
Alert rules fan out to in-app, email and outbound webhooks signed with HMAC, so a chain can wire the ERP into whatever else they run. Announcements support template variables and automation triggers for festivals, due dates and new admissions.