# nirrajkadam/mobile_billing_app architecture

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

- Interactive diagram: https://gitdiagram.com/nirrajkadam/mobile_billing_app
- Repository: https://github.com/nirrajkadam/mobile_billing_app

## Overview

LotusERP is a cross-platform ERP for furnishing and decor businesses. Users authenticate, then manage sales and custom orders, inventory and fabric rolls, manufacturing, deliveries, and financial records and reports. The Expo frontend communicates with a FastAPI backend, which applies role checks and persists business data in MongoDB. Backend responsibilities are grouped by domain, although the sampled implementation places them in one server file. The frontend-to-backend connection is documented; individual screen-to-client calls were not shown in the excerpts.

Main entry points: [`backend/server.py`](https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py) (Authentication and RBAC), [`frontend/src/api/client.ts`](https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/src/api/client.ts) (API and offline sync), [`frontend/app/(auth)/login.tsx`](https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/(auth)/login.tsx) (Sign in and roles), [`frontend/app/(tabs)/billing.tsx`](https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/(tabs)/billing.tsx) (POS billing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_auth_ui["Sign in and roles<br/>[login.tsx]"]
  node_billing_ui["POS billing<br/>[billing.tsx]"]
  node_inventory_ui["Inventory<br/>[inventory.tsx]"]
  node_orders_ui["Custom orders<br/>[custom-orders.tsx]"]
  node_manufacturing_ui["Manufacturing<br/>[manufacturing.tsx]"]
  node_rolls_ui["Fabric rolls<br/>[rolls.tsx]"]
  node_delivery_ui["Deliveries<br/>[deliveries.tsx]"]
  node_parties_ui["Parties<br/>[parties.tsx]"]
  node_expenses_ui["Expenses<br/>[expenses.tsx]"]
  node_reports_ui["Reports<br/>[reports.tsx]"]
  node_dashboard_ui["Dashboard<br/>[dashboard.tsx]"]
  node_api_client["API and offline sync<br/>[client.ts]"]
end

subgraph group_operations["Business operations"]
  node_sales_service["Billing and invoices<br/>[server.py]"]
  node_inventory_service["Inventory and parties<br/>[server.py]"]
  node_orders_service["Custom orders<br/>[server.py]"]
  node_manufacturing_service["Manufacturing batches<br/>[server.py]"]
  node_rolls_service["Roll lifecycle<br/>[server.py]"]
  node_delivery_service["OTP deliveries<br/>[server.py]"]
end

subgraph group_finance["Finance"]
  node_finance_service["Expenses and ledgers<br/>[server.py]"]
  node_report_service["GST and P&amp;L reports<br/>[server.py]"]
end

subgraph group_platform["Platform"]
  node_auth_service["Authentication and RBAC<br/>[server.py]"]
  node_mongo[("MongoDB")]
end

node_user(("Business user"))

node_user -->|"signs in"| node_auth_ui
node_user -->|"records sales"| node_billing_ui
node_user -->|"manages stock"| node_inventory_ui
node_user -->|"manages orders"| node_orders_ui
node_user -->|"tracks batches"| node_manufacturing_ui
node_user -->|"tracks rolls"| node_rolls_ui
node_user -->|"assigns deliveries"| node_delivery_ui
node_user -->|"manages parties"| node_parties_ui
node_user -->|"records expenses"| node_expenses_ui
node_user -->|"views reports"| node_reports_ui
node_user -->|"views dashboard"| node_dashboard_ui
node_api_client -->|"sends API requests"| node_auth_service
node_auth_service -->|"reads users"| node_mongo
node_sales_service -->|"reads and writes"| node_mongo
node_inventory_service -->|"reads and writes"| node_mongo
node_orders_service -->|"reads and writes"| node_mongo
node_manufacturing_service -.->|"updates stock"| node_mongo
node_rolls_service -->|"reads and writes"| node_mongo
node_delivery_service -->|"reads and writes"| node_mongo
node_finance_service -.->|"reads and writes"| node_mongo
node_report_service -->|"reads records"| node_mongo

click node_auth_ui "https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/(auth)/login.tsx"
click node_billing_ui "https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/(tabs)/billing.tsx"
click node_inventory_ui "https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/(tabs)/inventory.tsx"
click node_orders_ui "https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/custom-orders.tsx"
click node_manufacturing_ui "https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/manufacturing.tsx"
click node_rolls_ui "https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/rolls.tsx"
click node_delivery_ui "https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/deliveries.tsx"
click node_parties_ui "https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/(tabs)/parties.tsx"
click node_expenses_ui "https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/expenses.tsx"
click node_reports_ui "https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/reports.tsx"
click node_dashboard_ui "https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/(tabs)/dashboard.tsx"
click node_api_client "https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/src/api/client.ts"
click node_auth_service "https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py"
click node_sales_service "https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py"
click node_inventory_service "https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py"
click node_orders_service "https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py"
click node_manufacturing_service "https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py"
click node_rolls_service "https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py"
click node_delivery_service "https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py"
click node_finance_service "https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py"
click node_report_service "https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py"

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_auth_ui,node_billing_ui,node_inventory_ui,node_orders_ui,node_manufacturing_ui,node_rolls_ui,node_delivery_ui,node_parties_ui,node_expenses_ui,node_reports_ui,node_dashboard_ui,node_api_client,node_user toneBlue
class node_sales_service,node_inventory_service,node_orders_service,node_manufacturing_service,node_rolls_service,node_delivery_service toneAmber
class node_finance_service,node_report_service toneMint
class node_auth_service,node_mongo toneRose
```

## Components

### Frontend

- [Sign in and roles](https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/(auth)/login.tsx): `frontend/app/(auth)/login.tsx`
- [POS billing](https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/(tabs)/billing.tsx): `frontend/app/(tabs)/billing.tsx`
- [Inventory](https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/(tabs)/inventory.tsx): `frontend/app/(tabs)/inventory.tsx`
- [Custom orders](https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/custom-orders.tsx): `frontend/app/custom-orders.tsx`
- [Manufacturing](https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/manufacturing.tsx): `frontend/app/manufacturing.tsx`
- [Fabric rolls](https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/rolls.tsx): `frontend/app/rolls.tsx`
- [Deliveries](https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/deliveries.tsx): `frontend/app/deliveries.tsx`
- [Parties](https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/(tabs)/parties.tsx): `frontend/app/(tabs)/parties.tsx`
- [Expenses](https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/expenses.tsx): `frontend/app/expenses.tsx`
- [Reports](https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/reports.tsx): `frontend/app/reports.tsx`
- [Dashboard](https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/app/(tabs)/dashboard.tsx): `frontend/app/(tabs)/dashboard.tsx`
- [API and offline sync](https://github.com/nirrajkadam/mobile_billing_app/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### Business operations

- [Billing and invoices](https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py): `backend/server.py`
- [Inventory and parties](https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py): `backend/server.py`
- [Custom orders](https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py): `backend/server.py`
- [Manufacturing batches](https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py): `backend/server.py`
- [Roll lifecycle](https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py): `backend/server.py`
- [OTP deliveries](https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py): `backend/server.py`

### Finance

- [Expenses and ledgers](https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py): `backend/server.py`
- [GST and P&L reports](https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py): `backend/server.py`

### Platform

- [Authentication and RBAC](https://github.com/nirrajkadam/mobile_billing_app/blob/main/backend/server.py): `backend/server.py`
- **MongoDB**

### Other components

- **Business user**

## Connections

- Business user → Sign in and roles: signs in
- Business user → POS billing: records sales
- Business user → Inventory: manages stock
- Business user → Custom orders: manages orders
- Business user → Manufacturing: tracks batches
- Business user → Fabric rolls: tracks rolls
- Business user → Deliveries: assigns deliveries
- Business user → Parties: manages parties
- Business user → Expenses: records expenses
- Business user → Reports: views reports
- Business user → Dashboard: views dashboard
- API and offline sync → Authentication and RBAC: sends API requests (evidence: `frontend/src/api/client.ts`)
- Authentication and RBAC → MongoDB: reads users (evidence: `backend/server.py`)
- Billing and invoices → MongoDB: reads and writes (evidence: `backend/server.py`)
- Inventory and parties → MongoDB: reads and writes (evidence: `backend/server.py`)
- Custom orders → MongoDB: reads and writes (evidence: `backend/server.py`)
- Manufacturing batches → MongoDB: updates stock
- Roll lifecycle → MongoDB: reads and writes (evidence: `backend/server.py`)
- OTP deliveries → MongoDB: reads and writes (evidence: `backend/server.py`)
- Expenses and ledgers → MongoDB: reads and writes
- GST and P&L reports → MongoDB: reads records (evidence: `backend/server.py`)
