The single source of truth for how code is written, designed, and structured across the
LeiCraftMC ecosystem — git.leicraftmc.de/LeiCraftMC & github.com/LeiCraftMC — and all of
its subprojects: LeiOS, Delivr, NowIP, NetIgnite, Vault, MindCode, the
LeiCraftMC sites, and everything that comes after.
This repo is for two audiences:
- Humans — read
docs/in order to learn the house style before contributing. - AI coding tools — read
AGENTS.md(orCLAUDE.mdfor Claude Code) first, then the relevantdocs/pages. Copy fromshared/and scaffold fromtemplates/instead of inventing patterns.
Everything here is derived from how the ecosystem already writes code (14 reference repos were audited), then makes opinionated calls to close the gaps where practice diverged.
| Layer | Choice |
|---|---|
| Runtime & package manager | Bun (also the test runner; server Nuxt apps build with the Nitro bun preset) |
| Language | TypeScript, ESM, "private": true, strict |
| Formatter & linter | Biome (org standard — see docs/02-tooling.md) |
| Backend | Hono + Zod + hono-openapi (Scalar UI) + Drizzle (SQLite) |
| Frontend | Nuxt 4 (app/ dir) + NuxtUI v4 + Tailwind v4 (CSS-first) |
| CLI tooling | @cleverjs/cli + bun build --compile |
| API contract | OpenAPI generated at runtime → @hey-api/openapi-ts typed client |
| Response shape | { success, code, message, data } envelope, end-to-end |
| CI | GitLab CI (oven/bun) in the templates; GitHub Actions workflows are opt-in from shared/config/github-actions/; Renovate everywhere |
| License | AGPL-3.0 (every template ships a LICENSE) |
| Commits | Conventional Commits |
Style-Guides/
├── README.md ← you are here
├── AGENTS.md ← read this first if you are an AI coding agent
├── CLAUDE.md ← Claude-Code-specific layer on top of AGENTS.md
├── docs/ ← the spec, one focused page per topic (00 → 17)
├── shared/ ← the templates' core files (logger, config, APIResponse, auth, useAPI, stores, CI, …), same paths
├── assets/ ← brand logos, icons, and design-system guidance
└── templates/ ← ready-to-use scaffolds — the source of truth (see below)
| Template | What it is | Default port |
|---|---|---|
backend-service |
Hono API service, compiled to one binary, Docker image | 12500 |
nuxt-app |
Nuxt frontend for a separate backend-service (landing, auth, dashboard, admin) | 12510 |
fullstack-nuxt-app |
nuxt-app + backend-service in one codebase (API under /api) |
12520 |
static-site |
Static Nuxt site (nuxt generate, rsync deploy) |
12530 |
static-site-with-docs |
static-site + @nuxt/content docs section |
12531 |
cli-tool |
@cleverjs/cli tool, released as binaries on v* tags |
— |
The templates are deliberately rich (cron jobs, background tasks, email, admin area, onboarding, …): delete what your project doesn't need.
Starting a new project — copy a template from templates/, then follow its
README.md: replace <ProjectName>, the APPPREFIX env prefix / appprefix token prefix, the
<PREFIX> session-cookie name (Nuxt), and give the app its own port (the defaults above, never
3000; see docs/02 — Ports).
In an existing project, pull the core files from shared/ — they sit at the same paths as
in the templates — rather than re-implementing them.
Contributing to an existing project — read the relevant docs/ pages first. When in
doubt, the existing codebase + this guide are the authority; generic internet advice is not.
As an AI agent — start at AGENTS.md.
Read top to bottom on first pass; jump to a page on demand.
- 00 — Overview — purpose, audience, the guiding principle
- 01 — Project structure — repo layout per project type
- 02 — Tooling — Bun, TypeScript, Biome, scripts, Renovate, MCP
- 03 — Naming & TypeScript style
- 04 — Backend (Hono) — app lifecycle, routes, OpenAPI, the envelope
- 05 — API contract — OpenAPI as the bridge, generated client
- 06 — Frontend (Nuxt) — Nuxt 4, NuxtUI v4, Tailwind v4
- 07 — State & data —
useAPI,AbstractStore, cookies - 08 — Database — Drizzle, the
DBclass, migrations - 09 — Config & logging —
ConfigSchema,Logger - 10 — Auth — opaque tokens,
AuthContext, middleware - 11 — CLI & infra —
@cleverjs/cli, compile, graceful shutdown - 12 — Testing —
bun:test, the preload harness, integration tests - 13 — Git & CI — Conventional Commits, GitLab/GitHub pipelines
- 14 — Deployment — compiled-binary Docker, Nuxt
.outputon Bun, static rsync - 15 — Design system — dark-first, palette, fonts, logos, status semantics
- 16 — AI tooling —
CLAUDE.md/AGENTS.md,.claude/settings.jsoncommands, MCP - 17 — Decisions & divergences — the opinionated calls and why
Four foundational standards were set for the org (rationale in
docs/17-decisions.md):
- Biome for formatting + linting (the ecosystem had no enforced formatter before).
- AGPL-3.0 as the default license for templates and services.
- Copy-paste snippets now, published
@leicraftmc/*package later for shared utilities. - Conventional Commits (
feat:/fix:/chore:…).
This guide is itself a LeiCraftMC project: it is formatted with Biome and type-checked with tsc.
Before committing, run bun install && bun run check:ci && bun run typecheck. The root Biome
config excludes templates/ and shared/config/: when you change a template, run its own
bun run check:ci, bun run typecheck and bun test inside it, and keep shared/ in sync with it.
A change that would break code copied from an earlier version keeps the old API as @deprecated
instead of removing it; only security fixes and bugs every project must fix anyway may break
directly (see docs/17-decisions.md #26).
The /verify, /typecheck, /format, and /test helper slash commands are defined in
.claude/settings.json (see docs/16).
AGPL-3.0. The shared utilities and templates inherit it by default; permissive licensing
for standalone libraries/tools is a case-by-case decision (see
docs/17-decisions.md).