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 devices in batches. For every unit, the workflow had to create an application record, an identity account, and a VPN configuration that setup scripts on the device could pull.
Problem
Configuring devices manually across three separate panels breaks down once you deal with batches. Every unit also had to stay consistent across the admin app, Authentik, and the VPN layer without each tool keeping its own copy of device state.
Outcome
The workflow replaced manual setup across three panels with a single pipeline where every piece of device state has one owner. It processed batches of hundreds of devices in testing; the client ultimately chose not to roll it out to production, and my involvement ended in May 2025.
Decisions and implementation
- Built the central application in Laravel 11 with PostgreSQL and Redis queues, using Laravel Horizon to track job progress and spot failures.
- Added batch registration supporting individual serial numbers and ranges (such as E000001-E000230), including mixed comma-separated lists. Input is deduplicated into a single list for an administrator to approve.
- Split state ownership so every piece has one source of truth: Laravel holds device records and workflow logic, Authentik handles identity and access, wg-portal and generated WireGuard configs cover VPN, and Nginx Proxy Manager handles the proxy layer.
- Locked down access to the admin panel and supporting services through Authentik, and restricted the provisioning endpoint with middleware.
- Exposed a single REST API for device-side automation. Bash scripts on the hardware fetch their generated configuration from it and apply it locally.
- Built retries for failed HTTP steps and compensating rollbacks when an error persisted, including undoing changes in external services. Failed rollbacks surfaced in the queue, though they didn’t have their own retry loop or audit log, which is something I would include from the start today.
- Packaged the stack with Docker Compose and coordinated the technical requirements directly with the manufacturer.
Stack
- PHP
- Laravel 11
- PostgreSQL
- Redis
- REST API
- WireGuard
- Authentik
- Docker Compose
- Bash
- Laravel Horizon
Related notes
Technical notes written from this project:
Related areas
Technology areas involved in this project:
Broader work history: experience.
Dealing with a similar problem in your own system? Reach out via the contact page.
Related service: Freelance Laravel backend development