Skip to content

Adapter Tutorials

ArchiPy provides a variety of adapters to help interface with external systems, maintaining a clean separation between your business logic and external dependencies.

Available Adapters

Adapter Purpose Example API Reference
Email Email sending interface Connect to SMTP servers for sending emails API
Keycloak Authentication & authorization User management and access control with Keycloak API
Kafka Message streaming Event-driven architectures with Apache Kafka API
MinIO Object storage S3-compatible object storage for files and documents API
Payment Gateways Payment gateway Process online payments with Parsian & Saman API
PostgreSQL Database access SQLAlchemy integration for PostgreSQL API
SQLite Database access SQLAlchemy integration for SQLite API
StarRocks Database access SQLAlchemy integration for StarRocks API
ScyllaDB NoSQL database Wide-column store for ScyllaDB and Cassandra API
Elasticsearch Search & analytics Full-text search, document indexing, aggregations API
Redis Key-value store Caching, pub/sub, and data storage with Redis API
Temporal Workflow orchestration Durable workflow execution and activity coordination API

Adapter Architecture

ArchiPy follows the ports and adapters pattern (hexagonal architecture):

┌────────────────────────────────────────┐
│             Domain Logic               │
└───────────────────┬────────────────────┘
                    │ uses
┌───────────────────▼────────────────────┐
│                 Ports                  │
│          (Abstract Interfaces)         │
└───────────────────┬────────────────────┘
                    │ implemented by
┌───────────────────▼────────────────────┐
│                Adapters                │
│         (Concrete Implementations)     │
└───────────────────┬────────────────────┘
                    │ connects to
┌───────────────────▼────────────────────┐
│            External Systems            │
│   (Databases, APIs, Message Queues)    │
└────────────────────────────────────────┘

Creating Custom Adapters

Creating custom adapters is straightforward:

  1. Define a port (abstract interface)
  2. Implement the adapter class
  3. Optionally create a mock implementation

See the Concepts guide for more details on creating custom adapters.

See Also