Running it locally
Postgres in Docker, the hub and the dashboard on your machine.
pnpm install
# The stack ships no database, so bring one up however you like:
docker run -d --name magnemite-db -p 127.0.0.1:5433:5432 -e POSTGRES_USER=magnemite -e POSTGRES_PASSWORD=magnemite -e POSTGRES_DB=magnemite postgres:17-alpine
pnpm db:migrate
pnpm db:seed # optional: starter app target, sources, group, first token
pnpm --filter @magnemite/hub dev # :3001
pnpm --filter @magnemite/web dev # :3000
pnpm --filter @magnemite/docs dev # :3002 — this sitepnpm dev at the root runs every app in apps/* in parallel.
What the dev .env does differently
SERVE_ARTIFACTS=true
MAGNEMITE_PUBLIC_URL=http://localhost:3001With no Caddy in front, the hub serves /files/* itself and stands in for it.
DATABASE_URL points at whatever database you brought up.
For MariaDB instead, set DB_PROVIDER=mysql and a mysql:// DATABASE_URL
before running pnpm db:migrate — the two engines keep separate
migration histories, see Postgres or
MariaDB. Switching an
existing checkout also needs pnpm db:generate: the client is generated for one
provider, and it fails on the first query against the other.
Leave SERVE_ARTIFACTS off in either deployment. Both put Caddy in front of /files/*, and
turning it on there routes ~35 GB of a fleet-wide rollout through Node.
Database work
| Command | Does |
|---|---|
pnpm db:generate | Regenerate the Prisma client (pnpm install also does) |
pnpm db:migrate | Create and apply a migration (development), then regenerate |
pnpm db:deploy | Apply pending migrations (production) |
pnpm db:push | Push the schema without a migration |
pnpm db:studio | Prisma Studio |
pnpm db:seed | Optional: starter app target, sources, group, first enrollment token |
Checks
pnpm lint # prettier --check .
pnpm format # prettier --write .
make typecheck # hub and web
make agent-test # go vet ./... && go test ./...Building the agent
Everything Go-related runs inside the golang image, so no toolchain is needed
on the host:
make agent # four binaries into agent/bin
make module # the Magisk zip into dist/