Customization Guide
Renaming the Project
Replace all app- prefixes with your project name. For a project named acme:
- Rename directories:
app-core→acme-core,app-api→acme-api, etc. - Update
Cargo.tomlnames and path references in all crates - Update
usestatements:app_core→acme_core, etc. - Update workspace
Cargo.tomlmembers if you changed the directory structure
Replacing the Domain
The scaffold uses an Item/Inventory domain. To replace it:
app-core/src/domain/mod.rs— ReplaceItem,ItemIdwith your domain typesapp-core/src/error.rs— ReplaceItemErrorvariants with your domain errorsapp-core/src/ports/mod.rs— ReplaceItemRepositorywith your domain trait(s)app-core/src/dto.rs— Replace request/response typesapp-api/src/types.rs— Update API types (addJsonSchemaderive)app-api/src/endpoints.rs— Rewrite therest_service!macro with your endpointsapp-service/src/handlers.rs— Implement the new generated traitapp-adapters/src/in_memory.rs— Implement the new trait (or replace with a real adapter)app-testutils/src/fakes.rs— Write fakes for your new traitsapp-testutils/src/builders.rs— Write builders for your new domain types
Adding a Real Database
Replace InMemoryItemRepository with a Diesel + SQLite adapter:
- Add
dieselanddiesel_migrationsto workspace deps - Create a
SqliteItemRepositoryinapp-adapters(see rust-architecture skill's trait-patterns reference) - Wrap
SqliteConnectioninMutexforSend + Sync - Update
app-service/main.rsto create the connection and wire the new adapter
Customizing Authentication
The scaffold already includes real JWT auth via SessionService + LocalUserProvider + JwtAuthProvider. To customize:
- Add users — call
local_provider.add_user()inmain.rs, or replaceLocalUserProviderwith a database-backed provider - Per-user permissions — replace
StaticPermissionswith a customUserPermissionsimpl that looks up permissions per user - OAuth2 — add
ras-identity-oauth2and register anOAuth2Provideralongside (or instead of) the local provider - Session config — adjust
SessionConfiginmain.rs(JWT secret, TTL, algorithm)
Adding Observability
- Add
ras-observability-otelto workspace deps - Use
standard_setup()and wirewith_usage_tracker/with_method_duration_trackeron the builder (see ras-best-practices skill) - Add a
/metricsendpoint
Adding More API Crates
For JSON-RPC or WebSocket APIs alongside REST:
- Create a new
app-rpc-apicrate withjsonrpc_service!orjsonrpc_bidirectional_service! - Add it to the workspace
- Merge its router into the main app (see ras-api-design skill)
Splitting the Frontend
For a Tauri desktop app instead of (or alongside) the web app:
- See the dwind-tauri skill for the separate frontend/backend workspace pattern
- Use Trunk instead of Rollup for the WASM build
- Add IPC bridge via
window.__TAURI__bindings