image
Akan.js
English
DocsConventionsReferencesCheatsheet
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 Convention
• Structure
• Format & Lint
App & Library Convention
• Assets (public/ private/)
• Components (ui/)
• Server Utils (srvkit/)
• Web Utils (webkit/)
• Common Utils (common/)
• akan.config.ts
Domain Convention
• Overview
• 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 Convention
• Overview
• scalar.constant.ts
• scalar.dictionary.ts
• scalar.document.ts
• Scalar.Template.tsx
• Scalar.Unit.tsx
Service Convention
• Overview
• service.dictionary.ts
• service.service.ts
• service.signal.ts
• service.store.ts
• Service.Util.tsx
• Service.Zone.tsx
Workspace Convention
• Structure
• Format & Lint
App & Library Convention
• Assets (public/ private/)
• Components (ui/)
• Server Utils (srvkit/)
• Web Utils (webkit/)
• Common Utils (common/)
• akan.config.ts
Domain Convention
• Overview
• 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 Convention
• Overview
• scalar.constant.ts
• scalar.dictionary.ts
• scalar.document.ts
• Scalar.Template.tsx
• Scalar.Unit.tsx
Service Convention
• Overview
• service.dictionary.ts
• service.service.ts
• service.signal.ts
• service.store.ts
• Service.Util.tsx
• Service.Zone.tsx
Previous
Structure
Next
Assets (public/ private/)

Format And Lint

Akan lint is mostly here to keep the workspace easy to read and hard to break. In day-to-day work, you only need to remember a few habits: let the formatter handle style, keep client-only code out of server files, avoid random external imports in convention files, and run lint before sharing work.
Let format decide
Use 2-space indentation, double quotes, organized imports, and the formatter's class ordering.
Keep server files server-safe
Do not add useState, useEffect, st, or top-level use client to files that should render on the server.
Keep imports intentional
Convention files should import from relative paths, Akan packages, or workspace aliases before reaching for external packages.
Run it before sharing
Use lint on the app or library you touched, and use lintAll before broad checks.

Akan Lint Errors And Fixes

Some lint errors are not about style. They happen when server UI, client UI, service code, or shared utilities are mixed in the wrong place. Use the examples below as the default shape: keep server pages simple, move browser interaction into client components, and wrap external tools behind internal modules.
Client hooks in a server file
This happens when a server page or server-oriented component imports useState, useEffect, useMemo, useRef, or another React client hook.
❌ Before
page.tsx
✅ After
page.tsx
LikeButton.tsx
Adding use client to a server file
Do not turn a whole page into a client component just because one small part needs browser interaction.
❌ Before
page.tsx
✅ After
page.tsx
ScrollReset.tsx
Passing function props from server UI
Server components should pass data, not event behavior. Move callbacks such as onClick into a client component.
❌ Before
page.tsx
✅ After
page.tsx
OrderCardAction.tsx
Importing external packages directly
Convention files should not depend on random external packages directly. Put the dependency behind an internal util or library file first.
❌ Before
order.service.ts
✅ After
order.service.ts
@libs/util/id.ts
Using JavaScript private methods
In service classes, use TypeScript private methods with an underscore name instead of JavaScript #private methods. Other classes can use #private methods.
❌ Before
order.service.ts
✅ After
order.service.ts
Allowed exceptions exist for some framework patterns, but when you are writing ordinary app code, prefer the After shape first. If console output is intentional, use console.info, console.warn, or console.error instead of console.log.

Commands

Use workspace lint commands for normal development. Use direct Biome checks when you want to verify one file or debug a formatting issue.
Lint commands
Format And Lint
Akan Lint Errors And Fixes
Commands