# pratikshakalbhor/freelancechain architecture

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

- Interactive diagram: https://gitdiagram.com/pratikshakalbhor/freelancechain
- Repository: https://github.com/pratikshakalbhor/freelancechain

## Overview

FreelanceChain is a Stellar-based freelance marketplace: clients post funded jobs, freelancers discover and apply, clients hire, freelancers submit work, and clients approve payment or enter dispute resolution. WalletContext and walletService provide multi-wallet access and signing; useEscrow orchestrates contract operations and records activity/indexed data. The README documents fee sponsorship and real-time chat, but sampled excerpts do not establish their runtime wiring, so those links are omitted. Several page and integration relationships are based on README capability descriptions rather than inspected page implementations.

Main entry points: [`src/hooks/useEscrow.js`](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/hooks/useEscrow.js) (Escrow operations), [`src/App.js`](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/App.js) (Application routes), [`src/pages/MyJobs.js`](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/MyJobs.js) (Manage jobs), [`src/context/ScalabilityContext.js`](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/context/ScalabilityContext.js) (Scalability services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_marketplace["Marketplace workflow"]
  node_app["Application routes<br/>[App.js]"]
  node_post_job["Post job<br/>[PostJobPage.js]"]
  node_find_jobs["Find jobs<br/>[FindJobs.js]"]
  node_my_jobs["Manage jobs<br/>[MyJobs.js]"]
  node_dashboard["Dashboard<br/>[DashboardPage.js]"]
end

subgraph group_wallet["Wallet and escrow"]
  node_wallet_context["Wallet session<br/>[WalletContext.js]"]
  node_wallet_service["Wallet adapters<br/>[walletService.js]"]
  node_escrow_hook["Escrow operations<br/>[useEscrow.js]"]
  node_contract[("Soroban escrow<br/>[lib.rs]")]
  node_stellar{{"Stellar network"}}
  node_payment["Payments<br/>[PaymentPage.js]"]
  node_sponsor["Fee sponsor<br/>[feeBump.js]"]
end

subgraph group_collaboration["Collaboration and trust"]
  node_chat["Real-time chat<br/>[ChatPage.js]"]
  node_profile["Profile and reviews<br/>[ProfilePage.js]"]
  node_review_card["Review display<br/>[ReviewCard.js]"]
  node_resolution["Resolution center"]
  node_dispute["Dispute handling<br/>[DisputeModal.js]"]
end

subgraph group_platform["Data and operations"]
  node_activity["Activity history<br/>[ActivityPage.js]"]
  node_indexer["Job indexer<br/>[dataIndexer.js]"]
  node_firebase[("Firebase data<br/>[firebase.js]")]
  node_monitoring["Monitoring<br/>[MonitoringPage.js]"]
  node_scalability["Scalability services"]
  node_cache["Cache manager<br/>[cacheManager.js]"]
  node_queue["Request queues<br/>[requestQueue.js]"]
  node_performance["Performance metrics"]
end

node_client(("Client"))
node_freelancer(("Freelancer"))

node_client -->|"uses"| node_app
node_freelancer -->|"uses"| node_app
node_app -->|"routes to"| node_post_job
node_app -->|"routes to"| node_find_jobs
node_app -->|"routes to"| node_my_jobs
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_chat
node_app -->|"routes to"| node_activity
node_app -->|"routes to"| node_resolution
node_app -->|"routes to"| node_monitoring
node_post_job -->|"uses"| node_escrow_hook
node_client -->|"creates job"| node_post_job
node_freelancer -->|"discovers jobs"| node_find_jobs
node_find_jobs -->|"applies for"| node_my_jobs
node_client -->|"hires and reviews"| node_my_jobs
node_freelancer -->|"submits work"| node_my_jobs
node_my_jobs -.->|"uses"| node_escrow_hook
node_client -->|"disputes"| node_resolution
node_resolution -->|"handles"| node_dispute
node_client -->|"approves release"| node_escrow_hook
node_wallet_context -->|"connects wallets"| node_wallet_service
node_escrow_hook -->|"reads wallet"| node_wallet_context
node_escrow_hook -->|"signs transactions"| node_wallet_service
node_escrow_hook -->|"invokes escrow"| node_contract
node_contract -->|"stores and releases"| node_stellar
node_escrow_hook -->|"refreshes index"| node_indexer
node_escrow_hook -->|"records activity"| node_activity
node_indexer -->|"reads and writes"| node_firebase
node_activity -.->|"loads history"| node_firebase
node_profile -->|"renders"| node_review_card
node_review_card -->|"queries reviews"| node_firebase
node_chat -->|"collaborates with"| node_freelancer
node_scalability -->|"provides"| node_cache
node_scalability -->|"provides"| node_queue
node_scalability -->|"provides"| node_performance
node_monitoring -->|"reports metrics"| node_scalability
node_escrow_hook -->|"queues RPC"| node_queue
node_escrow_hook -->|"invalidates cache"| node_cache
node_escrow_hook -->|"tracks calls"| node_performance
node_payment -.->|"transfers funds"| node_stellar
node_escrow_hook -.->|"sponsors fees"| node_sponsor

click node_app "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/App.js"
click node_post_job "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/PostJobPage.js"
click node_find_jobs "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/FindJobs.js"
click node_my_jobs "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/MyJobs.js"
click node_dashboard "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/DashboardPage.js"
click node_wallet_context "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/WalletContext.js"
click node_wallet_service "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/walletService.js"
click node_escrow_hook "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/hooks/useEscrow.js"
click node_contract "https://github.com/pratikshakalbhor/freelancechain/blob/main/escrow_contract/src/lib.rs"
click node_activity "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/ActivityPage.js"
click node_indexer "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/utils/dataIndexer.js"
click node_firebase "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/firebase.js"
click node_chat "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/ChatPage.js"
click node_profile "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/components/ProfilePage.js"
click node_review_card "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/components/ReviewCard.js"
click node_resolution "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/ResolutionCenter.js"
click node_dispute "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/components/DisputeModal.js"
click node_payment "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/PaymentPage.js"
click node_monitoring "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/MonitoringPage.js"
click node_scalability "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/context/ScalabilityContext.js"
click node_cache "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/utils/cacheManager.js"
click node_queue "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/utils/requestQueue.js"
click node_performance "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/utils/performanceMonitor.js"
click node_sponsor "https://github.com/pratikshakalbhor/freelancechain/blob/main/src/utils/feeBump.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_post_job,node_find_jobs,node_my_jobs,node_dashboard,node_client toneBlue
class node_wallet_context,node_wallet_service,node_escrow_hook,node_contract,node_stellar,node_payment,node_sponsor toneAmber
class node_chat,node_profile,node_review_card,node_resolution,node_dispute toneMint
class node_activity,node_indexer,node_firebase,node_monitoring,node_scalability,node_cache,node_queue,node_performance toneRose
class node_freelancer toneIndigo
```

## Components

### Marketplace workflow

- [Application routes](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/App.js): `src/App.js`
- [Post job](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/PostJobPage.js): `src/pages/PostJobPage.js`
- [Find jobs](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/FindJobs.js): `src/pages/FindJobs.js`
- [Manage jobs](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/MyJobs.js): `src/pages/MyJobs.js`
- [Dashboard](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/DashboardPage.js): `src/pages/DashboardPage.js`

### Wallet and escrow

- [Wallet session](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/WalletContext.js): `src/WalletContext.js`
- [Wallet adapters](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/walletService.js): `src/walletService.js`
- [Escrow operations](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/hooks/useEscrow.js): `src/hooks/useEscrow.js`
- [Soroban escrow](https://github.com/pratikshakalbhor/freelancechain/blob/main/escrow_contract/src/lib.rs): `escrow_contract/src/lib.rs`
- **Stellar network**
- [Payments](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/PaymentPage.js): `src/pages/PaymentPage.js`
- [Fee sponsor](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/utils/feeBump.js): `src/utils/feeBump.js`

### Collaboration and trust

- [Real-time chat](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/ChatPage.js): `src/pages/ChatPage.js`
- [Profile and reviews](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/components/ProfilePage.js): `src/components/ProfilePage.js`
- [Review display](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/components/ReviewCard.js): `src/components/ReviewCard.js`
- [Resolution center](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/ResolutionCenter.js): `src/pages/ResolutionCenter.js`
- [Dispute handling](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/components/DisputeModal.js): `src/components/DisputeModal.js`

### Data and operations

- [Activity history](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/ActivityPage.js): `src/pages/ActivityPage.js`
- [Job indexer](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/utils/dataIndexer.js): `src/utils/dataIndexer.js`
- [Firebase data](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/firebase.js): `src/firebase.js`
- [Monitoring](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/pages/MonitoringPage.js): `src/pages/MonitoringPage.js`
- [Scalability services](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/context/ScalabilityContext.js): `src/context/ScalabilityContext.js`
- [Cache manager](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/utils/cacheManager.js): `src/utils/cacheManager.js`
- [Request queues](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/utils/requestQueue.js): `src/utils/requestQueue.js`
- [Performance metrics](https://github.com/pratikshakalbhor/freelancechain/blob/main/src/utils/performanceMonitor.js): `src/utils/performanceMonitor.js`

### Other components

- **Client**
- **Freelancer**

## Connections

- Client → Application routes: uses
- Freelancer → Application routes: uses
- Application routes → Post job: routes to (evidence: `src/App.js`)
- Application routes → Find jobs: routes to (evidence: `src/App.js`)
- Application routes → Manage jobs: routes to (evidence: `src/App.js`)
- Application routes → Dashboard: routes to (evidence: `src/App.js`)
- Application routes → Real-time chat: routes to (evidence: `src/App.js`)
- Application routes → Activity history: routes to (evidence: `src/App.js`)
- Application routes → Resolution center: routes to (evidence: `src/App.js`)
- Application routes → Monitoring: routes to (evidence: `src/App.js`)
- Post job → Escrow operations: uses (evidence: `src/pages/PostJobPage.js`)
- Client → Post job: creates job
- Freelancer → Find jobs: discovers jobs
- Find jobs → Manage jobs: applies for
- Client → Manage jobs: hires and reviews
- Freelancer → Manage jobs: submits work
- Manage jobs → Escrow operations: uses
- Client → Resolution center: disputes
- Resolution center → Dispute handling: handles (evidence: `src/pages/ResolutionCenter.js`)
- Client → Escrow operations: approves release
- Wallet session → Wallet adapters: connects wallets (evidence: `src/WalletContext.js`)
- Escrow operations → Wallet session: reads wallet (evidence: `src/hooks/useEscrow.js`)
- Escrow operations → Wallet adapters: signs transactions (evidence: `src/hooks/useEscrow.js`)
- Escrow operations → Soroban escrow: invokes escrow
- Soroban escrow → Stellar network: stores and releases
- Escrow operations → Job indexer: refreshes index (evidence: `src/hooks/useEscrow.js`)
- Escrow operations → Activity history: records activity (evidence: `src/hooks/useEscrow.js`)
- Job indexer → Firebase data: reads and writes (evidence: `src/utils/dataIndexer.js`)
- Activity history → Firebase data: loads history
- Profile and reviews → Review display: renders (evidence: `src/components/ProfilePage.js`)
- Review display → Firebase data: queries reviews (evidence: `src/components/ReviewCard.js`)
- Real-time chat → Freelancer: collaborates with
- Scalability services → Cache manager: provides (evidence: `src/context/ScalabilityContext.js`)
- Scalability services → Request queues: provides (evidence: `src/context/ScalabilityContext.js`)
- Scalability services → Performance metrics: provides (evidence: `src/context/ScalabilityContext.js`)
- Monitoring → Scalability services: reports metrics (evidence: `src/pages/MonitoringPage.js`)
- Escrow operations → Request queues: queues RPC (evidence: `src/hooks/useEscrow.js`)
- Escrow operations → Cache manager: invalidates cache (evidence: `src/hooks/useEscrow.js`)
- Escrow operations → Performance metrics: tracks calls (evidence: `src/hooks/useEscrow.js`)
- Payments → Stellar network: transfers funds
- Escrow operations → Fee sponsor: sponsors fees
