How prateek004/updating-dormbook works
DormBook is a property and dormitory management application for handling residents, beds, bookings, payments, finances, staff, and operational reports. The main workflow is staff using the web app to authenticate, enter a routed operation such as check-in, and have the relevant controller read or update SQLite; money-related operations use the central ledger. Reporting and account administration are distinct product branches. The README documents role-based capabilities and optional WhatsApp messaging. Several controller subsystems are represented by their directory because their implementation was not sampled; their detailed internal relationships are therefore omitted.
Main entry points: index.js API routes · ledger.js Money ledger · checkinController.js Resident check-in · connection.js SQLite database
Components 28
Web client
- Web app
public/js/app.js
Access and administration
- API routes
src/routes/index.js - Authentication
src/controllers/authController.js - Staff access
src/controllers/accessController.js - Auth and role guards
src/middleware/auth.js - Permission checks
src/middleware/permissions.js - Accounts
src/controllers/accountsController.js - Staff management
src/controllers/staffController.js
Property operations
- Resident check-in
src/controllers/checkinController.js - Beds and rooms
src/controllers/bedsController.js - Bookings
src/controllers/bookingsController.js - Add-on charges
src/controllers/addonsController.js - Resident documents
src/controllers/documentsController.js
Finance and reporting
- Payments and receipts
src/controllers/paymentsController.js - Money ledger
src/services/ledger.js - Finance operations
src/controllers/financeController.js - Payroll
src/controllers/payrollController.js - Daily reports
src/controllers/dailyReportsController.js - Report registers
src/controllers/registersController.js - Management summary
src/controllers/summaryController.js
Persistence and services
- Database initialization
src/db/init.js - SQLite database
src/db/connection.js - Audit logging
src/middleware/auditLog.js - WhatsApp notifications
src/services/whatsappService.js - IST time utilities
src/util/time.js - ID proof utilities
src/util/idproof.js
Other components
- Property staff
- WhatsApp provider
Connections 36
- Property staff → Web app: uses
- Web app → API routes: calls API
- API routes → Authentication: routes login
src/routes/index.js - API routes → Auth and role guards: guards requests
src/routes/index.js - API routes → Resident check-in: routes check-in
src/routes/index.js - API routes → Beds and rooms: routes bed setup
src/routes/index.js - API routes → Payments and receipts: routes payments
src/routes/index.js - API routes → Finance operations: routes dashboard
src/routes/index.js - API routes → Daily reports: routes reports
src/routes/index.js - API routes → Bookings: routes bookings
src/routes/index.js - API routes → Permission checks: checks permissions
src/routes/index.js - Authentication → SQLite database: reads users
src/controllers/authController.js - Auth and role guards → SQLite database: checks user
src/middleware/auth.js - Permission checks → SQLite database: loads permissions
src/middleware/permissions.js - Resident check-in → SQLite database: reads and writes
src/controllers/checkinController.js - Resident check-in → Audit logging: logs access
src/controllers/checkinController.js - Resident check-in → WhatsApp notifications: schedules notice
src/controllers/checkinController.js - Resident check-in → Money ledger: uses ledger
src/controllers/checkinController.js - Resident check-in → ID proof utilities: formats ID
src/controllers/checkinController.js - Payments and receipts → Money ledger: records transactions
src/controllers/paymentsController.js - Payments and receipts → WhatsApp notifications: sends notice
src/controllers/paymentsController.js - Payments and receipts → SQLite database: reads and writes
src/controllers/paymentsController.js - Finance operations → Money ledger: uses ledger
src/controllers/financeController.js - Daily reports → Money ledger: reads balances
src/controllers/dailyReportsController.js - Report registers → Money ledger: builds registers
src/controllers/registersController.js - Management summary → Money ledger: uses ledger
src/controllers/summaryController.js - Database initialization → SQLite database: initializes connection
src/server.js - Database initialization → Money ledger: sets up ledger
src/db/init.js - Money ledger → SQLite database: reads and writes
src/services/ledger.js - Daily reports → IST time utilities: uses date helpers
src/controllers/dailyReportsController.js - Report registers → IST time utilities: uses date helpers
src/controllers/registersController.js - Management summary → ID proof utilities: uses ID helpers
src/controllers/summaryController.js - WhatsApp notifications → WhatsApp provider: sends messages
- Accounts → Money ledger: uses ledger
src/controllers/accountsController.js - Add-on charges → Money ledger: records charges
src/controllers/addonsController.js - Payroll → Money ledger: records payroll
src/controllers/payrollController.js