# pabir/digisewa architecture

> Architecture diagram of the GitHub repository pabir/digisewa, 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/pabir/digisewa
- Repository: https://github.com/pabir/digisewa

## Overview

Tafdeal is an Expo/React Native marketplace backed by Firebase. The visible client entry point installs authentication, wishlist, comparison, and cart state before opening navigation; the sampled backend handles marketplace operations including payment callbacks, order updates, seller settlements, catalog data, and recommendations. The source tree indicates additional client screens and services, but their implementations were not sampled, so their detailed flow is left unspecified. `restore.js` is a source-repair script, not part of the runtime architecture.

Main entry points: [`App.tsx`](https://github.com/pabir/digisewa/blob/main/App.tsx) (App entry), [`functions/index.js`](https://github.com/pabir/digisewa/blob/main/functions/index.js) (Marketplace operations), [`src/navigation`](https://github.com/pabir/digisewa/tree/main/src/navigation) (App navigation), [`src/screens`](https://github.com/pabir/digisewa/tree/main/src/screens) (Marketplace screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Marketplace client"]
  node_app["App entry<br/>[App.tsx]"]
  node_auth["Authentication state"]
  node_wishlist["Wishlist state"]
  node_compare["Compare state"]
  node_cart["Cart state"]
  node_navigation["App navigation"]
  node_client_screens["Marketplace screens"]
  node_client_services["Client services"]
end

subgraph group_backend["Marketplace backend"]
  node_firebase[("Firebase platform")]
  node_backend_ops["Marketplace operations<br/>[index.js]"]
  node_payments["Payment processing<br/>[index.js]"]
  node_seller_settlement["Seller settlements<br/>[index.js]"]
  node_redis[("Redis cache")]
end

subgraph group_catalog["Catalog and discovery"]
  node_catalog_ops["Catalog management<br/>[index.js]"]
  node_product_discovery["Product discovery<br/>[index.js]"]
end

node_user(("Marketplace user"))

node_user -->|"uses"| node_app
node_app -->|"provides"| node_auth
node_app -->|"provides"| node_wishlist
node_app -->|"provides"| node_compare
node_app -->|"provides"| node_cart
node_app -->|"renders"| node_navigation
node_navigation -.->|"routes to"| node_client_screens
node_client_screens -.->|"uses"| node_client_services
node_backend_ops -->|"reads and writes"| node_firebase
node_payments -->|"updates orders"| node_firebase
node_seller_settlement -->|"reads and writes"| node_firebase
node_catalog_ops -->|"reads and writes"| node_firebase
node_product_discovery -->|"reads products"| node_firebase
node_backend_ops -->|"caches products"| node_redis
node_payments -.->|"accepts payment"| node_user

click node_app "https://github.com/pabir/digisewa/blob/main/App.tsx"
click node_auth "https://github.com/pabir/digisewa/tree/main/src/context"
click node_wishlist "https://github.com/pabir/digisewa/tree/main/src/context"
click node_compare "https://github.com/pabir/digisewa/tree/main/src/context"
click node_cart "https://github.com/pabir/digisewa/tree/main/src/context"
click node_navigation "https://github.com/pabir/digisewa/tree/main/src/navigation"
click node_client_screens "https://github.com/pabir/digisewa/tree/main/src/screens"
click node_client_services "https://github.com/pabir/digisewa/tree/main/src/services"
click node_backend_ops "https://github.com/pabir/digisewa/blob/main/functions/index.js"
click node_payments "https://github.com/pabir/digisewa/blob/main/functions/index.js"
click node_seller_settlement "https://github.com/pabir/digisewa/blob/main/functions/index.js"
click node_catalog_ops "https://github.com/pabir/digisewa/blob/main/functions/index.js"
click node_product_discovery "https://github.com/pabir/digisewa/blob/main/functions/index.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_auth,node_wishlist,node_compare,node_cart,node_navigation,node_client_screens,node_client_services,node_user toneBlue
class node_firebase,node_backend_ops,node_payments,node_seller_settlement,node_redis toneAmber
class node_catalog_ops,node_product_discovery toneMint
```

## Components

### Marketplace client

- [App entry](https://github.com/pabir/digisewa/blob/main/App.tsx): `App.tsx`
- [Authentication state](https://github.com/pabir/digisewa/tree/main/src/context): `src/context`
- [Wishlist state](https://github.com/pabir/digisewa/tree/main/src/context): `src/context`
- [Compare state](https://github.com/pabir/digisewa/tree/main/src/context): `src/context`
- [Cart state](https://github.com/pabir/digisewa/tree/main/src/context): `src/context`
- [App navigation](https://github.com/pabir/digisewa/tree/main/src/navigation): `src/navigation`
- [Marketplace screens](https://github.com/pabir/digisewa/tree/main/src/screens): `src/screens`
- [Client services](https://github.com/pabir/digisewa/tree/main/src/services): `src/services`

### Marketplace backend

- **Firebase platform**
- [Marketplace operations](https://github.com/pabir/digisewa/blob/main/functions/index.js): `functions/index.js`
- [Payment processing](https://github.com/pabir/digisewa/blob/main/functions/index.js): `functions/index.js`
- [Seller settlements](https://github.com/pabir/digisewa/blob/main/functions/index.js): `functions/index.js`
- **Redis cache**

### Catalog and discovery

- [Catalog management](https://github.com/pabir/digisewa/blob/main/functions/index.js): `functions/index.js`
- [Product discovery](https://github.com/pabir/digisewa/blob/main/functions/index.js): `functions/index.js`

### Other components

- **Marketplace user**

## Connections

- Marketplace user → App entry: uses
- App entry → Authentication state: provides (evidence: `App.tsx`)
- App entry → Wishlist state: provides (evidence: `App.tsx`)
- App entry → Compare state: provides (evidence: `App.tsx`)
- App entry → Cart state: provides (evidence: `App.tsx`)
- App entry → App navigation: renders (evidence: `App.tsx`)
- App navigation → Marketplace screens: routes to
- Marketplace screens → Client services: uses
- Marketplace operations → Firebase platform: reads and writes (evidence: `functions/index.js`)
- Payment processing → Firebase platform: updates orders (evidence: `functions/index.js`)
- Seller settlements → Firebase platform: reads and writes (evidence: `functions/index.js`)
- Catalog management → Firebase platform: reads and writes (evidence: `functions/index.js`)
- Product discovery → Firebase platform: reads products (evidence: `functions/index.js`)
- Marketplace operations → Redis cache: caches products (evidence: `functions/index.js`)
- Payment processing → Marketplace user: accepts payment
