Self-hosting
Loxley has two parts:
- frontend/ — Next.js. Serves the interface and proxies
/api,/previewand/pto 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):
| Variable | Purpose |
|---|---|
PUBLIC_URL | The public origin, e.g. https://studio.example.com. Used for share links and OAuth redirects. |
APP_SECRET | 32+ random characters. Encrypts the stored API key and signs preview links. Keep it stable. |
ADDR | Listen address (default :8080). |
DATA_DIR | Where the database lives (default ./data). |
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET | Enables GitHub sign-in. |
ANTHROPIC_API_KEY | The 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.