# pasinduimalsha/propertysell architecture

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

- Interactive diagram: https://gitdiagram.com/pasinduimalsha/propertysell
- Repository: https://github.com/pasinduimalsha/propertysell

## Overview

PropertySell is a property marketplace with a Next.js interface and a Node backend. Users register or log in, discover listings, and can publish properties or place bids; administration and supporting workflows cover onboarding, assignments, offers, closing, and subscriptions. The backend entry point routes requests into domain services, which use repositories for persistence. The excerpts show frontend API calls and several service/repository behaviors; some domain modules are indexed but unsampled, so their internal connections are omitted.

Main entry points: [`backend/src/index.ts`](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/index.ts) (HTTP runtime), [`backend/src/modules/auth/service.ts`](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/auth/service.ts) (Authentication), [`backend/src/config/platform-config.ts`](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/config/platform-config.ts) (Platform configuration), [`frontend/app/page.tsx`](https://github.com/pasinduimalsha/propertysell/blob/main/frontend/app/page.tsx) (Marketplace UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client"]
  node_webapp["Marketplace UI<br/>[page.tsx]"]
  node_api_client["HTTP client<br/>[api.ts]"]
end

subgraph group_identity["Identity"]
  node_auth["Authentication<br/>[service.ts]"]
  node_auth_schemas["Auth validation<br/>[schemas.ts]"]
  node_auth_crypto["Password security<br/>[crypto.ts]"]
  node_auth_sessions["Session tokens<br/>[session.ts]"]
  node_auth_repo["User repository"]
end

subgraph group_marketplace["Marketplace"]
  node_listings["Listing management<br/>[service.ts]"]
  node_listing_schemas["Listing validation<br/>[schemas.ts]"]
  node_listing_repo["Listing repository"]
  node_search["Property search<br/>[service.ts]"]
  node_search_schemas["Search filters<br/>[schemas.ts]"]
  node_bidding["Bid placement<br/>[service.ts]"]
  node_bid_schemas["Bid validation<br/>[schemas.ts]"]
  node_bid_repo["Bid repository"]
  node_property_detail["Property details<br/>[service.ts]"]
  node_property_status["Property status<br/>[service.ts]"]
  node_inquiries["Inquiries<br/>[service.ts]"]
  node_inquiry_response["Inquiry responses<br/>[service.ts]"]
  node_saved_properties["Saved properties<br/>[service.ts]"]
  node_offers["Offer management<br/>[service.ts]"]
end

subgraph group_operations["Operations and platform"]
  node_server["HTTP runtime<br/>[index.ts]"]
  node_subscriptions["Subscriptions<br/>[service.ts]"]
  node_subscription_schemas["Plan validation<br/>[schemas.ts]"]
  node_subscription_repo["Plan repository"]
  node_agency_onboarding["Agency onboarding<br/>[service.ts]"]
  node_agency_assignment["Agency assignment<br/>[service.ts]"]
  node_property_assignment["Property assignment<br/>[service.ts]"]
  node_closing["Closing workflow<br/>[service.ts]"]
  node_media["Property media<br/>[media-storage.ts]"]
  node_platform_config["Platform configuration<br/>[platform-config.ts]"]
  node_email["Email service<br/>[email-service.ts]"]
  node_database[("Prisma client<br/>[prisma.ts]")]
end

node_visitor(("Marketplace user"))

node_visitor -->|"uses"| node_webapp
node_webapp -->|"calls"| node_api_client
node_api_client -.->|"sends HTTP"| node_server
node_server -.->|"routes to"| node_auth
node_server -.->|"routes to"| node_listings
node_server -->|"routes to"| node_search
node_server -.->|"routes to"| node_bidding
node_server -.->|"routes to"| node_subscriptions
node_server -->|"constructs"| node_auth_repo
node_server -->|"constructs"| node_listing_repo
node_server -->|"constructs"| node_bid_repo
node_server -->|"constructs"| node_subscription_repo
node_auth -->|"validates with"| node_auth_schemas
node_auth -->|"hashes passwords"| node_auth_crypto
node_auth -->|"signs tokens"| node_auth_sessions
node_listings -->|"validates with"| node_listing_schemas
node_search -->|"uses filters"| node_search_schemas
node_listing_repo -->|"accepts filters"| node_search_schemas
node_bidding -->|"validates with"| node_bid_schemas
node_subscriptions -->|"validates with"| node_subscription_schemas
node_media -->|"resolves storage"| node_platform_config
node_email -->|"resolves email"| node_platform_config
node_server -->|"loads runtime config"| node_platform_config
node_server -->|"loads client"| node_database
node_agency_onboarding -.-> node_agency_assignment
node_offers -.-> node_closing

click node_webapp "https://github.com/pasinduimalsha/propertysell/blob/main/frontend/app/page.tsx"
click node_api_client "https://github.com/pasinduimalsha/propertysell/blob/main/frontend/lib/api.ts"
click node_server "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/index.ts"
click node_auth "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/auth/service.ts"
click node_auth_schemas "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/auth/schemas.ts"
click node_auth_crypto "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/auth/crypto.ts"
click node_auth_sessions "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/auth/session.ts"
click node_auth_repo "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/auth/prisma-repository.ts"
click node_listings "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/listings/service.ts"
click node_listing_schemas "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/listings/schemas.ts"
click node_listing_repo "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/listings/prisma-repository.ts"
click node_search "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/search/service.ts"
click node_search_schemas "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/search/schemas.ts"
click node_bidding "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/bidding/service.ts"
click node_bid_schemas "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/bidding/schemas.ts"
click node_bid_repo "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/bidding/prisma-repository.ts"
click node_subscriptions "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/subscriptions/service.ts"
click node_subscription_schemas "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/subscriptions/schemas.ts"
click node_subscription_repo "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/subscriptions/prisma-repository.ts"
click node_agency_onboarding "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/agency-onboarding/service.ts"
click node_agency_assignment "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/agency-agent-assignment/service.ts"
click node_property_assignment "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/property-agent-assignment/service.ts"
click node_property_detail "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/property-detail/service.ts"
click node_property_status "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/property-status-management/service.ts"
click node_inquiries "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/inquiries/service.ts"
click node_inquiry_response "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/inquiry-response/service.ts"
click node_saved_properties "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/saved-properties/service.ts"
click node_offers "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/offer-management/service.ts"
click node_closing "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/closing-workflow/service.ts"
click node_media "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/platform/media-storage.ts"
click node_platform_config "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/config/platform-config.ts"
click node_email "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/platform/email-service.ts"
click node_database "https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/lib/prisma.ts"

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_webapp,node_api_client,node_visitor toneBlue
class node_auth,node_auth_schemas,node_auth_crypto,node_auth_sessions,node_auth_repo toneAmber
class node_listings,node_listing_schemas,node_listing_repo,node_search,node_search_schemas,node_bidding,node_bid_schemas,node_bid_repo,node_property_detail,node_property_status,node_inquiries,node_inquiry_response,node_saved_properties,node_offers toneMint
class node_server,node_subscriptions,node_subscription_schemas,node_subscription_repo,node_agency_onboarding,node_agency_assignment,node_property_assignment,node_closing,node_media,node_platform_config,node_email,node_database toneRose
```

## Components

### Client

- [Marketplace UI](https://github.com/pasinduimalsha/propertysell/blob/main/frontend/app/page.tsx): `frontend/app/page.tsx`
- [HTTP client](https://github.com/pasinduimalsha/propertysell/blob/main/frontend/lib/api.ts): `frontend/lib/api.ts`

### Identity

- [Authentication](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/auth/service.ts): `backend/src/modules/auth/service.ts`
- [Auth validation](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/auth/schemas.ts): `backend/src/modules/auth/schemas.ts`
- [Password security](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/auth/crypto.ts): `backend/src/modules/auth/crypto.ts`
- [Session tokens](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/auth/session.ts): `backend/src/modules/auth/session.ts`
- [User repository](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/auth/prisma-repository.ts): `backend/src/modules/auth/prisma-repository.ts`

### Marketplace

- [Listing management](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/listings/service.ts): `backend/src/modules/listings/service.ts`
- [Listing validation](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/listings/schemas.ts): `backend/src/modules/listings/schemas.ts`
- [Listing repository](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/listings/prisma-repository.ts): `backend/src/modules/listings/prisma-repository.ts`
- [Property search](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/search/service.ts): `backend/src/modules/search/service.ts`
- [Search filters](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/search/schemas.ts): `backend/src/modules/search/schemas.ts`
- [Bid placement](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/bidding/service.ts): `backend/src/modules/bidding/service.ts`
- [Bid validation](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/bidding/schemas.ts): `backend/src/modules/bidding/schemas.ts`
- [Bid repository](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/bidding/prisma-repository.ts): `backend/src/modules/bidding/prisma-repository.ts`
- [Property details](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/property-detail/service.ts): `backend/src/modules/property-detail/service.ts`
- [Property status](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/property-status-management/service.ts): `backend/src/modules/property-status-management/service.ts`
- [Inquiries](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/inquiries/service.ts): `backend/src/modules/inquiries/service.ts`
- [Inquiry responses](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/inquiry-response/service.ts): `backend/src/modules/inquiry-response/service.ts`
- [Saved properties](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/saved-properties/service.ts): `backend/src/modules/saved-properties/service.ts`
- [Offer management](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/offer-management/service.ts): `backend/src/modules/offer-management/service.ts`

### Operations and platform

- [HTTP runtime](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/index.ts): `backend/src/index.ts`
- [Subscriptions](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/subscriptions/service.ts): `backend/src/modules/subscriptions/service.ts`
- [Plan validation](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/subscriptions/schemas.ts): `backend/src/modules/subscriptions/schemas.ts`
- [Plan repository](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/subscriptions/prisma-repository.ts): `backend/src/modules/subscriptions/prisma-repository.ts`
- [Agency onboarding](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/agency-onboarding/service.ts): `backend/src/modules/agency-onboarding/service.ts`
- [Agency assignment](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/agency-agent-assignment/service.ts): `backend/src/modules/agency-agent-assignment/service.ts`
- [Property assignment](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/property-agent-assignment/service.ts): `backend/src/modules/property-agent-assignment/service.ts`
- [Closing workflow](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/closing-workflow/service.ts): `backend/src/modules/closing-workflow/service.ts`
- [Property media](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/platform/media-storage.ts): `backend/src/modules/platform/media-storage.ts`
- [Platform configuration](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/config/platform-config.ts): `backend/src/config/platform-config.ts`
- [Email service](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/modules/platform/email-service.ts): `backend/src/modules/platform/email-service.ts`
- [Prisma client](https://github.com/pasinduimalsha/propertysell/blob/main/backend/src/lib/prisma.ts): `backend/src/lib/prisma.ts`

### Other components

- **Marketplace user**

## Connections

- Marketplace user → Marketplace UI: uses (evidence: `frontend/app/page.tsx`)
- Marketplace UI → HTTP client: calls (evidence: `frontend/app/page.tsx`)
- HTTP client → HTTP runtime: sends HTTP
- HTTP runtime → Authentication: routes to (evidence: `backend/src/index.ts`)
- HTTP runtime → Listing management: routes to (evidence: `backend/src/index.ts`)
- HTTP runtime → Property search: routes to (evidence: `backend/src/index.ts`)
- HTTP runtime → Bid placement: routes to (evidence: `backend/src/index.ts`)
- HTTP runtime → Subscriptions: routes to (evidence: `backend/src/index.ts`)
- HTTP runtime → User repository: constructs (evidence: `backend/src/index.ts`)
- HTTP runtime → Listing repository: constructs (evidence: `backend/src/index.ts`)
- HTTP runtime → Bid repository: constructs (evidence: `backend/src/index.ts`)
- HTTP runtime → Plan repository: constructs (evidence: `backend/src/index.ts`)
- Authentication → Auth validation: validates with (evidence: `backend/src/modules/auth/service.ts`)
- Authentication → Password security: hashes passwords (evidence: `backend/src/modules/auth/service.ts`)
- Authentication → Session tokens: signs tokens (evidence: `backend/src/modules/auth/service.ts`)
- Listing management → Listing validation: validates with (evidence: `backend/src/modules/listings/service.ts`)
- Property search → Search filters: uses filters (evidence: `backend/src/modules/search/service.ts`)
- Listing repository → Search filters: accepts filters (evidence: `backend/src/modules/listings/prisma-repository.ts`)
- Bid placement → Bid validation: validates with (evidence: `backend/src/modules/bidding/service.ts`)
- Subscriptions → Plan validation: validates with (evidence: `backend/src/modules/subscriptions/service.ts`)
- Property media → Platform configuration: resolves storage (evidence: `backend/src/modules/platform/media-storage.ts`)
- Email service → Platform configuration: resolves email (evidence: `backend/src/modules/platform/email-service.ts`)
- HTTP runtime → Platform configuration: loads runtime config (evidence: `backend/src/index.ts`)
- HTTP runtime → Prisma client: loads client (evidence: `backend/src/index.ts`)
- Agency onboarding → Agency assignment
- Offer management → Closing workflow
