---
layout: home

hero:
  name: STA Connector
  text: BCB Integration Made Simple
  tagline: Elixir/Phoenix application for bidirectional file exchange with Brazil Central Bank's STA WebService
  image:
    src: /logo.svg
    alt: STA Connector
  actions:
    - theme: brand
      text: Get Started (EN)
      link: /en/guide/installation
    - theme: alt
      text: Primeiros Passos (PT)
      link: /pt/guide/installation
    - theme: alt
      text: API Reference
      link: /en/api/

features:
  - icon: "\uD83D\uDE80"
    title: High Performance
    details: Built with Elixir/OTP for massive concurrency. GenServer workers and supervision trees handle file processing with fault isolation.
  - icon: "\uD83D\uDEE1\uFE0F"
    title: Fault Tolerant
    details: OTP supervision trees, automatic process restart, and let-it-crash philosophy ensure reliable operation. Self-healing architecture recovers from failures.
  - icon: "\uD83D\uDCCA"
    title: Full Observability
    details: Built-in metrics with Telemetry, health checks, structured logging with Logger, and a comprehensive Vue 3 admin dashboard.
  - icon: "\uD83D\uDD04"
    title: Real-time Updates
    details: Phoenix Channels provide WebSocket-based real-time updates. Live file status, metrics streaming, and instant notifications.
  - icon: "\uD83C\uDFAF"
    title: BCB Compliant
    details: Respects BCB rate limits (10 concurrent connections, 120 queries/minute) with built-in throttling and GenServer-based queuing.
  - icon: "\uD83D\uDD0C"
    title: Easy Integration
    details: Phoenix REST APIs for file operations. Ecto for reliable data persistence. Simple configuration with config files and environment variables.
---

## Language / Idioma

| English | Portugues |
|---------|-----------|
| [Installation](/en/guide/installation) | [Instalacao](/pt/guide/installation) |
| [API Reference](/en/api/) | [Referencia API](/pt/api/) |
| [Architecture](/en/architecture/database) | [Arquitetura](/pt/architecture/concurrency) |
| [Deployment](/en/deployment/kubernetes) | [Implantacao](/pt/deployment/kubernetes) |

## Quick Overview

STA Connector provides a robust bridge between your systems and Brazil Central Bank's STA (Sistema de Transferencia de Arquivos) WebService.

```
+-------------------+         +------------------------+         +-------------------+
|   Your Systems    |<------->|     STA Connector      |<------->|      BCB STA      |
|    (REST API)     |         |   (Elixir/Phoenix)     |         |   (SOAP/HTTPS)    |
+-------------------+         +------------------------+         +-------------------+
                                         |
                              +----------v----------+
                              |   OTP Supervision   |
                              |       Tree          |
                              +----------+----------+
                                         |
                    +--------------------+--------------------+
                    |                    |                    |
           +--------v--------+  +--------v--------+  +--------v--------+
           |  STA.Client     |  |  File.Worker    |  |  Parser.Registry|
           |  (GenServer)    |  |  (GenServer)    |  |  (GenServer)    |
           +-----------------+  +-----------------+  +-----------------+
                                         |
                              +----------v----------+
                              |   Admin Portal      |
                              |   (Vue 3 + Vite)    |
                              +----------+----------+
                                         |
                              +----------v----------+
                              |  Phoenix Channels   |
                              |    (WebSocket)      |
                              +---------------------+
```

### Supported BCB Systems

| System | Description | Direction |
|--------|-------------|-----------|
| CCS | Customer Consultation System | Inbound/Outbound |
| CIR | Credit Information Registry | Inbound |
| CMP | Means of Payment Control | Inbound |
| STR | Reserve Transfer System | Inbound/Outbound |
| SPI | Instant Payment System (PIX) | Inbound/Outbound |
| CAM | Foreign Exchange System | Inbound |
| LDL | Deferred Settlement | Inbound |
| DICT | PIX Directory | Inbound/Outbound |

## Getting Started

```bash
# Clone the repository
git clone https://github.com/MonetarieBR/sta
cd sta

# Install dependencies
mix deps.get

# Configure environment
cp config/dev.secret.exs.example config/dev.secret.exs
nano config/dev.secret.exs  # Add your credentials

# Setup database
mix ecto.setup

# Start the Phoenix server
mix phx.server

# Or start with interactive shell
iex -S mix phx.server

# Access the admin portal
open http://localhost:4000
```

[Read the full installation guide](/en/guide/installation)

## Technology Stack

| Component | Technology |
|-----------|------------|
| Backend | Elixir 1.15+, Phoenix 1.7, OTP |
| Database | PostgreSQL 15, Ecto |
| HTTP Client | Finch |
| XML Parsing | SweetXml |
| Frontend | Vue 3, Vite, Pinia |
| Real-time | Phoenix Channels (WebSocket) |
| Deployment | Docker, Kubernetes |
| Docs | VitePress |

## Documentation

- **[Installation](/en/guide/installation)** - Quick setup guide
- **[Configuration](/en/guide/configuration)** - Config file reference
- **[Architecture](/en/architecture/database)** - System design and OTP components
- **[API Reference](/en/api/)** - REST API documentation
- **[Deployment](/en/deployment/kubernetes)** - Kubernetes deployment guide
- **[Troubleshooting](/en/troubleshooting)** - Common issues and solutions
