Ga naar inhoud

Technisch overzicht

De Atraxion-webshop is een custom PHP 8.2-monoliet zonder framework-fundament, opgesplitst in een aantal deelapplicaties binnen één repository. De architectuur is beschreven in Technisch: Tech stack en Repository-structuur.


Deelapplicaties

Deelapplicatie Pad Rol
Storefront _www/ + _core/ Publieke webroot; _www/index.php is de front controller; _core/ bevat de MVC-kern (router, controllers, models, views, traits).
Interne AJAX-API _www/api.php Verwerkt AJAX-requests vanuit de storefront (stuurt JSON terug); vereist _f-parameter.
EDI/externe API _api/index.php Slim 4-app voor externe koppelingen (EDI-orders, asset-API); bootstrapt via dezelfde _www/appconfig/bootstrap.php.
Legacy backoffice _admin/ Code-module (controllers, models, views) voor beheerders; geen eigen entry pointmanage.atraxion.com mapt via Apache (docker/apache/vhosts.conf) naar DocumentRoot _www/, zodat de gedeelde front-controller _www/index.php ook admin-verkeer afhandelt en naar de _admin/-controllers dispatcht. Raadpleegt dezelfde databases als de storefront.
Admin control panel _cp/ Aparte Slim 4-app (_cp/index.php) op admin.atraxion.com (Apache-vhost mapt admin.* naar DocumentRoot _cp/). Bootstrapt via dezelfde _www/appconfig/bootstrap.php. Controllers in src/Atraxion/Admin/Controller/; Twig-templates in templates/admin/.
CLI cli.php Symfony Console-entrypoint; haalt de Application-instantie op via ServiceRegistry (cli.php:38).
Cron-scripts _shopupdating/cronjobs/ Batch PHP-scripts gegroepeerd per categorie (atx/{articles,customers,dwh,amazon,suppliers,system,logs,job,vehicles,orders} + system/); draaien direct via PHP of als Symfony Console-command.
Integratie-clients src/ PSR-0-geautoloade clients voor externe systemen (Amazon, Arteel, Autodoc, Cloudflare, Evox, Facebook, Matomo, Maxityre, Odoo, Qweon, Rhinoman, Transsmart, Tyre24, VirusTotal, Wheelpope) en de eigen modules onder src/Atraxion/.

Kernbibliotheken

  • Routing: Slim 4 (slim/slim) in de storefront-router (_core/config/router.php), de externe API (_api/index.php) en het admin control panel (_cp/index.php). De legacy backoffice (_admin/) gebruikt géén Slim.
  • DI / Service-locator: League Container via atx\system\ServiceRegistry.
  • ORM: Doctrine ORM 3 + DBAL 4 + Migrations 3, naast een legacy DAO-laag (atx\...DAO).
  • Console: Symfony Console 7 (commands in _admin/model/classes/atx/cli/commands/ en src/Atraxion/*/Command/).
  • Templating: Twig 3 voor backoffice; legacy PHP-views (_core/view/) voor de storefront.
  • HTTP-client: Guzzle 7.
  • PDF-generatie: mPDF.
  • E-mail: PHPMailer 7.
  • 2FA: pragmarx/google2fa.
  • Caching: Symfony Cache 7 met Memcached-adapter (MEMCACHED_DSN = 'memcached://localhost:11211', src/functions.php:969).
  • Observability: Sentry PHP SDK 4 (geïnitialiseerd in _www/appconfig/bootstrap.php:13); Matomo PHP Tracker.

Databases

De shop gebruikt meerdere MySQL-databases tegelijk:

Database Inhoud / rol
atx_www Hoofddatabase: artikelen, bestellingen, klanten, channels, prijzen, EDI, RMA, etc.
atx_3d 3D-productafbeeldingen en gerelateerde metadata.
atx_dwh Data warehouse; rapportage en historische data.
atx_log Applicatielog (tabel LogUpdate; geschreven via atx\logs\LogUpdateDAO).
atx_queue Job-queue voor asynchrone verwerking (atx\job\Queue).
channel Channelconfiguratie: de hoofdshop, klant-mini-shops (type WEB) en platform-channels (type PLATFORM) — domein, type, ChannelGroup, ExportId, etc.
cms_text CMS-content en vertalingen; opgeroepen via trans('key', 'namespace').
customer Klantgegevens (naam, adres, BTW-nummer, klantcategorie).
customer_user Inlogaccounts van klanten (e-mail, wachtwoord, 2FA-data).
customer_category Klantcategorieën (CustomerCat, codes A/B/D1/D2).
language Taalconfiguratie (NL/FR/EN/DE).
setting Applicatie-instellingen per channel of globaal.
vehicle_* Voertuigdata (merken, modellen, generaties, bodytypes); gevuld via DriveRight-updater.

Databasenamen zijn als constanten vastgelegd in _www/appconfig/constants.php:71-74 (APP_DB_WWW, APP_DB_LOG, APP_DB_QUEUE, APP_DB_DWH). De andere databases worden rechtstreeks op naam aangesproken.


Queue

De atx_queue-database bevat de job-queue voor asynchrone taken (o.a. Odoo-synchronisatie, orderverwerking). De entiteit atx\job\Queue (_core/model/classes/atx/job/Queue.php) definieert richtingen (IN/OUT) en statussen (nieuw, verwerkt, fout, wachten op ERP, etc.). Workers worden aangestuurd via CLI-commands of cron-scripts.


Externe koppelingen

De shop communiceert met een reeks externe systemen. De clients staan in src/:

Systeem Protocol Rol
Odoo ERP XML-RPC (via ERP-middleware REST) Klant-/ordersync, facturatie, prijsinformatie.
Pay.nl REST Betalingen.
Transsmart REST Transportprijzen en zendingen.
DriveRight REST/HTTP Voertuigdata en fitment.
Tyre24 / Autodoc / Amazon FTP + EDI / SP-API Platformexport en orderimport.
Arteel REST + OAuth 2 Loyaliteitspuntenprogramma.
Cloudflare REST CDN-beheer.
Matomo HTTP Tracker Web-analytics.
Sentry SDK Foutrapportage en performance-tracing.
VirusTotal REST Virusscan van orderdocumenten.

Systeemcontext-diagram

graph TD
    Klant["Klant (browser)"]
    Beheerder["Beheerder (browser — manage.*)"]
    BeheerderCP["Beheerder (browser — admin.*)"]
    EDIClient["EDI-klant (XML)"]

    subgraph Webshop
        Front["_www / _core\n(Storefront + AJAX-API\n+ front-controller voor manage.*)"]
        Admin["_admin\n(Legacy backoffice-module:\ncontrollers / models / views)"]
        CP["_cp/\n(Admin control panel — Slim 4\nadmin.atraxion.com)"]
        API["_api\n(EDI / externe API)"]
        CLI["cli.php\n(Symfony Console)"]
        Cron["_shopupdating/cronjobs\n(Batch-scripts)"]
    end

    subgraph Databases["MySQL-databases"]
        DBwww[("atx_www")]
        DBchannel[("channel")]
        DBcustomer[("customer / customer_user")]
        DBvehicle[("vehicle_*")]
        DBqueue[("atx_queue")]
        DBlog[("atx_log")]
        DBcms[("cms_text")]
        DBother[("atx_3d / atx_dwh\ncustomer_category\nlanguage / setting")]
    end

    MC[("Memcached")]

    Odoo["Odoo ERP\n(via middleware REST)"]
    PayNL["Pay.nl\n(REST)"]
    Transsmart["Transsmart\n(REST)"]
    DriveRight["DriveRight\n(REST)"]
    Platforms["Tyre24 / Autodoc / Amazon\n(FTP / SP-API / EDI)"]
    Suppliers["Leveranciers\n(FTP/CSV/XML)"]
    Arteel["Arteel\n(REST/OAuth2)"]
    Sentry["Sentry"]
    Matomo["Matomo"]

    Klant --> Front
    Beheerder --> Front
    BeheerderCP --> CP
    EDIClient --> API
    Front --> Admin

    Front --> DBwww
    Front --> DBchannel
    Front --> DBcustomer
    Front --> DBvehicle
    Front --> DBcms
    Front --> DBother
    Admin --> DBwww
    Admin --> DBchannel
    Admin --> DBcustomer
    CP --> DBwww
    CP --> DBchannel
    CP --> DBcustomer
    API --> DBwww
    CLI --> DBwww
    CLI --> DBqueue
    Cron --> DBwww
    Cron --> DBqueue
    Cron --> DBlog

    Front --> MC
    Admin --> MC
    CP --> MC
    CLI --> MC

    Front --> Odoo
    Front --> PayNL
    Front --> Transsmart
    Front --> Arteel
    Admin --> Odoo
    CLI --> Odoo
    Cron --> Odoo

    Cron --> Suppliers
    Cron --> Platforms
    Platforms --> Cron

    Front --> DriveRight
    Cron --> DriveRight

    Front --> Sentry
    Admin --> Sentry
    CLI --> Sentry
    Front --> Matomo

Meer detail