> ## Documentation Index
> Fetch the complete documentation index at: https://docs.antei.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture Overview

> High-level overview of Antei's platform architecture, infrastructure providers, and deployment principles.

<Icon icon="server" size={26} color="#4B5563" />

# Architecture Overview

Antei runs on a **hybrid architecture** combining service-oriented design with event-driven workflows. This approach enables modularity, reliability, and responsiveness — critical for secure and scalable indirect tax operations.

All services are deployed across **Google Cloud Platform (GCP)** and **Cloudflare**, with PostgreSQL as the core data layer.

***

## Core Architectural Principles

* **Modular Service Components** — Ingestion, validation, invoicing, reconciliation, and email logic are implemented as independent services.
* **Event-Driven Pipelines** — Webhooks and triggers from connected platforms (e.g., Stripe, Gmail) drive real-time workflows.
* **Stateless Serverless Workers** — Cloudflare Workers handle extraction, ingestion, email dispatch, and file rendering without persistent state.
* **Structured Background Jobs** — Fallbacks, audits, reconciliations, and cron-driven syncs are orchestrated through Xano and PostgreSQL.
* **Data Isolation by Organization** — All data is logically partitioned and scoped to ensure security and multi-tenant compliance.
* **Auditability by Default** — Every major action is timestamped and stored, enabling traceability and compliance review.

***

## Infrastructure Stack

| Layer                  | Provider          | Purpose                                                  |
| :--------------------- | :---------------- | :------------------------------------------------------- |
| **Frontend**           | Retool            | Public-facing app on `*.tax.antei.com`                   |
| **Business Logic**     | Xano              | Auth, orchestration, fallback logic, API routes          |
| **Database**           | PostgreSQL on GCP | Structured relational storage for all primary entities   |
| **Background Jobs**    | Cron              | Reconciliation, sync, validation, calculations           |
| **Serverless Workers** | Cloudflare        | Ingestion, extraction, document generation, email        |
| **File Storage**       | Cloudflare R2     | PDFs, registration assets, legal documents, logos        |
| **Async Services**     | Railway, Render   | XLSX conversion, fallback retry logic, ingestion helpers |
| **Malware Detection**  | Cloudmersive      | Malware Detection for Uploaded Files                     |

***

## Hybrid Architecture Summary

Antei combines:

* **Service-Oriented Logic** (via Xano + Workers) for predictability, reusability, and modular scope
* **Event-Driven Triggers** (via webhooks) for real-time sync and responsiveness
* **Cron-based Reliability** for reprocessing, reconciliation, and periodic syncs

This allows for a system that is fast where it matters, but reliable and traceable where needed.

***

## Data Flow Summary

* Data enters via secure endpoints (Workers or Xano APIs)
* Structured records are persisted in PostgreSQL on GCP
* File-based assets are stored in Cloudflare R2
* Processing steps are logged with metadata and timestamps
* Sensitive data is tagged and scoped based on classification rules

***

## Diagram

```mermaid theme={null}
flowchart TD
  %% Layer: Frontend
  subgraph Frontend Layer
    Retool[Retool UI]
  end

  %% Layer: Backend
  subgraph Backend Layer
    ThirdParty[Third Party Software]
    Nango[Nango: Syncs & Actions]
    Xano[Xano: API Layer & Logic]
    GCP[(PostgreSQL on GCP)]
  end

  %% Layer: Independent Services
  subgraph Independent Services
    Railway[Railway: XLSX/Async]
    Workers[Cloudflare Workers]
    Render[Render Services]
  end

  %% Data Flows
  ThirdParty -->|Syncs| Nango
  Nango -->|Syncs| Xano
  Nango -->|Actions| ThirdParty
  Xano -->|Triggers| Railway
  Xano -->|Triggers| Render
  Xano -->|Triggers| Workers
  Xano --> GCP
  GCP --> Xano
  Xano --> Retool
  Workers -->|Extraction + Ingestion| Xano

  %% Styling
  classDef default fill:#f9f9f9,stroke:#ccc,stroke-width:1px,color:#333;
  classDef backend fill:#e8f0fe,stroke:#05347E,stroke-width:1px,color:#05347E;
  classDef infra fill:#e0f7f1,stroke:#15803D,stroke-width:1px,color:#15803D;
  classDef frontend fill:#fff7e6,stroke:#f59e0b,stroke-width:1px,color:#92400e;

  class Retool frontend;
  class Xano,Nango,GCP,ThirdParty backend;
  class Railway,Render,Workers infra;

```

***

## Compliance by Design

Our infrastructure stack is built for security, auditability, and scale:

* All endpoints use **TLS 1.2+**
* Hosting partners follow **SOC 2 / ISO 27001-aligned** controls
* **Per-org access controls** enforced at application and database levels
* High-availability setup with internal observability for job and data health

***

## Next Steps

* [→ Disaster Recovery Plan](/trust-center/Infrastructure%20&%20Availability/disaster-recovery)
* [→ Uptime and Monitoring](/trust-center/Infrastructure%20&%20Availability/status-monitoring)
* [→ Review SLA](/trust-center/Infrastructure%20&%20Availability/sla)
