# rajdeeepdas/ready2rent architecture

> Architecture diagram of the GitHub repository rajdeeepdas/ready2rent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rajdeeepdas/ready2rent
- Repository: https://github.com/rajdeeepdas/ready2rent

## Overview

Ready2Rent guides Calgary homeowners through legalizing basement suites, while staff manage each case through permits, construction, inspections, and registration. The principal workflow runs from homeowner intake and document upload, through transactional application creation, to staff queue work and status updates that homeowners can track. The frontend has separate homeowner and ops routes over one Django API. The README documents PostgreSQL, Redis-backed queue caching, background email notifications, and private file storage; several backend routes and the upload implementation were not sampled, so those links are documented rather than inferred from unsampled code.

Main entry points: [`frontend/src/App.jsx`](https://github.com/rajdeeepdas/ready2rent/blob/main/frontend/src/App.jsx) (SPA routes), [`backend/applications/services.py`](https://github.com/rajdeeepdas/ready2rent/blob/main/backend/applications/services.py) (Case services), [`frontend/src/api.js`](https://github.com/rajdeeepdas/ready2rent/blob/main/frontend/src/api.js) (API client), [`backend/applications/views_ops.py`](https://github.com/rajdeeepdas/ready2rent/blob/main/backend/applications/views_ops.py) (Ops endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_app["SPA routes<br/>[App.jsx]"]
  node_authui["Session state<br/>[auth.jsx]"]
  node_intakeui["Intake form<br/>[Intake.jsx]"]
  node_homeui["Homeowner tracking"]
  node_opsui["Ops case work<br/>[OpsApplication.jsx]"]
  node_queueui["Ops queue<br/>[OpsQueue.jsx]"]
  node_http["API client<br/>[api.js]"]
end

subgraph group_identity["Identity and access"]
  node_accountapi["Account endpoints<br/>[views.py]"]
  node_users["User roles<br/>[models.py]"]
end

subgraph group_cases["Application operations"]
  node_homeapi["Homeowner endpoints<br/>[views_homeowner.py]"]
  node_opsapi["Ops endpoints<br/>[views_ops.py]"]
  node_services["Case services<br/>[services.py]"]
  node_workflow["Status rules<br/>[state_machine.py]"]
  node_domain["Case records<br/>[models.py]"]
end

subgraph group_runtime["Runtime services"]
  node_cache["Queue cache<br/>[cache.py]"]
  node_tasks["Email tasks<br/>[tasks.py]"]
  node_worker["Celery worker<br/>[celery.py]"]
end

subgraph group_persistence["Data and files"]
  node_database[("PostgreSQL")]
  node_redis[("Redis")]
  node_fileconfig["File storage config<br/>[storage.py]"]
  node_files[("Private file storage")]
end

node_homeowner(("Homeowner"))
node_staff(("Ops staff"))
node_email["Email service"]

node_homeowner -->|"uses"| node_app
node_staff -->|"uses"| node_app
node_app -->|"provides session"| node_authui
node_app -->|"routes to"| node_intakeui
node_app -->|"routes to"| node_homeui
node_app -->|"routes to"| node_opsui
node_app -->|"routes to"| node_queueui
node_authui -->|"calls"| node_http
node_intakeui -->|"submits through"| node_http
node_homeui -->|"loads through"| node_http
node_opsui -->|"acts through"| node_http
node_http -->|"HTTP requests"| node_accountapi
node_http -->|"HTTP requests"| node_homeapi
node_http -->|"HTTP requests"| node_opsapi
node_accountapi -->|"authenticates users"| node_users
node_homeapi -.->|"invokes"| node_services
node_opsapi -->|"invokes"| node_services
node_opsapi -->|"reads queue cache"| node_cache
node_opsapi -->|"checks transitions"| node_workflow
node_services -->|"validates transitions"| node_workflow
node_services -->|"writes records"| node_domain
node_services -->|"queues notifications"| node_tasks
node_services -->|"transactional writes"| node_database
node_opsapi -->|"reads case data"| node_domain
node_domain -->|"persists records"| node_database
node_opsapi -->|"checks permissions"| node_users
node_services -.->|"invalidates"| node_cache
node_cache -->|"caches queue"| node_redis
node_tasks -->|"runs as tasks"| node_worker
node_worker -->|"sends messages"| node_email
node_tasks -->|"loads applications"| node_domain
node_fileconfig -->|"selects backend"| node_files
node_homeapi -.->|"serves protected uploads"| node_files

click node_app "https://github.com/rajdeeepdas/ready2rent/blob/main/frontend/src/App.jsx"
click node_authui "https://github.com/rajdeeepdas/ready2rent/blob/main/frontend/src/auth.jsx"
click node_intakeui "https://github.com/rajdeeepdas/ready2rent/blob/main/frontend/src/pages/Intake.jsx"
click node_homeui "https://github.com/rajdeeepdas/ready2rent/blob/main/frontend/src/pages/ApplicationDetail.jsx"
click node_opsui "https://github.com/rajdeeepdas/ready2rent/blob/main/frontend/src/pages/OpsApplication.jsx"
click node_queueui "https://github.com/rajdeeepdas/ready2rent/blob/main/frontend/src/pages/OpsQueue.jsx"
click node_http "https://github.com/rajdeeepdas/ready2rent/blob/main/frontend/src/api.js"
click node_accountapi "https://github.com/rajdeeepdas/ready2rent/blob/main/backend/accounts/views.py"
click node_users "https://github.com/rajdeeepdas/ready2rent/blob/main/backend/accounts/models.py"
click node_homeapi "https://github.com/rajdeeepdas/ready2rent/blob/main/backend/applications/views_homeowner.py"
click node_opsapi "https://github.com/rajdeeepdas/ready2rent/blob/main/backend/applications/views_ops.py"
click node_services "https://github.com/rajdeeepdas/ready2rent/blob/main/backend/applications/services.py"
click node_workflow "https://github.com/rajdeeepdas/ready2rent/blob/main/backend/applications/state_machine.py"
click node_domain "https://github.com/rajdeeepdas/ready2rent/blob/main/backend/applications/models.py"
click node_cache "https://github.com/rajdeeepdas/ready2rent/blob/main/backend/applications/cache.py"
click node_tasks "https://github.com/rajdeeepdas/ready2rent/blob/main/backend/applications/tasks.py"
click node_worker "https://github.com/rajdeeepdas/ready2rent/blob/main/backend/config/celery.py"
click node_fileconfig "https://github.com/rajdeeepdas/ready2rent/blob/main/backend/config/storage.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_authui,node_intakeui,node_homeui,node_opsui,node_queueui,node_http toneBlue
class node_accountapi,node_users toneAmber
class node_homeapi,node_opsapi,node_services,node_workflow,node_domain toneMint
class node_cache,node_tasks,node_worker toneRose
class node_database,node_redis,node_fileconfig,node_files,node_homeowner,node_staff,node_email toneIndigo
```

## Components

### Frontend

- [SPA routes](https://github.com/rajdeeepdas/ready2rent/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Session state](https://github.com/rajdeeepdas/ready2rent/blob/main/frontend/src/auth.jsx): `frontend/src/auth.jsx`
- [Intake form](https://github.com/rajdeeepdas/ready2rent/blob/main/frontend/src/pages/Intake.jsx): `frontend/src/pages/Intake.jsx`
- [Homeowner tracking](https://github.com/rajdeeepdas/ready2rent/blob/main/frontend/src/pages/ApplicationDetail.jsx): `frontend/src/pages/ApplicationDetail.jsx`
- [Ops case work](https://github.com/rajdeeepdas/ready2rent/blob/main/frontend/src/pages/OpsApplication.jsx): `frontend/src/pages/OpsApplication.jsx`
- [Ops queue](https://github.com/rajdeeepdas/ready2rent/blob/main/frontend/src/pages/OpsQueue.jsx): `frontend/src/pages/OpsQueue.jsx`
- [API client](https://github.com/rajdeeepdas/ready2rent/blob/main/frontend/src/api.js): `frontend/src/api.js`

### Identity and access

- [Account endpoints](https://github.com/rajdeeepdas/ready2rent/blob/main/backend/accounts/views.py): `backend/accounts/views.py`
- [User roles](https://github.com/rajdeeepdas/ready2rent/blob/main/backend/accounts/models.py): `backend/accounts/models.py`

### Application operations

- [Homeowner endpoints](https://github.com/rajdeeepdas/ready2rent/blob/main/backend/applications/views_homeowner.py): `backend/applications/views_homeowner.py`
- [Ops endpoints](https://github.com/rajdeeepdas/ready2rent/blob/main/backend/applications/views_ops.py): `backend/applications/views_ops.py`
- [Case services](https://github.com/rajdeeepdas/ready2rent/blob/main/backend/applications/services.py): `backend/applications/services.py`
- [Status rules](https://github.com/rajdeeepdas/ready2rent/blob/main/backend/applications/state_machine.py): `backend/applications/state_machine.py`
- [Case records](https://github.com/rajdeeepdas/ready2rent/blob/main/backend/applications/models.py): `backend/applications/models.py`

### Runtime services

- [Queue cache](https://github.com/rajdeeepdas/ready2rent/blob/main/backend/applications/cache.py): `backend/applications/cache.py`
- [Email tasks](https://github.com/rajdeeepdas/ready2rent/blob/main/backend/applications/tasks.py): `backend/applications/tasks.py`
- [Celery worker](https://github.com/rajdeeepdas/ready2rent/blob/main/backend/config/celery.py): `backend/config/celery.py`

### Data and files

- **PostgreSQL**
- **Redis**
- [File storage config](https://github.com/rajdeeepdas/ready2rent/blob/main/backend/config/storage.py): `backend/config/storage.py`
- **Private file storage**

### Other components

- **Homeowner**
- **Ops staff**
- **Email service**

## Connections

- Homeowner → SPA routes: uses (evidence: `README.md`)
- Ops staff → SPA routes: uses (evidence: `README.md`)
- SPA routes → Session state: provides session (evidence: `frontend/src/App.jsx`)
- SPA routes → Intake form: routes to (evidence: `frontend/src/App.jsx`)
- SPA routes → Homeowner tracking: routes to (evidence: `frontend/src/App.jsx`)
- SPA routes → Ops case work: routes to (evidence: `frontend/src/App.jsx`)
- SPA routes → Ops queue: routes to (evidence: `frontend/src/App.jsx`)
- Session state → API client: calls (evidence: `frontend/src/auth.jsx`)
- Intake form → API client: submits through (evidence: `frontend/src/pages/Intake.jsx`)
- Homeowner tracking → API client: loads through (evidence: `frontend/src/pages/ApplicationDetail.jsx`)
- Ops case work → API client: acts through (evidence: `frontend/src/pages/OpsApplication.jsx`)
- API client → Account endpoints: HTTP requests (evidence: `README.md`)
- API client → Homeowner endpoints: HTTP requests (evidence: `README.md`)
- API client → Ops endpoints: HTTP requests (evidence: `README.md`)
- Account endpoints → User roles: authenticates users (evidence: `backend/accounts/views.py`)
- Homeowner endpoints → Case services: invokes
- Ops endpoints → Case services: invokes (evidence: `backend/applications/views_ops.py`)
- Ops endpoints → Queue cache: reads queue cache (evidence: `backend/applications/views_ops.py`)
- Ops endpoints → Status rules: checks transitions (evidence: `backend/applications/views_ops.py`)
- Case services → Status rules: validates transitions (evidence: `backend/applications/services.py`)
- Case services → Case records: writes records (evidence: `backend/applications/services.py`)
- Case services → Email tasks: queues notifications (evidence: `backend/applications/services.py`)
- Case services → PostgreSQL: transactional writes (evidence: `README.md`)
- Ops endpoints → Case records: reads case data (evidence: `backend/applications/views_ops.py`)
- Case records → PostgreSQL: persists records (evidence: `README.md`)
- Ops endpoints → User roles: checks permissions (evidence: `backend/applications/views_ops.py`)
- Case services → Queue cache: invalidates
- Queue cache → Redis: caches queue (evidence: `README.md`)
- Email tasks → Celery worker: runs as tasks (evidence: `README.md`)
- Celery worker → Email service: sends messages
- Email tasks → Case records: loads applications (evidence: `backend/applications/tasks.py`)
- File storage config → Private file storage: selects backend (evidence: `backend/config/storage.py`)
- Homeowner endpoints → Private file storage: serves protected uploads (evidence: `README.md`)
