Documentation

Self-hosting

Loxley has two parts:

  • frontend/ — Next.js. Serves the interface and proxies /api, /preview and /p to the backend so everything is one origin.
  • backend/ — Go. Authentication, projects, the AI agent, usage tracking and hosting of published sites. Data lives in SQLite.

Environment

Backend (backend/.env):

VariablePurpose
PUBLIC_URLThe public origin, e.g. https://studio.example.com. Used for share links and OAuth redirects.
APP_SECRET32+ random characters. Encrypts the stored API key and signs preview links. Keep it stable.
ADDRListen address (default :8080).
DATA_DIRWhere the database lives (default ./data).
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRETEnables GitHub sign-in.
ANTHROPIC_API_KEYThe Claude API key used by the server.

Frontend: BACKEND_URL (default http://localhost:8080).

OAuth redirect URLs

Register this callback with GitHub:

https://studio.example.com/api/auth/oauth/github/callback

Running

cd backend && go run ./cmd/server
cd frontend && npm install && npm run dev

For production, build the Go binary, run npm run build && npm start, and put both behind HTTPS with your domain pointing at the Next.js server.