# karthickkk1807/tetro_aditya architecture

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

- Interactive diagram: https://gitdiagram.com/karthickkk1807/tetro_aditya
- Repository: https://github.com/karthickkk1807/tetro_aditya

## Overview

#### Purpose and runtime
TetroONE is a server-rendered, modular business-management/ERP application covering sales, purchasing, inventory, production, finance, HR, CRM, assets, quality, and maintenance. It is an ASP.NET Core MVC solution, rooted at `TetroONE.sln` and hosted by `TetroONE/Program.cs`; project dependencies and target runtime are defined in `TetroONE/TetroONE.csproj`.

#### Application entry and request pipeline
`TetroONE/Program.cs` is the host/composition entry point. Requests are handled by MVC controllers and rendered as Razor views, with shared page structure in `TetroONE/Views/Shared/_Layout.cshtml`. Cross-cutting request logging is implemented through `TetroONE/Extension/LoggerMiddleware.cs` and Log4net integration/configuration in `TetroONE/Extension/Log4netExtensions.cs` and `TetroONE/log4net.config`.

#### MVC delivery boundary
Controllers are the primary HTTP/API boundary; they own module routing and coordinate responses. `TetroONE/Controllers/BaseController.cs` is the likely common controller abstraction, while domain controllers pair with Razor page areas, for example `TetroONE/Controllers/InventoryController.cs` ↔ `TetroONE/Views/Inventory/ManageStock.cshtml`, and `TetroONE/Controllers/LoginController.cs` ↔ `TetroONE/Views/Login/Login.cshtml`. Browser-side module behavior is delivered as static JavaScript under `TetroONE/wwwroot/js/`.

#### Core commercial flow
Sales and purchasing are represented as adjacent modules with document-oriented models and views: quotations/orders/invoices/returns on the sales side, and requests/orders/invoices/returns on the procurement side. Key boundaries are `TetroONE/Controllers/TaxInvoiceController.cs`, `TetroONE/Models/Sale.cs`, `TetroONE/Controllers/PurchaseOrderController.cs`, `TetroONE/Models/PurchaseOrder.cs`, and `TetroONE/Controllers/PurchaseInvoiceController.cs`. PDF-specific models such as `TetroONE/Models/PDFTaxInvoice.cs` and `TetroONE/Models/PDFPurchaseOrder.cs` indicate printable/export document representations.

#### Operations: inventory, production, quality, assets
Operational control flows connect stock management, production execution, quality checks, and asset tracking. Inventory is anchored by `TetroONE/Controllers/InventoryController.cs` and `TetroONE/Models/Inventory.cs`; production exposes plans, job orders, inward/outward, delivery, and targets through `TetroONE/Controllers/ProductionsController.cs` and `TetroONE/Models/Productions.cs`. Quality is a separate controller boundary in `TetroONE/Controllers/QualityManagementController.cs`; asset lifecycle operations—including QR generation, transfer, audit, and scrap—are concentrated in `TetroONE/Controllers/AssetController.cs` and `TetroONE/Models/AssetManagement.cs`.

#### Finance, people, and administration
Finance encompasses payments, expenses, general ledger, planning, and profitability via `TetroONE/Controllers/PaymentController.cs`, `TetroONE/Controllers/GeneralLedgerController.cs`, and `TetroONE/Controllers/ProfitAnalysisController.cs`. HR includes employee, attendance, payroll, leave, recruitment, and permissions, centered on `TetroONE/Controllers/HumanResourceController.cs`, `TetroONE/Controllers/LeaveController.cs`, and `TetroONE/Models/HumanResource.cs`. Authentication/profile/access administration has dedicated boundaries: `TetroONE/Controllers/LoginController.cs`, `TetroONE/Controllers/UserAccessController.cs`, and `TetroONE/Controllers/PermissionController.cs`.

#### Client, integrations, and infrastructure
The UI is Razor plus static CSS/JavaScript, including Bootstrap and jQuery dependencies under `TetroONE/wwwroot/lib/bootstrap/` and `TetroONE/wwwroot/lib/jquery/`. The repository contains integrations/specialized device or communications entry points: `TetroONE/WatsAppApi.cs`, `TetroONE/Biometric.cs`, and `TetroONE/Controllers/EPSONController.cs`. Environment configuration is supplied through `TetroONE/appsettings.json` and `TetroONE/appsettings.Development.json`; specific backing datastore and external API contracts cannot be established from the supplied tree.

Main entry points: [`TetroONE/Controllers/BaseController.cs`](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/BaseController.cs) (MVC controllers), [`TetroONE/Program.cs`](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Program.cs) (Application host), [`TetroONE/Controllers/PurchaseOrderController.cs`](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/PurchaseOrderController.cs) (Purchasing documents), [`TetroONE/Controllers/InventoryController.cs`](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/InventoryController.cs) (Inventory management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_host["Host &amp; cross-cutting"]
  node_solution["Solution<br/>[TetroONE.sln]"]
  node_host_entry{{"Application host<br/>composition root<br/>[Program.cs]"}}
  node_project["Project runtime<br/>project definition<br/>[TetroONE.csproj]"]
  node_logging["Request logging<br/>middleware integration"]
  node_device_integration["Device integration<br/>printer controller<br/>[EPSONController.cs]"]
end

subgraph group_delivery["MVC delivery"]
  node_controllers["MVC controllers<br/>HTTP module boundary<br/>[BaseController.cs]"]
  node_razor_ui["Razor UI<br/>server-rendered views<br/>[_Layout.cshtml]"]
  node_browser_assets["Browser behavior<br/>static JavaScript"]
end

subgraph group_commercial["Commercial operations"]
  node_sales["Sales documents<br/>sales controller"]
  node_sales_model["Sales model<br/>document model<br/>[Sale.cs]"]
  node_purchasing["Purchasing documents<br/>procurement controllers"]
  node_purchase_model["Purchase order model<br/>document model<br/>[PurchaseOrder.cs]"]
end

subgraph group_operations["Operational control"]
  node_inventory["Inventory management<br/>inventory controller"]
  node_production["Production execution<br/>production controller"]
  node_quality["Quality management<br/>quality controller"]
  node_assets["Asset lifecycle<br/>asset controller<br/>[AssetController.cs]"]
end

subgraph group_admin["Finance, people &amp; access"]
  node_access["Authentication &amp; access<br/>access controllers<br/>[LoginController.cs]"]
  node_finance["Finance"]
  node_hr["Human resources<br/>HR controller"]
end

node_solution -->|"contains"| node_project
node_project -->|"builds"| node_host_entry
node_host_entry -->|"adds pipeline"| node_logging
node_host_entry -->|"maps MVC"| node_controllers
node_controllers -->|"renders"| node_razor_ui
node_razor_ui -->|"loads"| node_browser_assets
node_controllers -->|"routes access"| node_access
node_controllers -->|"routes sales"| node_sales
node_sales -->|"uses"| node_sales_model
node_controllers -->|"routes purchasing"| node_purchasing
node_purchasing -->|"uses"| node_purchase_model
node_controllers -->|"routes inventory"| node_inventory
node_controllers -->|"routes production"| node_production
node_controllers -->|"routes quality"| node_quality
node_controllers -->|"routes assets"| node_assets
node_controllers -->|"routes finance"| node_finance
node_controllers -->|"routes HR"| node_hr
node_purchasing -->|"procures stock"| node_inventory
node_inventory -->|"supplies movements"| node_production
node_production -->|"subjects output to checks"| node_quality
node_controllers -->|"routes device actions"| node_device_integration

click node_solution "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE.sln"
click node_host_entry "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Program.cs"
click node_project "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/TetroONE.csproj"
click node_logging "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Extension/LoggerMiddleware.cs"
click node_controllers "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/BaseController.cs"
click node_razor_ui "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Views/Shared/_Layout.cshtml"
click node_access "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/LoginController.cs"
click node_sales "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/TaxInvoiceController.cs"
click node_sales_model "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Models/Sale.cs"
click node_purchasing "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/PurchaseOrderController.cs"
click node_purchase_model "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Models/PurchaseOrder.cs"
click node_inventory "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/InventoryController.cs"
click node_production "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/ProductionsController.cs"
click node_quality "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/QualityManagementController.cs"
click node_assets "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/AssetController.cs"
click node_finance "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/GeneralLedgerController.cs"
click node_hr "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/HumanResourceController.cs"
click node_device_integration "https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/EPSONController.cs"

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_solution,node_host_entry,node_project,node_logging,node_device_integration toneBlue
class node_controllers,node_razor_ui,node_browser_assets toneAmber
class node_sales,node_sales_model,node_purchasing,node_purchase_model toneMint
class node_inventory,node_production,node_quality,node_assets toneRose
class node_access,node_finance,node_hr toneIndigo
```

## Components

### Host & cross-cutting

- [Solution](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE.sln): ASP.NET Core solution · `TetroONE.sln`
- [Application host](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Program.cs): composition root · `TetroONE/Program.cs`
- [Project runtime](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/TetroONE.csproj): project definition · `TetroONE/TetroONE.csproj`
- [Request logging](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Extension/LoggerMiddleware.cs): middleware integration · Logger middleware with Log4net integration. · `TetroONE/Extension/LoggerMiddleware.cs`
- [Device integration](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/EPSONController.cs): printer controller · Specialized EPSON device entry point. · `TetroONE/Controllers/EPSONController.cs`

### MVC delivery

- [MVC controllers](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/BaseController.cs): HTTP module boundary · Controllers route module requests and coordinate responses. · `TetroONE/Controllers/BaseController.cs`
- [Razor UI](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Views/Shared/_Layout.cshtml): server-rendered views · Shared layout and module pages render controller responses. · `TetroONE/Views/Shared/_Layout.cshtml`
- **Browser behavior**: static JavaScript

### Commercial operations

- [Sales documents](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/TaxInvoiceController.cs): sales controller · Handles quotation, order, invoice, and return flows. · `TetroONE/Controllers/TaxInvoiceController.cs`
- [Sales model](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Models/Sale.cs): document model · `TetroONE/Models/Sale.cs`
- [Purchasing documents](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/PurchaseOrderController.cs): procurement controllers · Purchase orders and invoices drive procurement documents. · `TetroONE/Controllers/PurchaseOrderController.cs`
- [Purchase order model](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Models/PurchaseOrder.cs): document model · `TetroONE/Models/PurchaseOrder.cs`

### Operational control

- [Inventory management](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/InventoryController.cs): inventory controller · `TetroONE/Controllers/InventoryController.cs`
- [Production execution](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/ProductionsController.cs): production controller · Plans, job orders, movements, delivery, and targets. · `TetroONE/Controllers/ProductionsController.cs`
- [Quality management](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/QualityManagementController.cs): quality controller · `TetroONE/Controllers/QualityManagementController.cs`
- [Asset lifecycle](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/AssetController.cs): asset controller · QR, transfer, audit, and scrap operations. · `TetroONE/Controllers/AssetController.cs`

### Finance, people & access

- [Authentication & access](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/LoginController.cs): access controllers · `TetroONE/Controllers/LoginController.cs`
- [Finance](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/GeneralLedgerController.cs): finance controllers · Payments, general ledger, and profit analysis. · `TetroONE/Controllers/GeneralLedgerController.cs`
- [Human resources](https://github.com/karthickkk1807/tetro_aditya/blob/main/TetroONE/Controllers/HumanResourceController.cs): HR controller · Employee, attendance, payroll, leave, and recruitment. · `TetroONE/Controllers/HumanResourceController.cs`

## Connections

- Solution → Project runtime: contains
- Project runtime → Application host: builds
- Application host → Request logging: adds pipeline
- Application host → MVC controllers: maps MVC
- MVC controllers → Razor UI: renders
- Razor UI → Browser behavior: loads
- MVC controllers → Authentication & access: routes access
- MVC controllers → Sales documents: routes sales
- Sales documents → Sales model: uses
- MVC controllers → Purchasing documents: routes purchasing
- Purchasing documents → Purchase order model: uses
- MVC controllers → Inventory management: routes inventory
- MVC controllers → Production execution: routes production
- MVC controllers → Quality management: routes quality
- MVC controllers → Asset lifecycle: routes assets
- MVC controllers → Finance: routes finance
- MVC controllers → Human resources: routes HR
- Purchasing documents → Inventory management: procures stock
- Inventory management → Production execution: supplies movements
- Production execution → Quality management: subjects output to checks
- MVC controllers → Device integration: routes device actions
