Skip to main content

2024-2025 · System design, backend, security and integrations

Device provisioning platform

Registering and configuring hardware devices in batches

A hardware manufacturer needed a system for registering and provisioning its devices in batches. For every device the workflow had to create an application record, an identity and a VPN configuration, which setup automation on the device then picked up.

Problem

Doing that by hand doesn’t scale to batches. Each device also had to be consistent across the admin application, Authentik and the VPN configuration, without every system keeping its own copy of the device’s state.

Result

Every piece of device state has one system that owns it. The largest batch processed, in the test environment, was in the hundreds of devices. The system never ran in production with real devices, I don’t have before-and-after measurements, and my part ended in May 2025.

Decisions and implementation

  • Built the central application in Laravel 11 with PostgreSQL and Redis queues. Laravel Horizon shows how provisioning jobs are progressing and which ones failed.
  • Added registration for single serial numbers and ranges (for example E000001-E000230), also mixed in one comma-separated list. The application deduplicates the input into one list that an administrator approves.
  • Gave each piece of state one owner: Laravel holds the device record and authorisation rules, Authentik handles identity and access, wg-portal and the generated WireGuard configuration cover VPN, and Nginx Proxy Manager covers the proxy layer. No component keeps its own copy of the device state.
  • Restricted access to the admin panel and services through Authentik, and limited the provisioning endpoint with middleware.
  • Exposed a REST API as the only interface for device-side automation. Bash scripts on the device fetch their configuration through it and apply it.
  • Designed the provisioning pipeline so a failed step is retried and, if it keeps failing, the steps already completed are undone, including in the external services. A failed undo showed up in the queue, but it had no retry or audit trail of its own, which is the part I would build differently today.
  • Delivered the system with Docker Compose and agreed the technical requirements with the manufacturer.

Technologies used

  • PHP
  • Laravel 11
  • PostgreSQL
  • Redis
  • REST API
  • WireGuard
  • Authentik
  • Docker Compose
  • Bash
  • Laravel Horizon

Notes from this project

Technical notes related to this project:

Related work history: experience.

If you have a similar problem in your own system, write to me through the contact page.

See also: Freelance Laravel backend development

All case studiesNext case study: zeskanuj.com