How prateek004/dormbook-tested works
DormBook is a PG/hostel operations system for property staff and owners. The principal workflow is staff setting up floors, rooms and beds, checking residents in and out, recording payments and managing balances, then reviewing operational and financial reports. The SPA calls an Express API whose routes apply authentication and property/role checks before dispatching to domain controllers; those controllers use SQLite-backed state. The README also documents receipts, exports, audit history, staff management and optional messaging. Some subsystem links are based on documented capabilities and the file tree; unsampled controller wiring is not asserted.
Main entry points: index.js API routes · connection.js SQLite database · checkinController.js Resident stays · paymentsController.js Payments and balances
Components 26
User and API
- Web application
public/js/app.js - HTTP server
src/server.js - API routes
src/routes/index.js
Property Operations
- Sign-in and accounts
src/controllers/authController.js - Staff access
src/controllers/accessController.js - Property and beds
src/controllers/bedsController.js - Resident stays
src/controllers/checkinController.js - Bookings
src/controllers/bookingsController.js - Resident documents
src/controllers/documentsController.js
Finance and Records
- Add-on charges
src/controllers/addonsController.js - Payments and balances
src/controllers/paymentsController.js - Ledger operations
src/services/ledger.js - Receipt generation
src/services/receiptService.js - Finance and exports
src/controllers/financeController.js - Daily reports
src/controllers/dailyReportsController.js - Report registers
src/controllers/registersController.js - Reconciliation
src/controllers/reconciliationController.js
Shared Platform
- Access controls
src/middleware/auth.js - Audit history
src/middleware/auditLog.js - Scheduled tasks
src/services/scheduler.js - WhatsApp messaging
src/services/whatsappService.js - Login-code SMS
src/services/smsService.js - SQLite database
src/db/connection.js
Other components
- Property staff
- WhatsApp provider
- MSG91
Connections 40
- Property staff → Web application: uses
- Web application → HTTP server: sends API requests
- HTTP server → API routes: mounts API
- HTTP server → Web application: serves app
- API routes → Access controls: guards routes
- API routes → Sign-in and accounts: dispatches
- API routes → Staff access: dispatches
- API routes → Property and beds: dispatches
- API routes → Resident stays: dispatches
- API routes → Bookings: dispatches
- API routes → Add-on charges: dispatches
- API routes → Payments and balances: dispatches
- API routes → Finance and exports: dispatches
- API routes → Daily reports: dispatches
- API routes → Report registers: dispatches
- API routes → Reconciliation: dispatches
- API routes → Resident documents: dispatches
- Sign-in and accounts → SQLite database: reads and writes
- Property and beds → SQLite database: reads and writes
- Resident stays → SQLite database: reads and writes
- Resident stays → Audit history: records actions
- Resident stays → WhatsApp messaging: schedules message
- Payments and balances → SQLite database: reads and writes
- Payments and balances → Ledger operations: records transactions
- Payments and balances → Receipt generation: creates receipts
- Ledger operations → SQLite database: reads and writes
- Receipt generation → SQLite database: stores receipt
- Finance and exports → SQLite database: reads and writes
- Finance and exports → Ledger operations: uses balances
- Daily reports → SQLite database: reads reports data
- Daily reports → Ledger operations: uses ledger data
- Report registers → SQLite database: reads report data
- Reconciliation → SQLite database: reads and writes
- Resident documents → SQLite database: reads and writes
- Resident documents → Audit history: records access
- Scheduled tasks → SQLite database: reads and writes
- Scheduled tasks → WhatsApp messaging: queues notifications
- WhatsApp messaging → WhatsApp provider: sends messages
- Login-code SMS → MSG91: sends login codes
- Sign-in and accounts → Login-code SMS: sends login code