# hebertpena88/sat-go-cliente architecture

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

- Interactive diagram: https://gitdiagram.com/hebertpena88/sat-go-cliente
- Repository: https://github.com/hebertpena88/sat-go-cliente

## Overview

SAT-GO Clientes is a set of .NET, PHP, Python, and React clients for obtaining credentials and consuming SAT-GO tax services. The documented credential flow is portal token → permanent API key → short-lived access token; client features include invoice queries, CSF, compliance opinions, declarations, and fiscal information. The .NET controller excerpt shows request handling for several tax workflows, while Python and React excerpts show application wiring. Several service implementations and PHP handlers were not sampled, so their API calls are shown as unverified rather than asserted.

Main entry points: [`net-cliente/SatGoCliente/Controllers/ConsultaSatController.cs`](https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Controllers/ConsultaSatController.cs) (.NET MVC routes), [`react-cliente/src/App.tsx`](https://github.com/hebertpena88/sat-go-cliente/blob/main/react-cliente/src/App.tsx) (React app), [`python-client/app.py`](https://github.com/hebertpena88/sat-go-cliente/blob/main/python-client/app.py) (Flask app), [`net-cliente/SatGoCliente/Services/FacturaService.cs`](https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Services/FacturaService.cs) (.NET invoices)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dotnet[".NET client"]
  node_dotnet_entry[".NET MVC routes"]
  node_dotnet_auth[".NET credentials<br/>[AuthService.cs]"]
  node_dotnet_invoice[".NET invoices<br/>[FacturaService.cs]"]
  node_dotnet_csf[".NET CSF<br/>[CsfService.cs]"]
  node_dotnet_opinion[".NET compliance"]
  node_dotnet_declaration[".NET declarations"]
  node_dotnet_fiscal[".NET fiscal info"]
  node_dotnet_logs[("In-memory traces<br/>[ILogStore.cs]")]
end

subgraph group_python["Python client"]
  node_python_entry["Flask app<br/>[app.py]"]
  node_python_auth_route["Auth route<br/>[auth.py]"]
  node_python_invoice_route["Invoice route<br/>[facturas.py]"]
  node_python_other_routes["Tax service routes<br/>[csf.py]"]
  node_python_auth["Credential service<br/>[auth_service.py]"]
  node_python_invoice["Invoice service<br/>[factura_service.py]"]
  node_python_tax["Tax services<br/>[csf_service.py]"]
end

subgraph group_php["PHP client"]
  node_php_entry["PHP client UI<br/>[index.php]"]
  node_php_auth_route["Auth handler<br/>[auth.php]"]
  node_php_auth["Credential service<br/>[AuthService.php]"]
  node_php_tax["Tax services<br/>[FacturaService.php]"]
  node_php_csf["CSF service<br/>[CsfService.php]"]
  node_php_declaration["Declaration service<br/>[DecService.php]"]
  node_php_opinion["Compliance service<br/>[OcService.php]"]
  node_php_fiscal["Fiscal info service"]
  node_php_imssoc["IMSS opinion service<br/>[ImssocService.php]"]
end

subgraph group_react["React client"]
  node_react_app["React app<br/>[App.tsx]"]
  node_react_invoice_form["Invoice query form"]
  node_react_invoice_results["Invoice results"]
  node_react_opinion_form["Compliance form"]
  node_react_csf_form["CSF form<br/>[CsfForm.tsx]"]
  node_react_fiel_form["FIEL credentials<br/>[FielDataForm.tsx]"]
  node_react_invoice_service["Invoice API service<br/>[FacturaService.ts]"]
  node_react_csf_service["CSF API service<br/>[CsfService.ts]"]
end

node_user(("Client user"))
node_satgo{{"SAT-GO API"}}

node_user -->|"submits queries"| node_dotnet_entry
node_dotnet_entry -->|"invokes invoices"| node_dotnet_invoice
node_dotnet_entry -->|"requests CSF"| node_dotnet_csf
node_dotnet_entry -->|"requests opinion"| node_dotnet_opinion
node_dotnet_entry -->|"requests declarations"| node_dotnet_declaration
node_dotnet_entry -->|"requests fiscal info"| node_dotnet_fiscal
node_dotnet_invoice -.->|"calls API"| node_satgo
node_dotnet_csf -.->|"calls API"| node_satgo
node_dotnet_opinion -.->|"calls API"| node_satgo
node_dotnet_declaration -.->|"calls API"| node_satgo
node_dotnet_fiscal -.->|"calls API"| node_satgo
node_user -->|"uses client"| node_python_entry
node_python_entry -->|"registers route"| node_python_auth_route
node_python_entry -->|"registers route"| node_python_invoice_route
node_python_entry -->|"registers routes"| node_python_other_routes
node_python_auth_route -->|"delegates auth"| node_python_auth
node_python_invoice_route -->|"delegates query"| node_python_invoice
node_python_auth -.->|"creates credentials"| node_satgo
node_python_invoice -.->|"queries invoices"| node_satgo
node_python_tax -.->|"queries tax data"| node_satgo
node_user -->|"uses client"| node_php_entry
node_php_auth_route -->|"delegates auth"| node_php_auth
node_php_auth -->|"creates credentials"| node_satgo
node_php_tax -.->|"queries tax data"| node_satgo
node_php_csf -.->|"queries CSF"| node_satgo
node_php_declaration -.->|"queries declarations"| node_satgo
node_php_opinion -.->|"queries opinion"| node_satgo
node_php_fiscal -.->|"queries fiscal info"| node_satgo
node_php_imssoc -.->|"queries IMSS opinion"| node_satgo
node_user -->|"uses client"| node_react_app
node_react_app -->|"renders credentials"| node_react_fiel_form
node_react_app -->|"renders query"| node_react_invoice_form
node_react_app -->|"renders results"| node_react_invoice_results
node_react_app -->|"renders form"| node_react_opinion_form
node_react_app -->|"renders form"| node_react_csf_form
node_react_invoice_service -.->|"queries invoices"| node_satgo
node_react_csf_service -.->|"queries CSF"| node_satgo

click node_dotnet_entry "https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Controllers/ConsultaSatController.cs"
click node_dotnet_auth "https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Services/AuthService.cs"
click node_dotnet_invoice "https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Services/FacturaService.cs"
click node_dotnet_csf "https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Services/CsfService.cs"
click node_dotnet_opinion "https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Services/OpinionCumplimientoService.cs"
click node_dotnet_declaration "https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Services/DeclaracionService.cs"
click node_dotnet_fiscal "https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Services/InfoFiscalService.cs"
click node_dotnet_logs "https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Services/ILogStore.cs"
click node_python_entry "https://github.com/hebertpena88/sat-go-cliente/blob/main/python-client/app.py"
click node_python_auth_route "https://github.com/hebertpena88/sat-go-cliente/blob/main/python-client/routes/auth.py"
click node_python_invoice_route "https://github.com/hebertpena88/sat-go-cliente/blob/main/python-client/routes/facturas.py"
click node_python_other_routes "https://github.com/hebertpena88/sat-go-cliente/blob/main/python-client/routes/csf.py"
click node_python_auth "https://github.com/hebertpena88/sat-go-cliente/blob/main/python-client/services/auth_service.py"
click node_python_invoice "https://github.com/hebertpena88/sat-go-cliente/blob/main/python-client/services/factura_service.py"
click node_python_tax "https://github.com/hebertpena88/sat-go-cliente/blob/main/python-client/services/csf_service.py"
click node_php_entry "https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/index.php"
click node_php_auth_route "https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/ajax/auth.php"
click node_php_auth "https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/services/AuthService.php"
click node_php_tax "https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/services/FacturaService.php"
click node_php_csf "https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/services/CsfService.php"
click node_php_declaration "https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/services/DecService.php"
click node_php_opinion "https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/services/OcService.php"
click node_php_fiscal "https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/services/InfoFiscalService.php"
click node_php_imssoc "https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/services/ImssocService.php"
click node_react_app "https://github.com/hebertpena88/sat-go-cliente/blob/main/react-cliente/src/App.tsx"
click node_react_invoice_form "https://github.com/hebertpena88/sat-go-cliente/blob/main/react-cliente/src/components/ConsultaFacturaForm.tsx"
click node_react_invoice_results "https://github.com/hebertpena88/sat-go-cliente/blob/main/react-cliente/src/components/FacturaResultados.tsx"
click node_react_opinion_form "https://github.com/hebertpena88/sat-go-cliente/blob/main/react-cliente/src/components/OpinionCumplimientoForm.tsx"
click node_react_csf_form "https://github.com/hebertpena88/sat-go-cliente/blob/main/react-cliente/src/components/CsfForm.tsx"
click node_react_fiel_form "https://github.com/hebertpena88/sat-go-cliente/blob/main/react-cliente/src/components/FielDataForm.tsx"
click node_react_invoice_service "https://github.com/hebertpena88/sat-go-cliente/blob/main/react-cliente/src/services/FacturaService.ts"
click node_react_csf_service "https://github.com/hebertpena88/sat-go-cliente/blob/main/react-cliente/src/services/CsfService.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_dotnet_entry,node_dotnet_auth,node_dotnet_invoice,node_dotnet_csf,node_dotnet_opinion,node_dotnet_declaration,node_dotnet_fiscal,node_dotnet_logs,node_user toneBlue
class node_python_entry,node_python_auth_route,node_python_invoice_route,node_python_other_routes,node_python_auth,node_python_invoice,node_python_tax toneAmber
class node_php_entry,node_php_auth_route,node_php_auth,node_php_tax,node_php_csf,node_php_declaration,node_php_opinion,node_php_fiscal,node_php_imssoc,node_satgo toneMint
class node_react_app,node_react_invoice_form,node_react_invoice_results,node_react_opinion_form,node_react_csf_form,node_react_fiel_form,node_react_invoice_service,node_react_csf_service toneRose
```

## Components

### .NET client

- [.NET MVC routes](https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Controllers/ConsultaSatController.cs): `net-cliente/SatGoCliente/Controllers/ConsultaSatController.cs`
- [.NET credentials](https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Services/AuthService.cs): `net-cliente/SatGoCliente/Services/AuthService.cs`
- [.NET invoices](https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Services/FacturaService.cs): `net-cliente/SatGoCliente/Services/FacturaService.cs`
- [.NET CSF](https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Services/CsfService.cs): `net-cliente/SatGoCliente/Services/CsfService.cs`
- [.NET compliance](https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Services/OpinionCumplimientoService.cs): `net-cliente/SatGoCliente/Services/OpinionCumplimientoService.cs`
- [.NET declarations](https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Services/DeclaracionService.cs): `net-cliente/SatGoCliente/Services/DeclaracionService.cs`
- [.NET fiscal info](https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Services/InfoFiscalService.cs): `net-cliente/SatGoCliente/Services/InfoFiscalService.cs`
- [In-memory traces](https://github.com/hebertpena88/sat-go-cliente/blob/main/net-cliente/SatGoCliente/Services/ILogStore.cs): `net-cliente/SatGoCliente/Services/ILogStore.cs`

### Python client

- [Flask app](https://github.com/hebertpena88/sat-go-cliente/blob/main/python-client/app.py): `python-client/app.py`
- [Auth route](https://github.com/hebertpena88/sat-go-cliente/blob/main/python-client/routes/auth.py): `python-client/routes/auth.py`
- [Invoice route](https://github.com/hebertpena88/sat-go-cliente/blob/main/python-client/routes/facturas.py): `python-client/routes/facturas.py`
- [Tax service routes](https://github.com/hebertpena88/sat-go-cliente/blob/main/python-client/routes/csf.py): `python-client/routes/csf.py`
- [Credential service](https://github.com/hebertpena88/sat-go-cliente/blob/main/python-client/services/auth_service.py): `python-client/services/auth_service.py`
- [Invoice service](https://github.com/hebertpena88/sat-go-cliente/blob/main/python-client/services/factura_service.py): `python-client/services/factura_service.py`
- [Tax services](https://github.com/hebertpena88/sat-go-cliente/blob/main/python-client/services/csf_service.py): `python-client/services/csf_service.py`

### PHP client

- [PHP client UI](https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/index.php): `php-cliente/index.php`
- [Auth handler](https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/ajax/auth.php): `php-cliente/ajax/auth.php`
- [Credential service](https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/services/AuthService.php): `php-cliente/services/AuthService.php`
- [Tax services](https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/services/FacturaService.php): `php-cliente/services/FacturaService.php`
- [CSF service](https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/services/CsfService.php): `php-cliente/services/CsfService.php`
- [Declaration service](https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/services/DecService.php): `php-cliente/services/DecService.php`
- [Compliance service](https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/services/OcService.php): `php-cliente/services/OcService.php`
- [Fiscal info service](https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/services/InfoFiscalService.php): `php-cliente/services/InfoFiscalService.php`
- [IMSS opinion service](https://github.com/hebertpena88/sat-go-cliente/blob/main/php-cliente/services/ImssocService.php): `php-cliente/services/ImssocService.php`

### React client

- [React app](https://github.com/hebertpena88/sat-go-cliente/blob/main/react-cliente/src/App.tsx): `react-cliente/src/App.tsx`
- [Invoice query form](https://github.com/hebertpena88/sat-go-cliente/blob/main/react-cliente/src/components/ConsultaFacturaForm.tsx): `react-cliente/src/components/ConsultaFacturaForm.tsx`
- [Invoice results](https://github.com/hebertpena88/sat-go-cliente/blob/main/react-cliente/src/components/FacturaResultados.tsx): `react-cliente/src/components/FacturaResultados.tsx`
- [Compliance form](https://github.com/hebertpena88/sat-go-cliente/blob/main/react-cliente/src/components/OpinionCumplimientoForm.tsx): `react-cliente/src/components/OpinionCumplimientoForm.tsx`
- [CSF form](https://github.com/hebertpena88/sat-go-cliente/blob/main/react-cliente/src/components/CsfForm.tsx): `react-cliente/src/components/CsfForm.tsx`
- [FIEL credentials](https://github.com/hebertpena88/sat-go-cliente/blob/main/react-cliente/src/components/FielDataForm.tsx): `react-cliente/src/components/FielDataForm.tsx`
- [Invoice API service](https://github.com/hebertpena88/sat-go-cliente/blob/main/react-cliente/src/services/FacturaService.ts): `react-cliente/src/services/FacturaService.ts`
- [CSF API service](https://github.com/hebertpena88/sat-go-cliente/blob/main/react-cliente/src/services/CsfService.ts): `react-cliente/src/services/CsfService.ts`

### Other components

- **Client user**
- **SAT-GO API**

## Connections

- Client user → .NET MVC routes: submits queries
- .NET MVC routes → .NET invoices: invokes invoices (evidence: `net-cliente/SatGoCliente/Controllers/ConsultaSatController.cs`)
- .NET MVC routes → .NET CSF: requests CSF (evidence: `net-cliente/SatGoCliente/Controllers/ConsultaSatController.cs`)
- .NET MVC routes → .NET compliance: requests opinion (evidence: `net-cliente/SatGoCliente/Controllers/ConsultaSatController.cs`)
- .NET MVC routes → .NET declarations: requests declarations (evidence: `net-cliente/SatGoCliente/Controllers/ConsultaSatController.cs`)
- .NET MVC routes → .NET fiscal info: requests fiscal info (evidence: `net-cliente/SatGoCliente/Controllers/ConsultaSatController.cs`)
- .NET invoices → SAT-GO API: calls API
- .NET CSF → SAT-GO API: calls API
- .NET compliance → SAT-GO API: calls API
- .NET declarations → SAT-GO API: calls API
- .NET fiscal info → SAT-GO API: calls API
- Client user → Flask app: uses client
- Flask app → Auth route: registers route (evidence: `python-client/app.py`)
- Flask app → Invoice route: registers route (evidence: `python-client/app.py`)
- Flask app → Tax service routes: registers routes (evidence: `python-client/app.py`)
- Auth route → Credential service: delegates auth (evidence: `python-client/routes/auth.py`)
- Invoice route → Invoice service: delegates query (evidence: `python-client/routes/facturas.py`)
- Credential service → SAT-GO API: creates credentials
- Invoice service → SAT-GO API: queries invoices
- Tax services → SAT-GO API: queries tax data
- Client user → PHP client UI: uses client
- Auth handler → Credential service: delegates auth (evidence: `php-cliente/ajax/auth.php`)
- Credential service → SAT-GO API: creates credentials (evidence: `php-cliente/services/AuthService.php`)
- Tax services → SAT-GO API: queries tax data
- CSF service → SAT-GO API: queries CSF
- Declaration service → SAT-GO API: queries declarations
- Compliance service → SAT-GO API: queries opinion
- Fiscal info service → SAT-GO API: queries fiscal info
- IMSS opinion service → SAT-GO API: queries IMSS opinion
- Client user → React app: uses client
- React app → FIEL credentials: renders credentials (evidence: `react-cliente/src/App.tsx`)
- React app → Invoice query form: renders query (evidence: `react-cliente/src/App.tsx`)
- React app → Invoice results: renders results (evidence: `react-cliente/src/App.tsx`)
- React app → Compliance form: renders form (evidence: `react-cliente/src/App.tsx`)
- React app → CSF form: renders form (evidence: `react-cliente/src/App.tsx`)
- Invoice API service → SAT-GO API: queries invoices
- CSF API service → SAT-GO API: queries CSF
