Seven layers, clear boundaries

I followed the same principles in the logistics platform and in Ders Alanı: each layer has one responsibility, access is checked as close to the resource as possible, and risky work is kept out of the main application.

The path of one request: it travels down layer by layer to the infrastructure, authorisation is checked just before the business rules, and the response returns the same way.
1 User interface 2 Application layer 3 Authorisation 4 Business logic 5 API integration 6 Database 7 Infrastructure request response access check
  1. User interface

    Screens where each role sees only its own work: a PWA on the driver’s phone, bulk-action workspaces in the office. The interface is never the only gatekeeper of access.

    The driver app scans barcodes with the camera; the customer portal lists only that customer’s shipments.

  2. Application layer

    Thin endpoints that receive requests. They validate input, check the session and CSRF protection, and hand the work to the business layer.

    Screens and API endpoints stay thin; rules live in dedicated services.

  3. Authorisation

    Authentication does not replace authorisation. Access is granted per resource, weighing role, company or institution, and object ownership together.

    In Ders Alanı, access to a class and access to its recording are checked separately.

  4. Business logic

    Status transitions, calculations and constraints live in one place. A rule is written for the business, not for a screen, so the same calculation gives the same answer everywhere.

    Shipment status transitions are rule-based and reversible; report card scores are computed only on the server.

  5. API integration

    Code that talks to external systems is kept apart from the main application. Long-running or risky work, such as browser automation and messaging, runs in its own services with short-lived signed tokens.

    Vehicle tracking, routing, WhatsApp and accounting bridges are separate processes.

  6. Database

    A relational model, versioned migrations and an explicit strategy for concurrent writes. History is never deleted; who changed what, and when, is always known.

    Ders Alanı uses revision-based optimistic concurrency; a stale writer is rejected.

  7. Infrastructure

    Linux servers, Nginx, version-locked deployment, metrics, alerting rules, and backups whose restore is actually rehearsed. Infrastructure details are never published.

    Restore-from-backup and rollback procedures are written down and actually tested.

In practice