# project-sloth/ps-housing architecture

> Architecture diagram of the GitHub repository project-sloth/ps-housing, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/project-sloth/ps-housing
- Repository: https://github.com/project-sloth/ps-housing

## Overview

ps-housing is a FiveM resource for property ownership, apartments, and in-home furnishing. The documented player workflow runs from selecting or purchasing a property, through entering and furnishing it, to using its garage and personal storage; realtors configure properties for sale. The UI source excerpts show its furniture catalog, placement modeler, cart, and NUI boundary. Lua implementation details were not sampled, so connections to housing mechanics and integrations are shown only as unverified where appropriate.

Main entry points: [`ui/src/components/Menu.svelte`](https://github.com/project-sloth/ps-housing/blob/main/ui/src/components/Menu.svelte) (Furniture Menu), [`server/sv_property.lua`](https://github.com/project-sloth/ps-housing/blob/main/server/sv_property.lua) (Property Management), [`ui/src/utils/SendNUI.ts`](https://github.com/project-sloth/ps-housing/blob/main/ui/src/utils/SendNUI.ts) (NUI Messaging), [`ui/src/App.svelte`](https://github.com/project-sloth/ps-housing/blob/main/ui/src/App.svelte) (UI Application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_property["Properties &amp; Apartments"]
  node_housing["Property Management<br/>[sv_property.lua]"]
  node_client_property["Property Interaction<br/>[cl_property.lua]"]
  node_apartments["Apartment Flow<br/>[apartment.lua]"]
  node_migration["Property Migration<br/>[migrate.lua]"]
end

subgraph group_home["Home Features"]
  node_garage["Personal Garages<br/>[server.lua]"]
  node_access["Keys &amp; Access<br/>[sv_property.lua]"]
  node_storage["Wardrobes &amp; Stashes<br/>[server.lua]"]
  node_shells["Interior Shells"]
  node_furniture_runtime["Furniture Placement<br/>[modeler.lua]"]
end

subgraph group_furnish["Furnishing UI"]
  node_app["UI Application<br/>[App.svelte]"]
  node_menu["Furniture Menu<br/>[Menu.svelte]"]
  node_catalog["Catalog &amp; Search<br/>[ItemList.svelte]"]
  node_cart["Furniture Cart<br/>[Cart.svelte]"]
  node_owned["Owned Furniture<br/>[OwnedItems.svelte]"]
  node_modeler_ui["Placement Controls<br/>[Modeler.svelte]"]
  node_state["UI State<br/>[stores.ts]"]
end

subgraph group_runtime["Resource Runtime"]
  node_nui["NUI Messaging<br/>[SendNUI.ts]"]
  node_framework["Framework Adapter<br/>[framework.lua]"]
  node_database[("Property Data<br/>[sv_property.lua]")]
end

node_player(("Player"))
node_realtor(("Realtor"))

node_player -.->|"browses properties"| node_housing
node_realtor -.->|"configures listings"| node_housing
node_player -.->|"selects apartment"| node_apartments
node_apartments -.->|"migrates stash items"| node_migration
node_player -.->|"enters property"| node_client_property
node_client_property -.->|"loads interior"| node_shells
node_player -.->|"furnishes home"| node_furniture_runtime
node_furniture_runtime -.->|"opens furniture UI"| node_app
node_app -->|"renders"| node_menu
node_app -->|"renders"| node_modeler_ui
node_menu -->|"renders"| node_catalog
node_menu -->|"renders"| node_cart
node_menu -->|"renders"| node_owned
node_catalog -->|"previews furniture"| node_nui
node_menu -.->|"updates UI state"| node_state
node_catalog -.->|"reads furniture state"| node_state
node_cart -.->|"submits purchase"| node_nui
node_modeler_ui -.->|"sends placement"| node_nui
node_nui -.->|"calls client handlers"| node_furniture_runtime
node_housing -.->|"stores property data"| node_database
node_player -.->|"uses garage"| node_garage
node_player -.->|"shares keys"| node_access
node_player -.->|"uses personal storage"| node_storage
node_housing -.->|"uses framework"| node_framework

click node_housing "https://github.com/project-sloth/ps-housing/blob/main/server/sv_property.lua"
click node_client_property "https://github.com/project-sloth/ps-housing/blob/main/client/cl_property.lua"
click node_apartments "https://github.com/project-sloth/ps-housing/blob/main/client/apartment.lua"
click node_migration "https://github.com/project-sloth/ps-housing/blob/main/client/migrate.lua"
click node_garage "https://github.com/project-sloth/ps-housing/blob/main/server/server.lua"
click node_access "https://github.com/project-sloth/ps-housing/blob/main/server/sv_property.lua"
click node_storage "https://github.com/project-sloth/ps-housing/blob/main/server/server.lua"
click node_shells "https://github.com/project-sloth/ps-housing/tree/main/stream"
click node_furniture_runtime "https://github.com/project-sloth/ps-housing/blob/main/client/modeler.lua"
click node_app "https://github.com/project-sloth/ps-housing/blob/main/ui/src/App.svelte"
click node_menu "https://github.com/project-sloth/ps-housing/blob/main/ui/src/components/Menu.svelte"
click node_catalog "https://github.com/project-sloth/ps-housing/blob/main/ui/src/components/ItemList.svelte"
click node_cart "https://github.com/project-sloth/ps-housing/blob/main/ui/src/components/Cart.svelte"
click node_owned "https://github.com/project-sloth/ps-housing/blob/main/ui/src/components/OwnedItems.svelte"
click node_modeler_ui "https://github.com/project-sloth/ps-housing/blob/main/ui/src/components/Modeler.svelte"
click node_state "https://github.com/project-sloth/ps-housing/blob/main/ui/src/store/stores.ts"
click node_nui "https://github.com/project-sloth/ps-housing/blob/main/ui/src/utils/SendNUI.ts"
click node_framework "https://github.com/project-sloth/ps-housing/blob/main/shared/framework.lua"
click node_database "https://github.com/project-sloth/ps-housing/blob/main/server/sv_property.lua"

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_housing,node_client_property,node_apartments,node_migration toneBlue
class node_garage,node_access,node_storage,node_shells,node_furniture_runtime toneAmber
class node_app,node_menu,node_catalog,node_cart,node_owned,node_modeler_ui,node_state toneMint
class node_nui,node_framework,node_database toneRose
class node_player,node_realtor toneIndigo
```

## Components

### Properties & Apartments

- [Property Management](https://github.com/project-sloth/ps-housing/blob/main/server/sv_property.lua): `server/sv_property.lua`
- [Property Interaction](https://github.com/project-sloth/ps-housing/blob/main/client/cl_property.lua): `client/cl_property.lua`
- [Apartment Flow](https://github.com/project-sloth/ps-housing/blob/main/client/apartment.lua): `client/apartment.lua`
- [Property Migration](https://github.com/project-sloth/ps-housing/blob/main/client/migrate.lua): `client/migrate.lua`

### Home Features

- [Personal Garages](https://github.com/project-sloth/ps-housing/blob/main/server/server.lua): `server/server.lua`
- [Keys & Access](https://github.com/project-sloth/ps-housing/blob/main/server/sv_property.lua): `server/sv_property.lua`
- [Wardrobes & Stashes](https://github.com/project-sloth/ps-housing/blob/main/server/server.lua): `server/server.lua`
- [Interior Shells](https://github.com/project-sloth/ps-housing/tree/main/stream): `stream`
- [Furniture Placement](https://github.com/project-sloth/ps-housing/blob/main/client/modeler.lua): `client/modeler.lua`

### Furnishing UI

- [UI Application](https://github.com/project-sloth/ps-housing/blob/main/ui/src/App.svelte): `ui/src/App.svelte`
- [Furniture Menu](https://github.com/project-sloth/ps-housing/blob/main/ui/src/components/Menu.svelte): `ui/src/components/Menu.svelte`
- [Catalog & Search](https://github.com/project-sloth/ps-housing/blob/main/ui/src/components/ItemList.svelte): `ui/src/components/ItemList.svelte`
- [Furniture Cart](https://github.com/project-sloth/ps-housing/blob/main/ui/src/components/Cart.svelte): `ui/src/components/Cart.svelte`
- [Owned Furniture](https://github.com/project-sloth/ps-housing/blob/main/ui/src/components/OwnedItems.svelte): `ui/src/components/OwnedItems.svelte`
- [Placement Controls](https://github.com/project-sloth/ps-housing/blob/main/ui/src/components/Modeler.svelte): `ui/src/components/Modeler.svelte`
- [UI State](https://github.com/project-sloth/ps-housing/blob/main/ui/src/store/stores.ts): `ui/src/store/stores.ts`

### Resource Runtime

- [NUI Messaging](https://github.com/project-sloth/ps-housing/blob/main/ui/src/utils/SendNUI.ts): `ui/src/utils/SendNUI.ts`
- [Framework Adapter](https://github.com/project-sloth/ps-housing/blob/main/shared/framework.lua): `shared/framework.lua`
- [Property Data](https://github.com/project-sloth/ps-housing/blob/main/server/sv_property.lua): `server/sv_property.lua`

### Other components

- **Player**
- **Realtor**

## Connections

- Player → Property Management: browses properties (evidence: `README.md`)
- Realtor → Property Management: configures listings (evidence: `README.md`)
- Player → Apartment Flow: selects apartment (evidence: `README.md`)
- Apartment Flow → Property Migration: migrates stash items (evidence: `README.md`)
- Player → Property Interaction: enters property (evidence: `README.md`)
- Property Interaction → Interior Shells: loads interior
- Player → Furniture Placement: furnishes home (evidence: `README.md`)
- Furniture Placement → UI Application: opens furniture UI (evidence: `README.md`)
- UI Application → Furniture Menu: renders (evidence: `ui/src/App.svelte`)
- UI Application → Placement Controls: renders (evidence: `ui/src/App.svelte`)
- Furniture Menu → Catalog & Search: renders (evidence: `ui/src/components/Menu.svelte`)
- Furniture Menu → Furniture Cart: renders (evidence: `ui/src/components/Menu.svelte`)
- Furniture Menu → Owned Furniture: renders (evidence: `ui/src/components/Menu.svelte`)
- Catalog & Search → NUI Messaging: previews furniture (evidence: `ui/src/components/ItemList.svelte`)
- Furniture Menu → UI State: updates UI state
- Catalog & Search → UI State: reads furniture state
- Furniture Cart → NUI Messaging: submits purchase
- Placement Controls → NUI Messaging: sends placement
- NUI Messaging → Furniture Placement: calls client handlers
- Property Management → Property Data: stores property data
- Player → Personal Garages: uses garage (evidence: `README.md`)
- Player → Keys & Access: shares keys (evidence: `README.md`)
- Player → Wardrobes & Stashes: uses personal storage (evidence: `README.md`)
- Property Management → Framework Adapter: uses framework
