# eevan7a9/real-estate-management architecture

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

- Interactive diagram: https://gitdiagram.com/eevan7a9/real-estate-management
- Repository: https://github.com/eevan7a9/real-estate-management

## Overview

This is a web and mobile real-estate management product: users browse property listings and map locations, view details, and contact owners through enquiries; signed-in users also manage listings, profiles, notifications, and activity. The frontend’s property, enquiry, and account services call HTTP APIs, while the backend provides Fastify routes and Mongo-backed domain models; WebSocket events update client state. The README documents map exploration and enquiries. Several additional UI capabilities are represented from the file tree, but their internal wiring was not sampled, so those links are dashed.

Main entry points: [`frontend/src/app/user/user.service.ts`](https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/user/user.service.ts) (User service), [`frontend/src/app/app.component.ts`](https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/app.component.ts) (App shell), [`frontend/src/app/properties/properties.service.ts`](https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/properties/properties.service.ts) (Property service), [`frontend/src/app/enquiries/enquiries.service.ts`](https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/enquiries/enquiries.service.ts) (Enquiry service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Ionic client"]
  node_app["App shell<br/>[app.component.ts]"]
  node_properties_ui["Property browsing"]
  node_map_ui["Property map"]
  node_enquiries_ui["Enquiries"]
  node_management_ui["Portfolio management"]
  node_mortgage_ui["Mortgage calculator"]
  node_profile_ui["Account and auth"]
  node_notifications_ui["Notifications"]
end

subgraph group_server["Fastify API"]
  node_api["Fastify server<br/>[index.js]"]
  node_api_routes["API routes<br/>[index.js]"]
  node_property_api["Property endpoints"]
  node_enquiry_api["Enquiry endpoints"]
  node_auth_api["Authentication<br/>[google-auth.js]"]
  node_contact_api["Contact submissions"]
end

subgraph group_domain["Backend domain"]
  node_domain_models["Domain models"]
  node_user_model["User model<br/>[user.js]"]
  node_session_model["Refresh sessions<br/>[refresh-session.js]"]
  node_activity_domain["Activity domain<br/>[activity.js]"]
  node_activity_enums["Activity and user enums<br/>[activity.js]"]
end

subgraph group_shared["Client services"]
  node_client_contracts["Client contracts"]
  node_storage[("Local storage<br/>[storage.service.ts]")]
  node_property_service["Property service"]
  node_enquiry_service["Enquiry service"]
  node_user_service["User service<br/>[user.service.ts]"]
  node_activity_service["Activity service"]
  node_notification_service["Notification service"]
  node_websocket_client["WebSocket client"]
end

node_visitor(("User"))

node_visitor -->|"uses"| node_app
node_app -->|"loads session"| node_user_service
node_app -->|"fetches enquiries"| node_enquiry_service
node_app -->|"fetches activities"| node_activity_service
node_app -->|"fetches notifications"| node_notification_service
node_app -->|"connects"| node_websocket_client
node_property_service -->|"gets token"| node_user_service
node_enquiry_service -->|"gets token"| node_user_service
node_activity_service -->|"gets token"| node_user_service
node_user_service -->|"persists session"| node_storage
node_websocket_client -->|"updates state"| node_enquiry_service
node_websocket_client -->|"updates state"| node_activity_service
node_websocket_client -->|"updates state"| node_notification_service
node_properties_ui -.->|"uses"| node_property_service
node_map_ui -.->|"loads listings"| node_property_service
node_enquiries_ui -.->|"uses"| node_enquiry_service
node_management_ui -.->|"manages listings"| node_property_service
node_profile_ui -.->|"uses"| node_user_service
node_notifications_ui -.->|"uses"| node_notification_service
node_mortgage_ui -.->|"supports decisions"| node_properties_ui
node_api -->|"registers"| node_api_routes
node_api -.->|"connects MongoDB"| node_domain_models
node_property_service -.->|"HTTP requests"| node_property_api
node_enquiry_service -.->|"HTTP requests"| node_enquiry_api
node_user_service -.->|"Google sign-in"| node_auth_api
node_property_api -.->|"reads and writes"| node_domain_models
node_enquiry_api -.->|"reads and writes"| node_domain_models
node_auth_api -->|"finds or saves"| node_user_model
node_auth_api -.->|"creates session"| node_session_model
node_auth_api -->|"records sign-in"| node_activity_domain
node_activity_domain -.->|"uses types"| node_activity_enums

click node_app "https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/app.component.ts"
click node_properties_ui "https://github.com/eevan7a9/real-estate-management/tree/main/frontend/src/app/properties"
click node_map_ui "https://github.com/eevan7a9/real-estate-management/tree/main/frontend/src/app/map"
click node_enquiries_ui "https://github.com/eevan7a9/real-estate-management/tree/main/frontend/src/app/enquiries"
click node_management_ui "https://github.com/eevan7a9/real-estate-management/tree/main/frontend/src/app/management"
click node_mortgage_ui "https://github.com/eevan7a9/real-estate-management/tree/main/frontend/src/app/mortgage-calc"
click node_profile_ui "https://github.com/eevan7a9/real-estate-management/tree/main/frontend/src/app/user"
click node_notifications_ui "https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/user/notifications/notifications.service.ts"
click node_client_contracts "https://github.com/eevan7a9/real-estate-management/tree/main/frontend/src/app/shared/interface"
click node_storage "https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/shared/services/storage/storage.service.ts"
click node_property_service "https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/properties/properties.service.ts"
click node_enquiry_service "https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/enquiries/enquiries.service.ts"
click node_user_service "https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/user/user.service.ts"
click node_activity_service "https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/activities/activities.service.ts"
click node_notification_service "https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/user/notifications/notifications.service.ts"
click node_websocket_client "https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/web-scoket/web-socket.service.ts"
click node_api "https://github.com/eevan7a9/real-estate-management/blob/main/backend-fastify/src/index.js"
click node_api_routes "https://github.com/eevan7a9/real-estate-management/blob/main/backend-fastify/src/routes/index.js"
click node_property_api "https://github.com/eevan7a9/real-estate-management/tree/main/backend-fastify/src/controllers/properties"
click node_enquiry_api "https://github.com/eevan7a9/real-estate-management/tree/main/backend-fastify/src/controllers/enquiries"
click node_auth_api "https://github.com/eevan7a9/real-estate-management/blob/main/backend-fastify/src/controllers/auth/google-auth.js"
click node_contact_api "https://github.com/eevan7a9/real-estate-management/tree/main/backend-fastify/src/controllers/contact-submissions"
click node_domain_models "https://github.com/eevan7a9/real-estate-management/tree/main/backend-fastify/src/models"
click node_user_model "https://github.com/eevan7a9/real-estate-management/blob/main/backend-fastify/src/models/user.js"
click node_session_model "https://github.com/eevan7a9/real-estate-management/blob/main/backend-fastify/src/models/refresh-session.js"
click node_activity_domain "https://github.com/eevan7a9/real-estate-management/blob/main/backend-fastify/src/services/activity.js"
click node_activity_enums "https://github.com/eevan7a9/real-estate-management/blob/main/backend-fastify/src/enums/activity.js"

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_properties_ui,node_map_ui,node_enquiries_ui,node_management_ui,node_mortgage_ui,node_profile_ui,node_notifications_ui,node_visitor toneBlue
class node_api,node_api_routes,node_property_api,node_enquiry_api,node_auth_api,node_contact_api toneAmber
class node_domain_models,node_user_model,node_session_model,node_activity_domain,node_activity_enums toneMint
class node_client_contracts,node_storage,node_property_service,node_enquiry_service,node_user_service,node_activity_service,node_notification_service,node_websocket_client toneRose
```

## Components

### Ionic client

- [App shell](https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/app.component.ts): `frontend/src/app/app.component.ts`
- [Property browsing](https://github.com/eevan7a9/real-estate-management/tree/main/frontend/src/app/properties): `frontend/src/app/properties`
- [Property map](https://github.com/eevan7a9/real-estate-management/tree/main/frontend/src/app/map): `frontend/src/app/map`
- [Enquiries](https://github.com/eevan7a9/real-estate-management/tree/main/frontend/src/app/enquiries): `frontend/src/app/enquiries`
- [Portfolio management](https://github.com/eevan7a9/real-estate-management/tree/main/frontend/src/app/management): `frontend/src/app/management`
- [Mortgage calculator](https://github.com/eevan7a9/real-estate-management/tree/main/frontend/src/app/mortgage-calc): `frontend/src/app/mortgage-calc`
- [Account and auth](https://github.com/eevan7a9/real-estate-management/tree/main/frontend/src/app/user): `frontend/src/app/user`
- [Notifications](https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/user/notifications/notifications.service.ts): `frontend/src/app/user/notifications/notifications.service.ts`

### Fastify API

- [Fastify server](https://github.com/eevan7a9/real-estate-management/blob/main/backend-fastify/src/index.js): `backend-fastify/src/index.js`
- [API routes](https://github.com/eevan7a9/real-estate-management/blob/main/backend-fastify/src/routes/index.js): `backend-fastify/src/routes/index.js`
- [Property endpoints](https://github.com/eevan7a9/real-estate-management/tree/main/backend-fastify/src/controllers/properties): `backend-fastify/src/controllers/properties`
- [Enquiry endpoints](https://github.com/eevan7a9/real-estate-management/tree/main/backend-fastify/src/controllers/enquiries): `backend-fastify/src/controllers/enquiries`
- [Authentication](https://github.com/eevan7a9/real-estate-management/blob/main/backend-fastify/src/controllers/auth/google-auth.js): `backend-fastify/src/controllers/auth/google-auth.js`
- [Contact submissions](https://github.com/eevan7a9/real-estate-management/tree/main/backend-fastify/src/controllers/contact-submissions): `backend-fastify/src/controllers/contact-submissions`

### Backend domain

- [Domain models](https://github.com/eevan7a9/real-estate-management/tree/main/backend-fastify/src/models): `backend-fastify/src/models`
- [User model](https://github.com/eevan7a9/real-estate-management/blob/main/backend-fastify/src/models/user.js): `backend-fastify/src/models/user.js`
- [Refresh sessions](https://github.com/eevan7a9/real-estate-management/blob/main/backend-fastify/src/models/refresh-session.js): `backend-fastify/src/models/refresh-session.js`
- [Activity domain](https://github.com/eevan7a9/real-estate-management/blob/main/backend-fastify/src/services/activity.js): `backend-fastify/src/services/activity.js`
- [Activity and user enums](https://github.com/eevan7a9/real-estate-management/blob/main/backend-fastify/src/enums/activity.js): `backend-fastify/src/enums/activity.js`

### Client services

- [Client contracts](https://github.com/eevan7a9/real-estate-management/tree/main/frontend/src/app/shared/interface): `frontend/src/app/shared/interface`
- [Local storage](https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/shared/services/storage/storage.service.ts): `frontend/src/app/shared/services/storage/storage.service.ts`
- [Property service](https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/properties/properties.service.ts): `frontend/src/app/properties/properties.service.ts`
- [Enquiry service](https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/enquiries/enquiries.service.ts): `frontend/src/app/enquiries/enquiries.service.ts`
- [User service](https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/user/user.service.ts): `frontend/src/app/user/user.service.ts`
- [Activity service](https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/activities/activities.service.ts): `frontend/src/app/activities/activities.service.ts`
- [Notification service](https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/user/notifications/notifications.service.ts): `frontend/src/app/user/notifications/notifications.service.ts`
- [WebSocket client](https://github.com/eevan7a9/real-estate-management/blob/main/frontend/src/app/web-scoket/web-socket.service.ts): `frontend/src/app/web-scoket/web-socket.service.ts`

### Other components

- **User**

## Connections

- User → App shell: uses (evidence: `README.md`)
- App shell → User service: loads session (evidence: `frontend/src/app/app.component.ts`)
- App shell → Enquiry service: fetches enquiries (evidence: `frontend/src/app/app.component.ts`)
- App shell → Activity service: fetches activities (evidence: `frontend/src/app/app.component.ts`)
- App shell → Notification service: fetches notifications (evidence: `frontend/src/app/app.component.ts`)
- App shell → WebSocket client: connects (evidence: `frontend/src/app/app.component.ts`)
- Property service → User service: gets token (evidence: `frontend/src/app/properties/properties.service.ts`)
- Enquiry service → User service: gets token (evidence: `frontend/src/app/enquiries/enquiries.service.ts`)
- Activity service → User service: gets token (evidence: `frontend/src/app/activities/activities.service.ts`)
- User service → Local storage: persists session (evidence: `frontend/src/app/user/user.service.ts`)
- WebSocket client → Enquiry service: updates state (evidence: `frontend/src/app/web-scoket/web-socket.service.ts`)
- WebSocket client → Activity service: updates state (evidence: `frontend/src/app/web-scoket/web-socket.service.ts`)
- WebSocket client → Notification service: updates state (evidence: `frontend/src/app/web-scoket/web-socket.service.ts`)
- Property browsing → Property service: uses
- Property map → Property service: loads listings
- Enquiries → Enquiry service: uses
- Portfolio management → Property service: manages listings (evidence: `frontend/src/app/management/management.service.ts`)
- Account and auth → User service: uses (evidence: `frontend/src/app/user/notifications/notifications.service.ts`)
- Notifications → Notification service: uses (evidence: `frontend/src/app/user/notifications/notifications.service.ts`)
- Mortgage calculator → Property browsing: supports decisions
- Fastify server → API routes: registers (evidence: `backend-fastify/src/index.js`)
- Fastify server → Domain models: connects MongoDB
- Property service → Property endpoints: HTTP requests
- Enquiry service → Enquiry endpoints: HTTP requests
- User service → Authentication: Google sign-in
- Property endpoints → Domain models: reads and writes
- Enquiry endpoints → Domain models: reads and writes
- Authentication → User model: finds or saves (evidence: `backend-fastify/src/controllers/auth/google-auth.js`)
- Authentication → Refresh sessions: creates session
- Authentication → Activity domain: records sign-in (evidence: `backend-fastify/src/controllers/auth/google-auth.js`)
- Activity domain → Activity and user enums: uses types
