Getting Started
Prerequisites
- PHP 8.4 or higher
- Composer 2.x
- MySQL 8.0+
- Symfony CLI (optional, for local dev server)
Installation
# 1. Clone the repository
git clone <repository-url>
cd atraxion-middleware
# 2. Install PHP dependencies
composer install
# 3. Configure environment
cp .env .env.local
# Edit .env.local with your settings (see Configuration section)
# 4. Create the database
php -d variables_order=EGPCS bin/console doctrine:database:create
# 5. Run migrations
php -d variables_order=EGPCS bin/console doctrine:migrations:migrate
# 6. (Optional) Load test fixtures
php -d variables_order=EGPCS bin/console doctrine:fixtures:load
# 7. Create an admin user
php -d variables_order=EGPCS bin/console app:user:create
php -d variables_order=EGPCS bin/console app:user:verify <email>
php -d variables_order=EGPCS bin/console app:user:promote <email> ROLE_ADMIN
Note
The -d variables_order=EGPCS flag is required for Symfony console commands to properly read environment variables.
Running the Application
# Option 1: Symfony CLI (recommended for development)
symfony server:start
# Option 2: PHP built-in server
php -S localhost:8000 -t public
Running the Message Queue Worker
The application uses Symfony Messenger for async processing. Start the workers:
# Process outbound sync queue (Middleware -> Odoo)
php -d variables_order=EGPCS bin/console messenger:consume async --limit=10
# Process webhook delivery queue
php -d variables_order=EGPCS bin/console messenger:consume webhook --limit=10
# Process both queues simultaneously
php -d variables_order=EGPCS bin/console messenger:consume async webhook --limit=10
In production, use a process manager like Supervisor to keep workers running.
Configuration
Environment Variables
Configure these in .env.local (never commit this file):
| Variable | Description | Default |
|---|---|---|
APP_ENV |
Environment (dev, prod, test) |
dev |
APP_SECRET |
Secret key for CSRF, encryption, etc. | (empty, must set) |
APP_NAME |
Application display name | My App |
APP_SHARE_DIR |
Shared file storage directory | var/share |
DATABASE_URL |
MySQL connection string | mysql://app:!ChangeMe!@127.0.0.1:3306/app |
MAILER_DSN |
Email transport DSN | null://null |
MAIL_FROM |
Sender email address | noreply@example.com |
MESSENGER_TRANSPORT_DSN |
Message queue transport | doctrine://default?auto_setup=0 |
ODOO_URL |
Odoo instance URL | https://your-odoo-instance.com |
ODOO_DATABASE |
Odoo database name | your_database |
ODOO_USERNAME |
Odoo API username | api_user |
ODOO_PASSWORD |
Odoo API password | api_password |
OUTBOUND_MAX_ATTEMPTS |
Max retry attempts for outbound sync | 3 |
Database
The application defaults to MySQL 8.0. PostgreSQL is also supported (change DATABASE_URL accordingly). Doctrine uses attribute-based mapping with an underscore naming strategy.
Mailer
Defaults to a null transport (no emails sent). For production, configure a real transport: