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
- 01
Ticket status as a Symfony state machine
The lifecycle is
open,in_progress,resolved,closedwith areopentransition. Invalid moves are rejected in one place, and customers can only close or reopen their own tickets. - 02
Access control in a Voter
TicketVoterholds 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. - 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.
- 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. - 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.
- 06
Operations treated as part of the product
A
/healthendpoint, 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.
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