AFL-automation Architecture#
This page explains the core architecture of AFL-automation and how its components work together.
Core Concepts#
AFL-automation is built around several key concepts:
Drivers: Python classes that interface with hardware or provide services
APIServer: A Flask-based web server that exposes drivers via HTTP
Task Queue: A system for managing asynchronous tasks
Client: A Python client for interacting with remote services
Architecture Diagram#
The following diagram illustrates the high-level architecture:
+----------------+ +-----------------+ +----------------+
| | | | | |
| Driver Class +----->+ API Server +<---->+ Client |
| (Hardware) | | (Flask) | | (Python/HTTP) |
| | | | | |
+----------------+ +-----------------+ +----------------+
^
|
v
+-----------------+
| |
| Task Queue |
| (Background) |
| |
+-----------------+
Driver System#
The driver system is the core of AFL-automation. Drivers:
Encapsulate hardware control logic
Define configuration parameters with defaults
Provide methods for interacting with hardware
Support lazy loading of hardware-specific dependencies
API Server#
The API server:
Exposes driver methods via HTTP endpoints
Provides authentication and authorization
Manages a task queue for asynchronous operations
Offers a web UI for monitoring and control
Dependency Management#
AFL-automation uses a modular dependency system:
Core dependencies are always installed
Hardware-specific dependencies are optional
Lazy loading ensures code works even without all dependencies
The extras system makes installation straightforward
For details on managing dependencies, see Managing Dependencies.