Getting started
This guide sets up a local development environment. For a production deployment, see Operations.
Prerequisites
Section titled “Prerequisites”- Docker & Docker Compose
- PHP 8.4+ and Composer (backend)
- Node.js 22+ and pnpm (mobile app, locker client, website)
- just (task runner, optional but recommended)
Clone the repository
Section titled “Clone the repository”git clone https://github.com/Open-Locker/Open-Locker.gitcd Open-LockerBackend
Section titled “Backend”cp locker-backend/.env.example locker-backend/.envConfigure at least the following in locker-backend/.env:
APP_URL— the backend’s URLDB_PASSWORD— database passwordMOSQ_HTTP_PASS— shared secret for MQTT broker ↔ backend authentication
Generate the MQTT broker configuration and start the stack:
just setup-mqtt # generates mosquitto.conf from the template
cd locker-backenddocker compose up -d # Postgres, Mosquitto, Redis, appdocker compose exec app php artisan migrate --seedSet ADMIN_EMAIL before the first start, or create the first administrator
explicitly:
docker compose exec app php artisan first-admin:create admin@example.comThe administrator sets their password through “forgot password”, so mail
delivery must work. The admin panel is then available at <APP_URL>/admin.
The primary dev loop runs via Composer:
composer dev # server + queue + logs + Vite concurrentlycomposer test # testscomposer quality # format check + static analysis + testsMobile app
Section titled “Mobile app”cd mobile-appcp .env.example .envpnpm installSet EXPO_PUBLIC_API_BASE_URL in .env to the running backend, including
/api. Realtime uses EXPO_PUBLIC_REVERB_KEY,
EXPO_PUBLIC_REVERB_PORT, and EXPO_PUBLIC_REVERB_SCHEME;
EXPO_PUBLIC_REVERB_HOST is optional when the API and Reverb hosts match.
pnpm start targets an installed Expo development client; build one with
pnpm android or pnpm ios. Use pnpm start:go for the more limited
Expo Go workflow.
The API client is generated from the running backend’s live OpenAPI
specification at /docs/api.json. After changing the API contract:
pnpm generate:api # backend must be runningBefore pushing: pnpm check (typecheck + lint + format + expo-doctor).
Locker client
Section titled “Locker client”cd locker-clientpnpm installpnpm dev # runs the client locallyThe client needs a config/locker-config.yml and a .env with a
PROVISIONING_TOKEN. Hardware details are listed in the
Bill of Materials.
Website
Section titled “Website”cd websitepnpm installpnpm dev # http://localhost:4321