DevDesk: Symfony 7.4 Helpdesk with a State Machine and SLA Tracking

A helpdesk where customers open tickets, agents work them and admins oversee everything. Built as a production-minded Symfony reference: real access control, a workflow state machine, SLA tracking, a token API, background jobs, static analysis, CI and a hardened container image.

Open sourceSymfony 7.4
Illustration of the DevDesk project
Symfony 7.4
PHP 8.4, Doctrine, PostgreSQL
State machine
ticket lifecycle and SLA clock
PHPStan 8
strict static analysis in CI
30+ tests
PHPUnit unit and functional

The challenge

A helpdesk looks like CRUD until the rules arrive: customers must only see their own tickets, agents only the ones assigned to them or still unassigned, a ticket must not jump from closed to in-progress, and a missed response deadline should alert someone exactly once.

I wanted to show those rules done properly in Symfony, in a project another engineer can run in one command and read in an afternoon.

How I approached it

  1. 01

    Ticket status as a Symfony state machine

    The lifecycle is open, in_progress, resolved, closed with a reopen transition. Invalid moves are rejected in one place, and customers can only close or reopen their own tickets.

  2. 02

    Access control in a Voter

    TicketVoter holds the per-ticket rules for customers, agents and admins. Controllers stay thin and ask the voter. Sign-in has CSRF protection, login throttling, email verification and a role hierarchy.

  3. 03

    An SLA clock that notifies once

    Each priority has a first-response deadline and the first public agent reply stops the clock. A console command, or a protected cron endpoint for serverless hosting, finds breaches and flags each ticket <em>before</em> dispatching the notification, so a failure can never cause an alert loop.

  4. 04

    A token API with validation and rate limits

    Hashed API tokens (SHA-256, shown once), request DTOs validated with #[MapRequestPayload], an explicit response shape, per-user rate limiting and an OpenAPI spec in the repository.

  5. 05

    Async email through Messenger

    Notifications go through Symfony Messenger on a Doctrine transport with retries and a failure transport, so a request never waits on a mail server.

  6. 06

    Operations treated as part of the product

    A /health endpoint, structured JSON logs, env-driven config, a multi-stage non-root Dockerfile on FrankenPHP with opcache and a healthcheck, and database-backed sessions so it runs on stateless hosting.

Deliberate trade-offs

  • The live demo uses a demo database with shared accounts, so it is meant for exploring, not for real data.
  • Sessions are stored in the database so the app can run on stateless hosting. A dedicated cache or Redis store would be the next step at higher traffic.

What I built

  • Modelled users, tickets and comments with backed enums for status and priority, migrations, fixtures and indexed queries.
  • Implemented the state machine, the voter, the SLA checker and the Messenger handlers.
  • Built the token-authenticated REST API with DTO validation, rate limiting and an OpenAPI spec.
  • Added security headers including a strict CSP, a health endpoint and JSON logging for production.
  • Wrote PHPUnit tests with the database rolled back per test, and set up PHPStan level 8, PHP-CS-Fixer, composer audit and CI.
  • Deployed a live demo to Vercel with a Neon PostgreSQL database and documented the architecture and deployment steps.
Personal showcase project with demo data, not client work. Source, Docker setup and architecture notes are in the public repository.

What this project demonstrates

  • Symfony architecture: workflow, voters, Messenger and Doctrine used the way the framework intends
  • Access control and security treated as design, not afterthought
  • Static analysis, tests and CI as a baseline
  • Shipping something runnable: Docker, a live demo and documentation

Related case studies

Laravel 12 / MySQL 8 / Redis / REST APIOpen Source

FinCore: Wallet & Double-Entry Ledger API

A versioned REST API for digital wallets where every credit, debit, transfer and reversal produces balanced ledger entries and a full audit trail. Built to show how money-handling code should behave when requests are retried, concurrent or malicious.

Have a project like this in mind?

Tell me what you're building. I'll reply by email with questions or a suggested approach.