# realshare-tech/realshare architecture

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

- Interactive diagram: https://gitdiagram.com/realshare-tech/realshare
- Repository: https://github.com/realshare-tech/realshare

## Overview

RealShare appears to be a real-estate marketplace with an Expo mobile client and a Next.js admin/API application. Users browse services and properties, submit listings, and use agent and conversation features; administrators manage properties, agents, and operational workflows. The excerpts confirm selected API, persistence, and client relationships. The README is a template, and many product areas are unsampled, so uncertain relationships are omitted.

Main entry points: [`admin-dashboard/src/lib/prisma.ts`](https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/lib/prisma.ts) (Database client), [`admin-dashboard/src/app/api/properties/route.ts`](https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/properties/route.ts) (Property listings), [`admin-dashboard/src/app/api/properties/[id]/route.ts`](https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/properties/%5Bid%5D/route.ts) (Property detail), [`admin-dashboard/src/app/api/conversations/route.ts`](https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/conversations/route.ts) (Conversations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile experience"]
  node_mobile_app["Mobile app<br/>[index.tsx]"]
  node_services_strip["Service discovery<br/>[ServicesStrip.tsx]"]
  node_section_header["Section header<br/>[SectionHeader.tsx]"]
  node_agent_console["Agent console"]
  node_safe_storage["Client storage<br/>[storage.ts]"]
end

subgraph group_market["Marketplace APIs"]
  node_properties_api["Property listings<br/>[route.ts]"]
  node_property_detail["Property detail<br/>[route.ts]"]
  node_services_api["Services catalog<br/>[route.ts]"]
  node_agent_api["Agent management<br/>[route.ts]"]
  node_agent_dashboard_api["Agent dashboard API<br/>[route.ts]"]
  node_conversations_api["Conversations<br/>[route.ts]"]
end

subgraph group_operations["Admin operations"]
  node_admin_ui["Admin dashboard<br/>[page.tsx]"]
  node_approvals_api["Listing approvals<br/>[route.ts]"]
  node_audit_api["Audit records<br/>[route.ts]"]
end

subgraph group_platform["Shared platform"]
  node_http_socket["HTTP and realtime server<br/>[server.js]"]
  node_auth["Firebase authentication<br/>[firebase-admin.ts]"]
  node_database[("Postgres database")]
  node_prisma["Database client<br/>[prisma.ts]"]
  node_audit_extension["Prisma audit extension<br/>[prisma-audit.ts]"]
end

node_buyer(("App user"))

node_buyer -.->|"uses"| node_mobile_app
node_mobile_app -.->|"browses listings"| node_properties_api
node_services_strip -->|"fetches catalog"| node_services_api
node_services_strip -->|"renders"| node_section_header
node_agent_console -->|"fetches dashboard"| node_agent_dashboard_api
node_properties_api -->|"verifies tokens"| node_auth
node_properties_api -->|"queries listings"| node_prisma
node_property_detail -->|"reads and updates"| node_prisma
node_property_detail -->|"uses coordinate parser"| node_properties_api
node_property_detail -->|"deletes related records"| node_database
node_agent_api -->|"queries agent data"| node_prisma
node_conversations_api -->|"reads and creates threads"| node_prisma
node_conversations_api -->|"requires authentication"| node_auth
node_http_socket -->|"authenticates sockets"| node_auth
node_http_socket -.->|"serves API requests"| node_conversations_api
node_prisma -->|"queries"| node_database
node_prisma -->|"installs extension"| node_audit_extension
node_admin_ui -.->|"manages approvals"| node_approvals_api
node_admin_ui -.->|"reviews audit records"| node_audit_api

click node_mobile_app "https://github.com/realshare-tech/realshare/blob/main/android-app/src/app/(tabs)/index.tsx"
click node_services_strip "https://github.com/realshare-tech/realshare/blob/main/android-app/src/components/home/ServicesStrip.tsx"
click node_section_header "https://github.com/realshare-tech/realshare/blob/main/android-app/src/components/ui/SectionHeader.tsx"
click node_agent_console "https://github.com/realshare-tech/realshare/blob/main/android-app/src/components/agent/AgentClientsScreen.tsx"
click node_safe_storage "https://github.com/realshare-tech/realshare/blob/main/android-app/src/lib/storage.ts"
click node_properties_api "https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/properties/route.ts"
click node_property_detail "https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/properties/%5Bid%5D/route.ts"
click node_services_api "https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/services/catalog/route.ts"
click node_agent_api "https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/agents/route.ts"
click node_agent_dashboard_api "https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/agents/dashboard/route.ts"
click node_conversations_api "https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/conversations/route.ts"
click node_admin_ui "https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/page.tsx"
click node_approvals_api "https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/approvals/route.ts"
click node_audit_api "https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/audit/route.ts"
click node_http_socket "https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/server.js"
click node_auth "https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/lib/firebase-admin.ts"
click node_prisma "https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/lib/prisma.ts"
click node_audit_extension "https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/lib/prisma-audit.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_mobile_app,node_services_strip,node_section_header,node_agent_console,node_safe_storage,node_buyer toneBlue
class node_properties_api,node_property_detail,node_services_api,node_agent_api,node_agent_dashboard_api,node_conversations_api toneAmber
class node_admin_ui,node_approvals_api,node_audit_api toneMint
class node_http_socket,node_auth,node_database,node_prisma,node_audit_extension toneRose
```

## Components

### Mobile experience

- [Mobile app](https://github.com/realshare-tech/realshare/blob/main/android-app/src/app/(tabs)/index.tsx): `android-app/src/app/(tabs)/index.tsx`
- [Service discovery](https://github.com/realshare-tech/realshare/blob/main/android-app/src/components/home/ServicesStrip.tsx): `android-app/src/components/home/ServicesStrip.tsx`
- [Section header](https://github.com/realshare-tech/realshare/blob/main/android-app/src/components/ui/SectionHeader.tsx): `android-app/src/components/ui/SectionHeader.tsx`
- [Agent console](https://github.com/realshare-tech/realshare/blob/main/android-app/src/components/agent/AgentClientsScreen.tsx): `android-app/src/components/agent/AgentClientsScreen.tsx`
- [Client storage](https://github.com/realshare-tech/realshare/blob/main/android-app/src/lib/storage.ts): `android-app/src/lib/storage.ts`

### Marketplace APIs

- [Property listings](https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/properties/route.ts): `admin-dashboard/src/app/api/properties/route.ts`
- [Property detail](https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/properties/%5Bid%5D/route.ts): `admin-dashboard/src/app/api/properties/[id]/route.ts`
- [Services catalog](https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/services/catalog/route.ts): `admin-dashboard/src/app/api/services/catalog/route.ts`
- [Agent management](https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/agents/route.ts): `admin-dashboard/src/app/api/agents/route.ts`
- [Agent dashboard API](https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/agents/dashboard/route.ts): `admin-dashboard/src/app/api/agents/dashboard/route.ts`
- [Conversations](https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/conversations/route.ts): `admin-dashboard/src/app/api/conversations/route.ts`

### Admin operations

- [Admin dashboard](https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/page.tsx): `admin-dashboard/src/app/page.tsx`
- [Listing approvals](https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/approvals/route.ts): `admin-dashboard/src/app/api/approvals/route.ts`
- [Audit records](https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/app/api/audit/route.ts): `admin-dashboard/src/app/api/audit/route.ts`

### Shared platform

- [HTTP and realtime server](https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/server.js): `admin-dashboard/server.js`
- [Firebase authentication](https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/lib/firebase-admin.ts): `admin-dashboard/src/lib/firebase-admin.ts`
- **Postgres database**
- [Database client](https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/lib/prisma.ts): `admin-dashboard/src/lib/prisma.ts`
- [Prisma audit extension](https://github.com/realshare-tech/realshare/blob/main/admin-dashboard/src/lib/prisma-audit.ts): `admin-dashboard/src/lib/prisma-audit.ts`

### Other components

- **App user**

## Connections

- App user → Mobile app: uses
- Mobile app → Property listings: browses listings
- Service discovery → Services catalog: fetches catalog (evidence: `android-app/src/components/home/ServicesStrip.tsx`)
- Service discovery → Section header: renders (evidence: `android-app/src/components/home/ServicesStrip.tsx`)
- Agent console → Agent dashboard API: fetches dashboard (evidence: `android-app/src/components/agent/AgentClientsScreen.tsx`)
- Property listings → Firebase authentication: verifies tokens (evidence: `admin-dashboard/src/app/api/properties/route.ts`)
- Property listings → Database client: queries listings (evidence: `admin-dashboard/src/app/api/properties/route.ts`)
- Property detail → Database client: reads and updates (evidence: `admin-dashboard/src/app/api/properties/[id]/route.ts`)
- Property detail → Property listings: uses coordinate parser (evidence: `admin-dashboard/src/app/api/properties/[id]/route.ts`)
- Property detail → Postgres database: deletes related records (evidence: `admin-dashboard/src/app/api/properties/[id]/route.ts`)
- Agent management → Database client: queries agent data (evidence: `admin-dashboard/src/app/api/agents/route.ts`)
- Conversations → Database client: reads and creates threads (evidence: `admin-dashboard/src/app/api/conversations/route.ts`)
- Conversations → Firebase authentication: requires authentication (evidence: `admin-dashboard/src/app/api/conversations/route.ts`)
- HTTP and realtime server → Firebase authentication: authenticates sockets (evidence: `admin-dashboard/server.js`)
- HTTP and realtime server → Conversations: serves API requests
- Database client → Postgres database: queries (evidence: `admin-dashboard/src/lib/prisma.ts`)
- Database client → Prisma audit extension: installs extension (evidence: `admin-dashboard/src/lib/prisma.ts`)
- Admin dashboard → Listing approvals: manages approvals
- Admin dashboard → Audit records: reviews audit records
