# danishcodepy/wayhome architecture

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

- Interactive diagram: https://gitdiagram.com/danishcodepy/wayhome
- Repository: https://github.com/danishcodepy/wayhome

## Overview

WayHome combines property and student-housing discovery with owner listing submission, admin approval, rental applications, and role-based workspaces. The principal flow runs from search or owner submission through REST services to persistence; approval controls public visibility. The README documents the controller–service–repository backend and MySQL/email integrations, while sampled frontend code confirms map-search and manager-dashboard API calls. Some frontend and backend relationships are documented rather than source-sampled, so those edges cite the README and unsampled details are not inferred.

Main entry points: [`frontend/src/services/api.js`](https://github.com/danishcodepy/wayhome/blob/main/frontend/src/services/api.js) (REST client), [`backend/src/main/java/com/wayhome/controller/PropertyController.java`](https://github.com/danishcodepy/wayhome/blob/main/backend/src/main/java/com/wayhome/controller/PropertyController.java) (Property endpoints), [`backend/src/main/java/com/wayhome/service`](https://github.com/danishcodepy/wayhome/tree/main/backend/src/main/java/com/wayhome/service) (Domain services), [`backend/src/main/java/com/wayhome/repository`](https://github.com/danishcodepy/wayhome/tree/main/backend/src/main/java/com/wayhome/repository) (Persistence repositories)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["Routes and page shell<br/>[App.jsx]"]
  node_search["Property and map search<br/>[MapSearch.jsx]"]
  node_search_ui["Search controls and pricing<br/>[SearchPanel.jsx]"]
  node_listing_form["Create listing<br/>[ListProperty.jsx]"]
  node_workspaces["Role dashboards"]
  node_client_api["REST client<br/>[api.js]"]
end

subgraph group_identity["Identity and access"]
  node_auth_ui["Login and registration<br/>[AuthContext.jsx]"]
  node_auth_service["Account and password auth<br/>[AuthService.java]"]
  node_otp["Email OTP verification<br/>[OtpService.java]"]
  node_jwt["JWT sessions<br/>[JwtUtil.java]"]
  node_email["Email delivery"]
end

subgraph group_property["Property lifecycle"]
  node_property_api["Property endpoints"]
  node_property_service["Listing and approval lifecycle"]
  node_property_model["Property listing<br/>[Property.java]"]
end

subgraph group_rental["Rentals and operations"]
  node_applications["Rental applications"]
  node_agreements["Rental agreements"]
  node_manager_ui["Owner workspace actions"]
  node_admin_ui["Admin moderation<br/>[AdminDashboard.jsx]"]
end

subgraph group_data["Backend and persistence"]
  node_services["Domain services"]
  node_repositories["Persistence repositories"]
  node_mysql[("MySQL")]
end

node_users(("Students, tenants, owners, admins"))

node_users -->|"browse and manage"| node_app
node_app -->|"routes to"| node_search
node_search -->|"loads listings"| node_client_api
node_search -->|"uses search controls"| node_search_ui
node_users -->|"submit listing"| node_listing_form
node_listing_form -->|"sends REST requests"| node_client_api
node_workspaces -->|"routes to workspace"| node_manager_ui
node_manager_ui -->|"requests portfolio data"| node_client_api
node_client_api -->|"calls REST API"| node_property_api
node_property_api -->|"delegates listing actions"| node_property_service
node_property_service -->|"updates listing state"| node_property_model
node_property_service -->|"reads and writes listings"| node_repositories
node_users -->|"register or sign in"| node_auth_ui
node_auth_ui -->|"uses REST API"| node_client_api
node_auth_service -->|"verifies registration OTP"| node_otp
node_auth_service -->|"creates session token"| node_jwt
node_auth_service -->|"loads and saves users"| node_repositories
node_otp -.->|"sends verification email"| node_email
node_users -->|"apply for housing"| node_applications
node_manager_ui -->|"manages applications"| node_applications
node_applications -->|"handles application operations"| node_services
node_agreements -->|"handles agreement operations"| node_services
node_users -->|"review submissions"| node_admin_ui
node_admin_ui -->|"moderates listings"| node_property_api
node_property_api -->|"uses domain services"| node_services
node_services -->|"accesses persistence"| node_repositories
node_repositories -->|"persists domain data"| node_mysql

click node_app "https://github.com/danishcodepy/wayhome/blob/main/frontend/src/App.jsx"
click node_search "https://github.com/danishcodepy/wayhome/blob/main/frontend/src/pages/MapSearch.jsx"
click node_search_ui "https://github.com/danishcodepy/wayhome/blob/main/frontend/src/components/SearchPanel.jsx"
click node_listing_form "https://github.com/danishcodepy/wayhome/blob/main/frontend/src/pages/ListProperty.jsx"
click node_workspaces "https://github.com/danishcodepy/wayhome/blob/main/frontend/src/pages/dashboards/ManagerDashboard.jsx"
click node_client_api "https://github.com/danishcodepy/wayhome/blob/main/frontend/src/services/api.js"
click node_auth_ui "https://github.com/danishcodepy/wayhome/blob/main/frontend/src/context/AuthContext.jsx"
click node_auth_service "https://github.com/danishcodepy/wayhome/blob/main/backend/src/main/java/com/wayhome/service/AuthService.java"
click node_otp "https://github.com/danishcodepy/wayhome/blob/main/backend/src/main/java/com/wayhome/service/OtpService.java"
click node_jwt "https://github.com/danishcodepy/wayhome/blob/main/backend/src/main/java/com/wayhome/security/JwtUtil.java"
click node_property_api "https://github.com/danishcodepy/wayhome/blob/main/backend/src/main/java/com/wayhome/controller/PropertyController.java"
click node_property_service "https://github.com/danishcodepy/wayhome/blob/main/backend/src/main/java/com/wayhome/service/PropertyService.java"
click node_property_model "https://github.com/danishcodepy/wayhome/blob/main/backend/src/main/java/com/wayhome/model/Property.java"
click node_applications "https://github.com/danishcodepy/wayhome/blob/main/backend/src/main/java/com/wayhome/controller/ApplicationController.java"
click node_agreements "https://github.com/danishcodepy/wayhome/blob/main/backend/src/main/java/com/wayhome/controller/AgreementController.java"
click node_manager_ui "https://github.com/danishcodepy/wayhome/blob/main/frontend/src/pages/dashboards/ManagerDashboard.jsx"
click node_admin_ui "https://github.com/danishcodepy/wayhome/blob/main/frontend/src/pages/dashboards/AdminDashboard.jsx"
click node_services "https://github.com/danishcodepy/wayhome/tree/main/backend/src/main/java/com/wayhome/service"
click node_repositories "https://github.com/danishcodepy/wayhome/tree/main/backend/src/main/java/com/wayhome/repository"

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_search,node_search_ui,node_listing_form,node_workspaces,node_client_api toneBlue
class node_auth_ui,node_auth_service,node_otp,node_jwt,node_email toneAmber
class node_property_api,node_property_service,node_property_model toneMint
class node_applications,node_agreements,node_manager_ui,node_admin_ui toneRose
class node_services,node_repositories,node_mysql,node_users toneIndigo
```

## Components

### Web experience

- [Routes and page shell](https://github.com/danishcodepy/wayhome/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Property and map search](https://github.com/danishcodepy/wayhome/blob/main/frontend/src/pages/MapSearch.jsx): `frontend/src/pages/MapSearch.jsx`
- [Search controls and pricing](https://github.com/danishcodepy/wayhome/blob/main/frontend/src/components/SearchPanel.jsx): `frontend/src/components/SearchPanel.jsx`
- [Create listing](https://github.com/danishcodepy/wayhome/blob/main/frontend/src/pages/ListProperty.jsx): `frontend/src/pages/ListProperty.jsx`
- [Role dashboards](https://github.com/danishcodepy/wayhome/blob/main/frontend/src/pages/dashboards/ManagerDashboard.jsx): `frontend/src/pages/dashboards/ManagerDashboard.jsx`
- [REST client](https://github.com/danishcodepy/wayhome/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Identity and access

- [Login and registration](https://github.com/danishcodepy/wayhome/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Account and password auth](https://github.com/danishcodepy/wayhome/blob/main/backend/src/main/java/com/wayhome/service/AuthService.java): `backend/src/main/java/com/wayhome/service/AuthService.java`
- [Email OTP verification](https://github.com/danishcodepy/wayhome/blob/main/backend/src/main/java/com/wayhome/service/OtpService.java): `backend/src/main/java/com/wayhome/service/OtpService.java`
- [JWT sessions](https://github.com/danishcodepy/wayhome/blob/main/backend/src/main/java/com/wayhome/security/JwtUtil.java): `backend/src/main/java/com/wayhome/security/JwtUtil.java`
- **Email delivery**

### Property lifecycle

- [Property endpoints](https://github.com/danishcodepy/wayhome/blob/main/backend/src/main/java/com/wayhome/controller/PropertyController.java): `backend/src/main/java/com/wayhome/controller/PropertyController.java`
- [Listing and approval lifecycle](https://github.com/danishcodepy/wayhome/blob/main/backend/src/main/java/com/wayhome/service/PropertyService.java): `backend/src/main/java/com/wayhome/service/PropertyService.java`
- [Property listing](https://github.com/danishcodepy/wayhome/blob/main/backend/src/main/java/com/wayhome/model/Property.java): `backend/src/main/java/com/wayhome/model/Property.java`

### Rentals and operations

- [Rental applications](https://github.com/danishcodepy/wayhome/blob/main/backend/src/main/java/com/wayhome/controller/ApplicationController.java): `backend/src/main/java/com/wayhome/controller/ApplicationController.java`
- [Rental agreements](https://github.com/danishcodepy/wayhome/blob/main/backend/src/main/java/com/wayhome/controller/AgreementController.java): `backend/src/main/java/com/wayhome/controller/AgreementController.java`
- [Owner workspace actions](https://github.com/danishcodepy/wayhome/blob/main/frontend/src/pages/dashboards/ManagerDashboard.jsx): `frontend/src/pages/dashboards/ManagerDashboard.jsx`
- [Admin moderation](https://github.com/danishcodepy/wayhome/blob/main/frontend/src/pages/dashboards/AdminDashboard.jsx): `frontend/src/pages/dashboards/AdminDashboard.jsx`

### Backend and persistence

- [Domain services](https://github.com/danishcodepy/wayhome/tree/main/backend/src/main/java/com/wayhome/service): `backend/src/main/java/com/wayhome/service`
- [Persistence repositories](https://github.com/danishcodepy/wayhome/tree/main/backend/src/main/java/com/wayhome/repository): `backend/src/main/java/com/wayhome/repository`
- **MySQL**

### Other components

- **Students, tenants, owners, admins**

## Connections

- Students, tenants, owners, admins → Routes and page shell: browse and manage (evidence: `README.md`)
- Routes and page shell → Property and map search: routes to (evidence: `frontend/src/App.jsx`)
- Property and map search → REST client: loads listings (evidence: `frontend/src/pages/MapSearch.jsx`)
- Property and map search → Search controls and pricing: uses search controls (evidence: `frontend/src/pages/MapSearch.jsx`)
- Students, tenants, owners, admins → Create listing: submit listing (evidence: `README.md`)
- Create listing → REST client: sends REST requests (evidence: `README.md`)
- Role dashboards → Owner workspace actions: routes to workspace (evidence: `frontend/src/App.jsx`)
- Owner workspace actions → REST client: requests portfolio data (evidence: `frontend/src/pages/dashboards/ManagerDashboard.jsx`)
- REST client → Property endpoints: calls REST API (evidence: `README.md`)
- Property endpoints → Listing and approval lifecycle: delegates listing actions (evidence: `backend/src/main/java/com/wayhome/controller/PropertyController.java`)
- Listing and approval lifecycle → Property listing: updates listing state (evidence: `backend/src/main/java/com/wayhome/service/PropertyService.java`)
- Listing and approval lifecycle → Persistence repositories: reads and writes listings (evidence: `backend/src/main/java/com/wayhome/service/PropertyService.java`)
- Students, tenants, owners, admins → Login and registration: register or sign in (evidence: `README.md`)
- Login and registration → REST client: uses REST API (evidence: `README.md`)
- Account and password auth → Email OTP verification: verifies registration OTP (evidence: `backend/src/main/java/com/wayhome/service/AuthService.java`)
- Account and password auth → JWT sessions: creates session token (evidence: `backend/src/main/java/com/wayhome/service/AuthService.java`)
- Account and password auth → Persistence repositories: loads and saves users (evidence: `backend/src/main/java/com/wayhome/service/AuthService.java`)
- Email OTP verification → Email delivery: sends verification email
- Students, tenants, owners, admins → Rental applications: apply for housing (evidence: `README.md`)
- Owner workspace actions → Rental applications: manages applications (evidence: `frontend/src/pages/dashboards/ManagerDashboard.jsx`)
- Rental applications → Domain services: handles application operations (evidence: `backend/src/main/java/com/wayhome/controller/ApplicationController.java`)
- Rental agreements → Domain services: handles agreement operations (evidence: `backend/src/main/java/com/wayhome/controller/AgreementController.java`)
- Students, tenants, owners, admins → Admin moderation: review submissions (evidence: `README.md`)
- Admin moderation → Property endpoints: moderates listings (evidence: `README.md`)
- Property endpoints → Domain services: uses domain services (evidence: `README.md`)
- Domain services → Persistence repositories: accesses persistence (evidence: `README.md`)
- Persistence repositories → MySQL: persists domain data (evidence: `README.md`)
