image
Akan.js
Docs
DocsConventionsReferencesCheatsheet
English
image
Akan.js
Akan.js v2 docs are now available.View the v1 docs
DocsConventionsReferencesCheatsheet
Released under the MIT License
Official Akan.js Consulting onAkansoft
Copyright © 2026 Akan.js All rights reserved.
System managed bybassman
Workspace
• Structure
• Format & Lint
App & Library
• Assets (public/ private/)
• Components (ui/)
• Server Utils (srvkit/)
• Web Utils (webkit/)
• Common Utils (common/)
• akan.config.ts
Domain
• Overview
• model.abstract.md
• model.constant.ts
• model.dictionary.ts
• model.document.ts
• model.service.ts
• model.signal.ts
• model.store.ts
• Model.Template.tsx
• Model.Unit.tsx
• Model.Util.tsx
• Model.View.tsx
• Model.Zone.tsx
Scalar
• Overview
• scalar.abstract.md
• scalar.constant.ts
• scalar.dictionary.ts
• scalar.document.ts
• Scalar.Template.tsx
• Scalar.Unit.tsx
Service
• Overview
• service.abstract.md
• service.dictionary.ts
• service.service.ts
• service.signal.ts
• service.store.ts
• Service.Util.tsx
• Service.Zone.tsx
Workspace
• Structure
• Format & Lint
App & Library
• Assets (public/ private/)
• Components (ui/)
• Server Utils (srvkit/)
• Web Utils (webkit/)
• Common Utils (common/)
• akan.config.ts
Domain
• Overview
• model.abstract.md
• model.constant.ts
• model.dictionary.ts
• model.document.ts
• model.service.ts
• model.signal.ts
• model.store.ts
• Model.Template.tsx
• Model.Unit.tsx
• Model.Util.tsx
• Model.View.tsx
• Model.Zone.tsx
Scalar
• Overview
• scalar.abstract.md
• scalar.constant.ts
• scalar.dictionary.ts
• scalar.document.ts
• Scalar.Template.tsx
• Scalar.Unit.tsx
Service
• Overview
• service.abstract.md
• service.dictionary.ts
• service.service.ts
• service.signal.ts
• service.store.ts
• Service.Util.tsx
• Service.Zone.tsx
Previous
service.dictionary.ts
Next
service.signal.ts

Service File

A service module service file owns the server workflow. It is where encryption, search indexing, file access, external API calls, and service-to-service coordination should live.
Unlike model services, service modules usually start from a string name: `serve("search" as const, ...)`. There may be no database model behind it.

Basic Service Shape

`serve()` gives the module a stable service name and creates typed instance properties for injected values. Put public methods on the class; signals call those methods later.
minimal service

Runtime Values

Use `use<T>()` when the service needs a runtime value supplied by the app or runtime container. Secrets, clients, and environment-specific handles belong here rather than as hardcoded constants.
runtime injection

Service Injection

Use `service<OtherService>()` when this workflow coordinates other services. This keeps orchestration in the service layer instead of spreading it across cron jobs or UI code.
service injection

Server Mode

Some service modules are not meant for normal request servers. `{ serverMode: "batch" }` marks a service for batch or internal workers, which matches scheduled jobs in the signal file.
batch service
Service File
Basic Service Shape
Runtime Values
Service Injection
Server Mode