How hoangnam2464/rentease-management works
1. Overall shape
- RentEase is a Django monorepo: one backend project, one server-rendered frontend layer, and shared static assets/templates in the same repository.
- There is no separate SPA/frontend service; browsers talk directly to Django views, which render HTML templates and serve static files.
2. Primary runtime boundary
- The backend lives under backend/ and is the architectural center.
- backend/hostello_backend/ contains the Django project configuration, root URL routing, WSGI/ASGI entrypoints, and environment-driven settings.
- Persistence is through Django ORM to PostgreSQL in local Docker, with SQLite as fallback when DATABASE_URL is absent.
3. Core business domains
- The repository is organized into domain apps that map closely to the product model:
- accounts for users, user types, profiles, and role mapping
- properties for rental properties and rooms
- tenants for tenants and co-tenants
- contracts for rental contracts
- billing for invoices, payments, and payment integrations
- maintenance for repair tickets and maintenance records
- listings for public room listings and viewing registrations
- governance for private documentation and audit-oriented controls
- These are the main data-owning subsystems and are the likely nodes in any architecture diagram.
4. User access layers
- The application has distinct surfaces for Visitor, Owner, Tenant, Staff, and Admin.
- Public visitors use listing pages and viewing registration without authentication.
- Owners and tenants use role-specific portal routes.
- Staff uses internal reports and Django Admin, while superusers/admins have full platform access.
5. Portal subsystem
- backend/portal/ is the cross-domain orchestration layer for authenticated user journeys.
- It contains dashboard views, forms, decorators, template tags, and a demo-data seeding command.
- This layer appears to coordinate data from properties, contracts, billing, maintenance, and listings into owner/tenant-specific screens rather than owning core business state itself.
6. Billing and payment integration
- billing is the most integration-heavy subsystem.
- It models invoices, invoice lines, payment intents, and webhook events, and contains a gateway adapter for PayOS/VietQR.
- External payment confirmation flows into backend/billing/api/webhooks.py, meaning the authoritative payment state is updated by signed webhook callbacks rather than by client-side redirects alone.
- The billing service layer likely sits between webhooks, invoice state, and payment history.
7. Maintenance and notifications
- maintenance stores repair/maintenance lifecycle data and has signal hooks, suggesting side effects such as status updates or notifications.
- notices is a separate app for notification records and user-facing notices.
- This subsystem likely receives events from tenant requests or owner actions and surfaces them in tenant/owner portals.
8. Public listings and lead capture
- listings handles the public-facing room catalog and viewing-registration flow.
- Visitors can browse available rooms, see sanitized details, and submit interest forms without authentication.
- This is a controlled boundary: public data is intentionally scoped so private contract, identity, and precise location information remain hidden.
9. Operational reporting and admin
- reports provides staff-only reporting views and service logic.
- Django Admin is customized with Jazzmin and supported by app-level admin registrations.
- This creates a separate internal operational surface for staff oversight, distinct from the owner/tenant portals.
10. Legacy compatibility layer
- The old HOSTELLO apps (students, attendance, fees, requests, notices) are still present.
- README indicates they are retained for historical compatibility, not the primary RentEase product surface.
- For an architecture diagram, treat them as legacy/adjacent modules that may still share models, signals, or admin integrations but are not the main product path.
11. Front-end delivery
- frontend/templates/ contains the rendered pages for public pages, owner and tenant portals, reports, login, and admin customizations.
- frontend/static/ holds CSS, JavaScript, and images, including custom design-system assets and admin styling.
- The UI is therefore server-rendered, with light client-side scripting rather than a frontend application framework.
12. Background and maintenance utilities
- Management commands such as seed_rentease_demo_data and generate_monthly_fees.py indicate offline operational workflows for seeding and periodic fee generation.
- Utility scripts like logo generation/checking and test-specific commands suggest some non-request-time automation exists alongside the main web app.
- These are supporting processes, not separate services.
13. Data flow summary
- Normal request path: browser → Django URL routing → app view/form/serializer logic → ORM → PostgreSQL/SQLite → template rendering back to browser.
- Public listing path: anonymous browser → listings views → sanitized property/room data.
- Payment path: tenant/owner action → billing service/gateway → PayOS/VietQR external service → webhook callback → billing models/status updates → portal/dashboard display.
14. Deployment and infrastructure
- Local deployment is designed around Docker Compose for PostgreSQL 15 and a Python virtual environment for Django.
- Static delivery is prepared for WhiteNoise-style serving, which matters for standalone deployment without a separate static server.
- There is no Redis, Celery, separate API gateway, or frontend build pipeline in the current architecture.
15. Security and tenancy boundary
- A central architectural constraint is data isolation by role and by owner/tenant scope.
- The product explicitly avoids exposing sensitive identity data in public listings, portal lists, and staff search results.
- Any diagram should show tenant/owner scoping as a cross-cutting boundary enforced in views, decorators, and model/query filtering rather than as a separate service.
Main entry points: portal Portal · docker-compose.yml PostgreSQL / SQLite · hostello_backend Django Project · billing Billing
Components 19
Presentation
Server-rendered HTML, static assets, and browser-facing pages
Backend
Django project, domain apps, and orchestration layers
- Django Project · Root URL routing, settings, WSGI/ASGI entrypoints, and environment configuration
backend/hostello_backend - Portal · Authenticated cross-domain journeys, dashboards, decorators, forms, and demo seeding
backend/portal - Accounts · Users, profiles, user types, and role mapping
backend/accounts - Properties · Properties, rooms, ownership scope, and room metadata
backend/properties - Tenants · Tenants and co-tenants
backend/tenants - Contracts · Rental contracts and payment-cycle rules
backend/contracts - Billing · Invoices, invoice lines, payment intents, webhook events, and gateway services
backend/billing - Maintenance · Repair tickets and maintenance records
backend/maintenance - Listings · Public room catalog and viewing registrations
backend/listings - Governance · Private documentation and audit-oriented controls
backend/governance - Reports · Staff-only reporting services and views
backend/reports - Django Admin · Customized administrative surface with app registrations and Jazzmin styling
backend/accounts/admin.py - Notices · Notification records and user-facing notices
backend/notices
Legacy
Older HOSTELLO modules kept for compatibility
- Legacy Apps · Older HOSTELLO modules retained for historical compatibility
backend/students
Infrastructure
Datastores and external payment integration
- PayOS/VietQR · External payment provider used for payment confirmation flows
- PostgreSQL / SQLite · Primary ORM-backed persistence with PostgreSQL locally and SQLite fallback
docker-compose.yml
Connections 36
- Browser → Django Project: HTTP · All web traffic enters through Django routing
- Django Project → Templates: renders · Views render server-side HTML templates
- Django Project → Static UI: serves · Static assets are delivered with the app
- Django Project → Portal: routes · Authenticated journeys are handled by the portal layer
- Django Project → Listings: routes · Public listing pages and viewing registration are exposed here
- Django Project → Reports: routes · Staff reporting views are mounted through the project URLs
- Django Project → Django Admin: mounts · Admin surface is configured at the project level
- Portal → Accounts: uses · Role checks and profile data shape user journeys
- Portal → Properties: uses · Portal screens aggregate portfolio data
- Portal → Tenants: uses · Tenant and co-tenant information is surfaced in portals
- Portal → Contracts: uses · Contracts drive owner and tenant screens
- Portal → Billing: uses · Invoices, payments, and payment status appear in portals
- Portal → Maintenance: uses · Repair flows are coordinated through the portal
- Portal → Notices: uses · Notifications are shown in tenant and owner journeys
- Listings → Properties: reads · Public listings are derived from property and room data with sanitization
- Listings → Templates: renders · Public listing pages use server-rendered templates
- Reports → Properties: reads · Reporting aggregates property and room data
- Reports → Contracts: reads · Contract reports are built from rental data
- Reports → Billing: reads · Billing reports summarize invoices and payments
- Reports → Maintenance: reads · Maintenance reports summarize repairs and status
- Billing → PayOS/VietQR: integrates · Gateway adapter and webhook callbacks connect to external payments
- Billing → PostgreSQL / SQLite: persists · Invoices, payment intents, and webhook events are stored through the ORM
- Maintenance → PostgreSQL / SQLite: persists · Repair lifecycle data is stored in the database
- Accounts → PostgreSQL / SQLite: persists · Users, profiles, and role mappings are stored in the database
- Properties → PostgreSQL / SQLite: persists · Portfolio and room state are stored in the database
- Tenants → PostgreSQL / SQLite: persists · Tenant records and co-tenant links are stored in the database
- Contracts → PostgreSQL / SQLite: persists · Contracts and payment-cycle data are stored in the database
- Listings → PostgreSQL / SQLite: persists · Public listing and viewing-registration records are stored in the database
- Governance → PostgreSQL / SQLite: persists · Governance records are stored through the ORM
- Legacy Apps → PostgreSQL / SQLite: persists · Compatibility modules still share the main datastore
- Django Admin → Accounts: manages · Administrative screens operate over core app models
- Django Admin → Properties: manages · Admin tools manage portfolio data
- Django Admin → Billing: manages · Admin tools can inspect billing state
- Django Admin → Maintenance: manages · Admin tools can inspect maintenance state
- Legacy Apps → Notices: overlaps · Legacy modules overlap with notice and request style functionality
- Billing → Portal: updates · Webhook-confirmed payment state is reflected back into user dashboards