Magnemite
Development

Running it locally

Postgres in Docker, the hub and the dashboard on your machine.

pnpm install
docker compose up -d postgres
pnpm --filter @magnemite/db exec dotenv -e ../../.env -- prisma migrate dev
pnpm db:seed

pnpm --filter @magnemite/hub dev     # :3001
pnpm --filter @magnemite/web dev     # :3000
pnpm --filter @magnemite/docs dev    # :3002 — this site

pnpm 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:3001

With no Caddy in front, the hub serves /files/* itself and stands in for it. DATABASE_URL points at the host-mapped 127.0.0.1:5433, which is the port compose publishes Postgres on for exactly this.

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

CommandDoes
pnpm db:generateRegenerate the Prisma client
pnpm db:migrateCreate and apply a migration (development)
pnpm db:deployApply pending migrations (production)
pnpm db:pushPush the schema without a migration
pnpm db:studioPrisma Studio
pnpm db:seedAdmin, app target, 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/

On this page