# lakshaykarad/360ghar-backend architecture

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

- Interactive diagram: https://gitdiagram.com/lakshaykarad/360ghar-backend
- Repository: https://github.com/lakshaykarad/360ghar-backend

## Overview

360 Ghar is a FastAPI backend for a shared real-estate marketplace, short-stay bookings, and property management. The primary user journey is property search and discovery, followed by swipes or recommendations and visit coordination; the backend also supports booking and landlord workflows. The graph preserves those documented product branches and the MCP tool surface. Edges are limited to README statements and source-index references; many endpoint-to-service calls cannot be verified from the supplied excerpts.

Main entry points: [`app/api/api_v1/api.py`](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/api.py) (API Router), [`app/services/property/search_orchestration.py`](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/services/property/search_orchestration.py) (Property Search), [`app/models/properties.py`](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/models/properties.py) (Property Records), [`app/mcp/user/server.py`](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/mcp/user/server.py) (User MCP Tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_market["Marketplace"]
  node_property_search["Property Search"]
  node_property_endpoint["Property Endpoints<br/>[properties.py]"]
  node_property_data["Property Records<br/>[properties.py]"]
  node_property_schema["Property Search Schema<br/>[property.py]"]
  node_swipes["Property Swipes<br/>[swipes.py]"]
  node_visits["Visit Scheduling<br/>[visits.py]"]
  node_agents["Agent Management<br/>[agents.py]"]
end

subgraph group_stays["Short Stays"]
  node_booking_api["Booking Endpoints<br/>[bookings.py]"]
  node_booking_data["Booking Records<br/>[bookings.py]"]
  node_payment_api["Payments<br/>[payments.py]"]
end

subgraph group_management["Property Management"]
  node_pm_tenants["Tenant Management<br/>[pm_tenants.py]"]
  node_pm_leases["Lease Management<br/>[pm_leases.py]"]
  node_pm_rent["Rent Collection<br/>[pm_rent.py]"]
  node_pm_maintenance["Maintenance Requests<br/>[pm_maintenance.py]"]
  node_pm_documents["Document Vault<br/>[pm_documents.py]"]
  node_pm_reports["Financial Reports<br/>[pm_reports.py]"]
end

subgraph group_platform["API and Platform"]
  node_api["API Router<br/>[api.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_db[("PostgreSQL / PostGIS<br/>[database.py]")]
  node_mcp_user["User MCP Tools<br/>[server.py]"]
  node_mcp_sdk["MCP Apps SDK<br/>[apps_sdk.py]"]
end

node_user(("Platform User"))

node_user -->|"uses API"| node_api
node_api -->|"routes to"| node_property_endpoint
node_user -->|"searches listings"| node_property_search
node_user -->|"swipes listings"| node_swipes
node_user -->|"schedules visits"| node_visits
node_user -->|"books stays"| node_booking_api
node_user -->|"manages rentals"| node_pm_tenants
node_user -->|"tracks leases"| node_pm_leases
node_user -->|"collects rent"| node_pm_rent
node_user -->|"requests upkeep"| node_pm_maintenance
node_user -->|"stores documents"| node_pm_documents
node_user -->|"views finances"| node_pm_reports
node_api -->|"routes to"| node_agents
node_api -->|"routes to"| node_booking_api
node_property_search -->|"builds filters"| node_property_schema
node_property_search -.->|"queries listings"| node_property_data
node_property_data -->|"persists in"| node_db
node_booking_data -->|"persists in"| node_db
node_api -.->|"authenticates requests"| node_auth
node_user -.->|"uses MCP tools"| node_mcp_user
node_mcp_user -->|"registers tools"| node_mcp_sdk

click node_api "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/api.py"
click node_auth "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/core/auth.py"
click node_db "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/core/database.py"
click node_property_search "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/services/property/search_orchestration.py"
click node_property_endpoint "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/properties.py"
click node_property_data "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/models/properties.py"
click node_property_schema "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/schemas/property.py"
click node_swipes "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/swipes.py"
click node_visits "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/visits.py"
click node_agents "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/agents.py"
click node_booking_api "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/bookings.py"
click node_booking_data "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/models/bookings.py"
click node_payment_api "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/payments.py"
click node_pm_tenants "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/pm_tenants.py"
click node_pm_leases "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/pm_leases.py"
click node_pm_rent "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/pm_rent.py"
click node_pm_maintenance "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/pm_maintenance.py"
click node_pm_documents "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/pm_documents.py"
click node_pm_reports "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/pm_reports.py"
click node_mcp_user "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/mcp/user/server.py"
click node_mcp_sdk "https://github.com/lakshaykarad/360ghar-backend/blob/main/app/mcp/apps_sdk.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_property_search,node_property_endpoint,node_property_data,node_property_schema,node_swipes,node_visits,node_agents,node_user toneBlue
class node_booking_api,node_booking_data,node_payment_api toneAmber
class node_pm_tenants,node_pm_leases,node_pm_rent,node_pm_maintenance,node_pm_documents,node_pm_reports toneMint
class node_api,node_auth,node_db,node_mcp_user,node_mcp_sdk toneRose
```

## Components

### Marketplace

- [Property Search](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/services/property/search_orchestration.py): `app/services/property/search_orchestration.py`
- [Property Endpoints](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/properties.py): `app/api/api_v1/endpoints/properties.py`
- [Property Records](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/models/properties.py): `app/models/properties.py`
- [Property Search Schema](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/schemas/property.py): `app/schemas/property.py`
- [Property Swipes](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/swipes.py): `app/api/api_v1/endpoints/swipes.py`
- [Visit Scheduling](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/visits.py): `app/api/api_v1/endpoints/visits.py`
- [Agent Management](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/agents.py): `app/api/api_v1/endpoints/agents.py`

### Short Stays

- [Booking Endpoints](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/bookings.py): `app/api/api_v1/endpoints/bookings.py`
- [Booking Records](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/models/bookings.py): `app/models/bookings.py`
- [Payments](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/payments.py): `app/api/api_v1/endpoints/payments.py`

### Property Management

- [Tenant Management](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/pm_tenants.py): `app/api/api_v1/endpoints/pm_tenants.py`
- [Lease Management](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/pm_leases.py): `app/api/api_v1/endpoints/pm_leases.py`
- [Rent Collection](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/pm_rent.py): `app/api/api_v1/endpoints/pm_rent.py`
- [Maintenance Requests](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/pm_maintenance.py): `app/api/api_v1/endpoints/pm_maintenance.py`
- [Document Vault](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/pm_documents.py): `app/api/api_v1/endpoints/pm_documents.py`
- [Financial Reports](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/endpoints/pm_reports.py): `app/api/api_v1/endpoints/pm_reports.py`

### API and Platform

- [API Router](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/api/api_v1/api.py): `app/api/api_v1/api.py`
- [Authentication](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/core/auth.py): `app/core/auth.py`
- [PostgreSQL / PostGIS](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/core/database.py): `app/core/database.py`
- [User MCP Tools](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/mcp/user/server.py): `app/mcp/user/server.py`
- [MCP Apps SDK](https://github.com/lakshaykarad/360ghar-backend/blob/main/app/mcp/apps_sdk.py): `app/mcp/apps_sdk.py`

### Other components

- **Platform User**

## Connections

- Platform User → API Router: uses API (evidence: `README.md`)
- API Router → Property Endpoints: routes to (evidence: `app/api/api_v1/api.py`)
- Platform User → Property Search: searches listings (evidence: `README.md`)
- Platform User → Property Swipes: swipes listings (evidence: `README.md`)
- Platform User → Visit Scheduling: schedules visits (evidence: `README.md`)
- Platform User → Booking Endpoints: books stays (evidence: `README.md`)
- Platform User → Tenant Management: manages rentals (evidence: `README.md`)
- Platform User → Lease Management: tracks leases (evidence: `README.md`)
- Platform User → Rent Collection: collects rent (evidence: `README.md`)
- Platform User → Maintenance Requests: requests upkeep (evidence: `README.md`)
- Platform User → Document Vault: stores documents (evidence: `README.md`)
- Platform User → Financial Reports: views finances (evidence: `README.md`)
- API Router → Agent Management: routes to (evidence: `app/api/api_v1/api.py`)
- API Router → Booking Endpoints: routes to (evidence: `app/api/api_v1/api.py`)
- Property Search → Property Search Schema: builds filters (evidence: `app/services/property/search_orchestration.py`)
- Property Search → Property Records: queries listings
- Property Records → PostgreSQL / PostGIS: persists in (evidence: `app/models/properties.py`)
- Booking Records → PostgreSQL / PostGIS: persists in
- API Router → Authentication: authenticates requests
- Platform User → User MCP Tools: uses MCP tools
- User MCP Tools → MCP Apps SDK: registers tools (evidence: `app/mcp/user/server.py`)
