Architecture
Overview of the ITeas Tools Integration Platform architecture.
System Architecture
┌─────────────────────────────────────────────────────────────┐
│ Web Application │
│ (Yii2 Framework) │
├─────────────────────────────────────────────────────────────┤
│ Controllers │ Modules │ API Components │ Widgets │
├─────────────────────────────────────────────────────────────┤
│ Core Components │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │Autotask │ │ Graph │ │ Jamf │ │YouTrack │ │
│ │ Client │ │ Client │ │ Client │ │ Client │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
├─────────────────────────────────────────────────────────────┤
│ External Services │
│ Autotask │ MS Graph │ Jamf │ YouTrack │ AutoDNS │ etc. │
└─────────────────────────────────────────────────────────────┘Configuration System
The application uses a custom environment-based configuration loader:
iteas\envLoader\Configurator- Loads config from environment variables or files- Supports
_FILEsuffix for reading secrets from files (Docker secrets pattern) - Configuration split across multiple files in
src/config/
Module System
The application is organized into Yii2 modules:
| Module | Purpose |
|---|---|
rest | RESTful API endpoints |
webhook | Webhook handlers for external services |
mailManager | Mailgun email management |
picking | Warehouse picking/inventory (with nested REST API) |
schoolTool | School management tools |
ytSync | YouTrack synchronization |
auditlog | Audit logging (iteas package) |
cron | Background job scheduling (iteas package) |
Each module:
- Has its own namespace and directory in
src/modules/ - Can have its own migrations
- Can have nested submodules (e.g., picking/rest)
- Is registered in
src/config/modules.php
API Components
Core components are singleton services registered in the application:
API Clients:
php
Yii::$app->autotask // Autotask PSA integration
Yii::$app->microsoftGraph // Microsoft Graph API
Yii::$app->youtrack // YouTrack API
Yii::$app->jamf // Jamf device management
Yii::$app->autoDNS // Domain/DNS management
Yii::$app->froxlorClient // Hosting panel API
Yii::$app->mailgunApi // Email service APIBusiness Components:
php
Yii::$app->Bmd // BMD accounting integration
Yii::$app->sharepointSettings // SharePoint configuration
Yii::$app->settings // Application settingsAll API clients are configured via environment variables and initialized as application components.
Database Schema
The application uses multiple database migrations from:
- Main application (
@app/migrations) - RBAC system (
@yii/rbac/migrations) - Background jobs (
@iteas/cron/migrations) - Module-specific migrations (mailManager, picking, schoolTool, ytSync, auditlog)
Authentication & Authorization
- Authentication: Azure AD OAuth via
chunlaw/yii2-azure-authclient - Authorization: RBAC using
yii\rbac\DbManager - User Model:
app\models\User(implementsIdentityInterface)
Request Flow
Web Request
User Request → index.php → web.php config → Route → Controller → ViewConsole Command
CLI → yii script → console.php config → Command Controller → ActionREST API Request
API Request → index.php → rest module → REST Controller → JSON ResponseDirectory Structure Philosophy
- Separation of Concerns - Models, Views, Controllers separated
- Module Isolation - Features grouped in self-contained modules
- Shared Components - Common code in
components/andcore/ - Domain Models - External API models in subdirectories (autotask/, jamf/, yt/)
See Development for detailed directory structure.
