XCloak / docs

Development Setup

This is for working on XCloak itself, not just running it — local dev setup for the backend and frontend, plus where contributions are most useful.

Backend

cd xcloak-platform/backend
cp .env.example .env
# edit .env — DB credentials, JWT_SECRET, METRICS_TOKEN, SMTP settings

# migrations run automatically on startup (golang-migrate)
air   # hot reload

Frontend

cd xcloak-platform/frontend
npm install
npm run dev

Observability stack (optional, for local testing)

docker compose up -d

Running tests

The backend has 416+ Go test functions covering auth, middleware, Sigma rule parsing, and select detectors. Run the full suite from xcloak-platform/backend:

go test ./...
Test coverage is uneven across the 23 behavioral detectors — most don't have dedicated test files yet. This is one of the highest-value places to contribute: even coarse table-driven tests (known-benign input → no alert, known-malicious input → alert) materially de-risk future changes.

Where contributions help most

  • Detector test coverage (see above)
  • Additional Sigma rules for the seeded library
  • Kubernetes NetworkPolicy manifests for the Helm chart
  • Documentation — including this site

Code style

No ORM in the backend — write explicit, parameterized SQL in the repository layer, matching the existing pattern. Keep services free of direct HTTP concerns (those belong in the api layer) and free of direct SQL (that belongs in repositories).

Reporting issues

Open an issue on GitHub Issues for bugs and feature requests. For general questions, deployment help, or showing off what you've built, use GitHub Discussions instead.