# Development Guide This guide covers the usual path for adding or changing a Forge module. ## Local Checks Before running storage-backed workflows locally, complete [SurrealDB Setup](/getting-started/surrealdb-setup). Run these before pushing Rust or extension changes: ```powershell cargo fmt --check cargo check cargo test cargo build cargo clippy --all-targets --all-features -- -D warnings ``` Run this after changing browser UI sources: ```powershell npm run build:webui ``` Build Arma packages with: ```powershell .\build-arma.ps1 ``` ## Module Boundaries Keep each layer responsible for one kind of work:
| Layer | Owns | Avoid |
|---|---|---|
lib/models
|
Data structures, serde defaults, validation helpers. | Database calls, SQF-specific context. |
lib/repositories
|
Repository traits and in-memory stores. | SurrealDB-specific code. |
lib/services
|
Business rules, workflow orchestration, structured results. | Arma engine calls, extension transport details. |
arma/server/extension
|
Command parsing, context resolution, SurrealDB implementations, serialization to SQF. | Business rules that belong in services. |
arma/server/addons
|
Server SQF lifecycle, game-object integration, calls into
forge_server
.
|
Direct database logic. |
arma/client/addons
|
Client UI, keybinds, local UI events. | Authoritative persistence. |