# greenhacker420/tally_sync architecture

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

- Interactive diagram: https://gitdiagram.com/greenhacker420/tally_sync
- Repository: https://github.com/greenhacker420/tally_sync

## Overview

FinSync360 is a multi-platform ERP: users manage companies, accounting vouchers, inventory, payments and reporting through web, mobile or desktop clients, with the backend coordinating business APIs and persistence. Separate branches provide Tally synchronization and ML-powered predictions and analytics. The graph preserves documented GST, communications and payment capabilities; several are represented by their existing controller or service directories because their implementation was not sampled. Edges are limited to README statements and source relationships visible in the excerpts or SOURCE INDEX.

Main entry points: [`backend/src/server.js`](https://github.com/greenhacker420/tally_sync/blob/master/backend/src/server.js) (ERP API), [`mobile/src/screens`](https://github.com/greenhacker420/tally_sync/tree/master/mobile/src/screens) (Mobile app), [`backend/src/controllers/reportController.mjs`](https://github.com/greenhacker420/tally_sync/blob/master/backend/src/controllers/reportController.mjs) (Reports and budgets), [`ml-service/main.py`](https://github.com/greenhacker420/tally_sync/blob/master/ml-service/main.py) (ML API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Business clients"]
  node_web_app["Web ERP"]
  node_mobile_app["Mobile app"]
  node_desktop_app["Desktop ERP"]
end

subgraph group_core["ERP backend"]
  node_backend_api["ERP API<br/>[server.js]"]
  node_auth["Authentication<br/>[auth.js]"]
  node_accounting["Vouchers"]
  node_inventory["Inventory"]
  node_companies_parties["Companies and parties<br/>[Company.js]"]
  node_reporting["Reports and budgets"]
  node_database[("MongoDB<br/>[database.js]")]
end

subgraph group_integrations["Integrations"]
  node_gst["GST compliance<br/>[gstController.mjs]"]
  node_payments["Digital payments"]
  node_communications["Email and notifications"]
end

subgraph group_intelligence["ML intelligence"]
  node_ml_api["ML API<br/>[main.py]"]
  node_ml_predictions["Predictions and analytics"]
  node_ml_training["Model training"]
  node_ml_database[("ML data access<br/>[database.py]")]
end

subgraph group_desktop["Desktop operations"]
  node_tally_agent["Tally desktop agent<br/>[main.js]"]
  node_tally_sync["Tally synchronization<br/>[SyncManager.js]"]
  node_tally_service["Tally connector<br/>[TallyService.js]"]
  node_desktop_data[("Offline desktop data<br/>[DatabaseService.js]")]
  node_desktop_sync["Desktop sync<br/>[SyncService.js]"]
end

node_business_user(("Business user"))

node_business_user -->|"uses"| node_web_app
node_business_user -->|"uses"| node_mobile_app
node_business_user -->|"uses"| node_desktop_app
node_web_app -.->|"calls API"| node_backend_api
node_mobile_app -.->|"calls API"| node_backend_api
node_desktop_app -.->|"uses offline data"| node_desktop_data
node_desktop_sync -->|"reads and writes"| node_desktop_data
node_backend_api -->|"mounts routes"| node_auth
node_backend_api -->|"connects"| node_database
node_backend_api -->|"routes vouchers"| node_accounting
node_accounting -->|"updates balances"| node_companies_parties
node_reporting -->|"reads company data"| node_companies_parties
node_reporting -->|"reads vouchers"| node_accounting
node_backend_api -->|"serves inventory"| node_inventory
node_backend_api -->|"serves reports"| node_reporting
node_backend_api -->|"serves GST"| node_gst
node_backend_api -->|"serves payments"| node_payments
node_backend_api -->|"provides messaging"| node_communications
node_tally_agent -->|"initializes"| node_tally_sync
node_tally_sync -.->|"syncs from Tally"| node_tally_service
node_tally_agent -.->|"syncs with ERP"| node_backend_api
node_desktop_sync -->|"calls backend"| node_backend_api
node_ml_api -->|"initializes"| node_ml_predictions
node_ml_api -->|"initializes"| node_ml_training
node_ml_predictions -->|"reads data"| node_ml_database
node_ml_training -->|"reads data"| node_ml_database
node_mobile_app -.->|"requests predictions"| node_ml_api

click node_web_app "https://github.com/greenhacker420/tally_sync/tree/master/frontend-nextjs/src/app"
click node_mobile_app "https://github.com/greenhacker420/tally_sync/tree/master/mobile/src/screens"
click node_desktop_app "https://github.com/greenhacker420/tally_sync/tree/master/desktop/renderer/src"
click node_backend_api "https://github.com/greenhacker420/tally_sync/blob/master/backend/src/server.js"
click node_auth "https://github.com/greenhacker420/tally_sync/blob/master/backend/src/routes/auth.js"
click node_accounting "https://github.com/greenhacker420/tally_sync/blob/master/backend/src/controllers/voucherController.js"
click node_inventory "https://github.com/greenhacker420/tally_sync/blob/master/backend/src/controllers/inventoryController.js"
click node_companies_parties "https://github.com/greenhacker420/tally_sync/blob/master/backend/src/models/Company.js"
click node_reporting "https://github.com/greenhacker420/tally_sync/blob/master/backend/src/controllers/reportController.mjs"
click node_database "https://github.com/greenhacker420/tally_sync/blob/master/backend/src/config/database.js"
click node_gst "https://github.com/greenhacker420/tally_sync/blob/master/backend/src/controllers/gstController.mjs"
click node_payments "https://github.com/greenhacker420/tally_sync/blob/master/backend/src/controllers/paymentController.js"
click node_communications "https://github.com/greenhacker420/tally_sync/tree/master/backend/src/services"
click node_tally_agent "https://github.com/greenhacker420/tally_sync/blob/master/desktop-agent/main.js"
click node_tally_sync "https://github.com/greenhacker420/tally_sync/blob/master/desktop-agent/src/services/SyncManager.js"
click node_tally_service "https://github.com/greenhacker420/tally_sync/blob/master/desktop-agent/src/services/TallyService.js"
click node_desktop_data "https://github.com/greenhacker420/tally_sync/blob/master/desktop/src/main/services/DatabaseService.js"
click node_desktop_sync "https://github.com/greenhacker420/tally_sync/blob/master/desktop/src/main/services/SyncService.js"
click node_ml_api "https://github.com/greenhacker420/tally_sync/blob/master/ml-service/main.py"
click node_ml_predictions "https://github.com/greenhacker420/tally_sync/blob/master/ml-service/services/prediction_service.py"
click node_ml_training "https://github.com/greenhacker420/tally_sync/blob/master/ml-service/services/training_service.py"
click node_ml_database "https://github.com/greenhacker420/tally_sync/blob/master/ml-service/config/database.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_web_app,node_mobile_app,node_desktop_app,node_business_user toneBlue
class node_backend_api,node_auth,node_accounting,node_inventory,node_companies_parties,node_reporting,node_database toneAmber
class node_gst,node_payments,node_communications toneMint
class node_ml_api,node_ml_predictions,node_ml_training,node_ml_database toneRose
class node_tally_agent,node_tally_sync,node_tally_service,node_desktop_data,node_desktop_sync toneIndigo
```

## Components

### Business clients

- [Web ERP](https://github.com/greenhacker420/tally_sync/tree/master/frontend-nextjs/src/app): `frontend-nextjs/src/app`
- [Mobile app](https://github.com/greenhacker420/tally_sync/tree/master/mobile/src/screens): `mobile/src/screens`
- [Desktop ERP](https://github.com/greenhacker420/tally_sync/tree/master/desktop/renderer/src): `desktop/renderer/src`

### ERP backend

- [ERP API](https://github.com/greenhacker420/tally_sync/blob/master/backend/src/server.js): `backend/src/server.js`
- [Authentication](https://github.com/greenhacker420/tally_sync/blob/master/backend/src/routes/auth.js): `backend/src/routes/auth.js`
- [Vouchers](https://github.com/greenhacker420/tally_sync/blob/master/backend/src/controllers/voucherController.js): `backend/src/controllers/voucherController.js`
- [Inventory](https://github.com/greenhacker420/tally_sync/blob/master/backend/src/controllers/inventoryController.js): `backend/src/controllers/inventoryController.js`
- [Companies and parties](https://github.com/greenhacker420/tally_sync/blob/master/backend/src/models/Company.js): `backend/src/models/Company.js`
- [Reports and budgets](https://github.com/greenhacker420/tally_sync/blob/master/backend/src/controllers/reportController.mjs): `backend/src/controllers/reportController.mjs`
- [MongoDB](https://github.com/greenhacker420/tally_sync/blob/master/backend/src/config/database.js): `backend/src/config/database.js`

### Integrations

- [GST compliance](https://github.com/greenhacker420/tally_sync/blob/master/backend/src/controllers/gstController.mjs): `backend/src/controllers/gstController.mjs`
- [Digital payments](https://github.com/greenhacker420/tally_sync/blob/master/backend/src/controllers/paymentController.js): `backend/src/controllers/paymentController.js`
- [Email and notifications](https://github.com/greenhacker420/tally_sync/tree/master/backend/src/services): `backend/src/services`

### ML intelligence

- [ML API](https://github.com/greenhacker420/tally_sync/blob/master/ml-service/main.py): `ml-service/main.py`
- [Predictions and analytics](https://github.com/greenhacker420/tally_sync/blob/master/ml-service/services/prediction_service.py): `ml-service/services/prediction_service.py`
- [Model training](https://github.com/greenhacker420/tally_sync/blob/master/ml-service/services/training_service.py): `ml-service/services/training_service.py`
- [ML data access](https://github.com/greenhacker420/tally_sync/blob/master/ml-service/config/database.py): `ml-service/config/database.py`

### Desktop operations

- [Tally desktop agent](https://github.com/greenhacker420/tally_sync/blob/master/desktop-agent/main.js): `desktop-agent/main.js`
- [Tally synchronization](https://github.com/greenhacker420/tally_sync/blob/master/desktop-agent/src/services/SyncManager.js): `desktop-agent/src/services/SyncManager.js`
- [Tally connector](https://github.com/greenhacker420/tally_sync/blob/master/desktop-agent/src/services/TallyService.js): `desktop-agent/src/services/TallyService.js`
- [Offline desktop data](https://github.com/greenhacker420/tally_sync/blob/master/desktop/src/main/services/DatabaseService.js): `desktop/src/main/services/DatabaseService.js`
- [Desktop sync](https://github.com/greenhacker420/tally_sync/blob/master/desktop/src/main/services/SyncService.js): `desktop/src/main/services/SyncService.js`

### Other components

- **Business user**

## Connections

- Business user → Web ERP: uses
- Business user → Mobile app: uses
- Business user → Desktop ERP: uses
- Web ERP → ERP API: calls API
- Mobile app → ERP API: calls API
- Desktop ERP → Offline desktop data: uses offline data
- Desktop sync → Offline desktop data: reads and writes (evidence: `desktop/src/main/services/SyncService.js`)
- ERP API → Authentication: mounts routes (evidence: `backend/src/server.js`)
- ERP API → MongoDB: connects (evidence: `backend/src/server.js`)
- ERP API → Vouchers: routes vouchers (evidence: `backend/src/server.js`)
- Vouchers → Companies and parties: updates balances (evidence: `backend/src/controllers/voucherController.js`)
- Reports and budgets → Companies and parties: reads company data (evidence: `backend/src/controllers/reportController.mjs`)
- Reports and budgets → Vouchers: reads vouchers (evidence: `backend/src/controllers/reportController.mjs`)
- ERP API → Inventory: serves inventory
- ERP API → Reports and budgets: serves reports
- ERP API → GST compliance: serves GST
- ERP API → Digital payments: serves payments
- ERP API → Email and notifications: provides messaging (evidence: `backend/src/server.js`)
- Tally desktop agent → Tally synchronization: initializes (evidence: `desktop-agent/main.js`)
- Tally synchronization → Tally connector: syncs from Tally
- Tally desktop agent → ERP API: syncs with ERP
- Desktop sync → ERP API: calls backend
- ML API → Predictions and analytics: initializes (evidence: `ml-service/main.py`)
- ML API → Model training: initializes (evidence: `ml-service/main.py`)
- Predictions and analytics → ML data access: reads data (evidence: `ml-service/services/prediction_service.py`)
- Model training → ML data access: reads data (evidence: `ml-service/services/training_service.py`)
- Mobile app → ML API: requests predictions
