# saadelsafel-dev/dakhl-freelance architecture

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

- Interactive diagram: https://gitdiagram.com/saadelsafel-dev/dakhl-freelance
- Repository: https://github.com/saadelsafel-dev/dakhl-freelance

## Overview

DAKHL is a freelancer–client marketplace. Users authenticate and complete a profile, discover providers, send connection requests, and use accepted connections for messaging and deal tracking; wallet funding supports paid transactions. The sampled code places much of the product UI and orchestration in App.tsx, with Firebase-backed operations in wallet.ts and authentication in AuthFlow.tsx. The documentation files suggest further capability areas, but their contents were not provided, so this map is limited to evidenced features and relationships.

Main entry points: [`src/features/auth/AuthFlow.tsx`](https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/features/auth/AuthFlow.tsx) (Sign-in and setup), [`src/lib/firebase.ts`](https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/lib/firebase.ts) (Firebase client setup), [`src/App.tsx`](https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/App.tsx) (Marketplace application), [`src/lib/wallet.ts`](https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/lib/wallet.ts) (Wallet and marketplace operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_entrypoint["React entrypoint<br/>[main.tsx]"]
  node_error_ui["Error boundary<br/>[ErrorBoundary.tsx]"]
end

subgraph group_identity["Identity and profiles"]
  node_auth_flow["Sign-in and setup<br/>[AuthFlow.tsx]"]
  node_profile_types["Profile and domain records<br/>[profile.ts]"]
end

subgraph group_marketplace["Marketplace workflows"]
  node_market_ui["Marketplace application<br/>[App.tsx]"]
  node_wallet_ops["Wallet and marketplace operations<br/>[wallet.ts]"]
  node_media_tools["Media and URL handling<br/>[media.ts]"]
end

subgraph group_platform["Firebase platform"]
  node_firebase_client["Firebase client setup<br/>[firebase.ts]"]
  node_firebase_auth{{"Firebase Authentication"}}
  node_firestore[("Cloud Firestore")]
  node_firebase_storage[("Firebase Storage")]
end

node_person(("Marketplace user"))
node_google_identity{{"Google sign-in"}}

node_entrypoint -->|"wraps UI"| node_error_ui
node_entrypoint -->|"renders"| node_auth_flow
node_auth_flow -->|"renders after sign-in"| node_market_ui
node_person -.->|"signs in"| node_auth_flow
node_auth_flow -->|"uses client"| node_firebase_client
node_auth_flow -->|"authenticates"| node_firebase_auth
node_auth_flow -->|"signs in with"| node_google_identity
node_auth_flow -->|"reads and writes profiles"| node_firestore
node_market_ui -->|"calls operations"| node_wallet_ops
node_market_ui -->|"processes media"| node_media_tools
node_market_ui -->|"subscribes to records"| node_firestore
node_market_ui -->|"uses domain records"| node_profile_types
node_wallet_ops -->|"uses client and errors"| node_firebase_client
node_wallet_ops -->|"reads and writes marketplace data"| node_firestore
node_wallet_ops -->|"validates media URLs"| node_media_tools
node_wallet_ops -->|"uses domain records"| node_profile_types
node_firebase_client -->|"initializes"| node_firebase_auth
node_firebase_client -->|"initializes"| node_firestore
node_firebase_client -->|"initializes"| node_firebase_storage
node_error_ui -->|"reads project info"| node_firebase_client

click node_entrypoint "https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/main.tsx"
click node_error_ui "https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/components/ErrorBoundary.tsx"
click node_market_ui "https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/App.tsx"
click node_auth_flow "https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/features/auth/AuthFlow.tsx"
click node_profile_types "https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/types/profile.ts"
click node_wallet_ops "https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/lib/wallet.ts"
click node_media_tools "https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/lib/media.ts"
click node_firebase_client "https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/lib/firebase.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_entrypoint,node_error_ui,node_person toneBlue
class node_auth_flow,node_profile_types toneAmber
class node_market_ui,node_wallet_ops,node_media_tools toneMint
class node_firebase_client,node_firebase_auth,node_firestore,node_firebase_storage toneRose
class node_google_identity toneIndigo
```

## Components

### Application entry

- [React entrypoint](https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/main.tsx): `src/main.tsx`
- [Error boundary](https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/components/ErrorBoundary.tsx): `src/components/ErrorBoundary.tsx`

### Identity and profiles

- [Sign-in and setup](https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/features/auth/AuthFlow.tsx): `src/features/auth/AuthFlow.tsx`
- [Profile and domain records](https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/types/profile.ts): `src/types/profile.ts`

### Marketplace workflows

- [Marketplace application](https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/App.tsx): `src/App.tsx`
- [Wallet and marketplace operations](https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/lib/wallet.ts): `src/lib/wallet.ts`
- [Media and URL handling](https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/lib/media.ts): `src/lib/media.ts`

### Firebase platform

- [Firebase client setup](https://github.com/saadelsafel-dev/dakhl-freelance/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`
- **Firebase Authentication**
- **Cloud Firestore**
- **Firebase Storage**

### Other components

- **Marketplace user**
- **Google sign-in**

## Connections

- React entrypoint → Error boundary: wraps UI (evidence: `src/main.tsx`)
- React entrypoint → Sign-in and setup: renders (evidence: `src/main.tsx`)
- Sign-in and setup → Marketplace application: renders after sign-in (evidence: `src/main.tsx`)
- Marketplace user → Sign-in and setup: signs in
- Sign-in and setup → Firebase client setup: uses client (evidence: `src/features/auth/AuthFlow.tsx`)
- Sign-in and setup → Firebase Authentication: authenticates (evidence: `src/features/auth/AuthFlow.tsx`)
- Sign-in and setup → Google sign-in: signs in with (evidence: `src/features/auth/AuthFlow.tsx`)
- Sign-in and setup → Cloud Firestore: reads and writes profiles (evidence: `src/features/auth/AuthFlow.tsx`)
- Marketplace application → Wallet and marketplace operations: calls operations (evidence: `src/App.tsx`)
- Marketplace application → Media and URL handling: processes media (evidence: `src/App.tsx`)
- Marketplace application → Cloud Firestore: subscribes to records (evidence: `src/App.tsx`)
- Marketplace application → Profile and domain records: uses domain records (evidence: `src/App.tsx`)
- Wallet and marketplace operations → Firebase client setup: uses client and errors (evidence: `src/lib/wallet.ts`)
- Wallet and marketplace operations → Cloud Firestore: reads and writes marketplace data (evidence: `src/lib/wallet.ts`)
- Wallet and marketplace operations → Media and URL handling: validates media URLs (evidence: `src/lib/wallet.ts`)
- Wallet and marketplace operations → Profile and domain records: uses domain records (evidence: `src/lib/wallet.ts`)
- Firebase client setup → Firebase Authentication: initializes (evidence: `src/lib/firebase.ts`)
- Firebase client setup → Cloud Firestore: initializes (evidence: `src/lib/firebase.ts`)
- Firebase client setup → Firebase Storage: initializes (evidence: `src/lib/firebase.ts`)
- Error boundary → Firebase client setup: reads project info (evidence: `src/components/ErrorBoundary.tsx`)
