Module Overview

An Akan module is one folder for one business feature. The model's shape, its wording, storage, workflows, API, client state and UI all sit side by side in it.
This page is a map for choosing which file to open next. Syntax and examples live on each file's own page.
An Example Module
The banner module in libs/shared looks like this:
libs/shared/lib/banner/
  • Lowercase files are logic. They are named <model>.<role>.ts and hold data, storage, API and client state.
  • PascalCase files are UI. Their components are reached through the model's namespace: Card in Banner.Unit.tsx is <Banner.Unit.Card />.
  • index.ts is generated. Never edit it. *.signal.spec.ts holds test fixtures and *.signal.test.ts the assertions.
  • This page covers database modules in lib/<model>. Service modules (lib/_<service>) and scalar modules (lib/__scalar/<scalar>) have their own overview pages.
Words used on this page
light model
The Light<Model> class: the few fields a list or card needs. Server and client both hold it.
full model
The <Model> class: every field of one record. Detail screens use it.
slice
A server query that fills a list in the client store.
endpoint
One query, mutation, message or pubsub a caller can reach.
guard
A class that decides whether the caller may run an endpoint.
Load.UnitsLoad.View
Wrappers that fill the store from route data and draw the loading and empty states.

Module File Map

A module's files fall into two groups: seven lowercase logic files and five PascalCase UI files. Each card opens that file's guide.
Logic Files
UI Files
Unit and View are server components. Template, Zone and Util are client components and start with "use client".

Server To Client Flow

A module usually grows from the data shape to storage, then to the API, client state and UI. Not every feature needs every file, but this order keeps each file's job clear.
  1. abstract — Write down the business intent and the domain rules that should last.
  2. constant — Define the business shape: fields, enums and the model layers.
  3. dictionary — Give those fields, actions, errors and UI phrases the names users see.
  4. document — Describe how stored documents are queried, changed, indexed and loaded.
  5. service — Build business workflows from document helpers and other services.
  6. signal — Expose server behaviour as typed slices, endpoints, realtime channels and tasks.
  7. store — Connect the generated fetch API to client state, form state and UI actions.
  8. UI — Draw forms, lists, detail views, actions and page sections.
As a diagram, the chain ends in UI, which splits into the five UI roles:
One module, data to UI
constant
dictionary
document
service
signal
store
UI
Templatethe form
Unitone row or card
Viewone full record
Utilone control
Zonethe section

Role Boundaries

When a module gets confusing, it is usually because logic moved into the wrong file. Check where it belongs before adding code.
WhatWhereWhat goes there
Business rulesservice · document · constantService workflows, document methods and constant helpers. Never inside render code.
API and accesssignalSlices, endpoints, guards, internal args, realtime channels and tasks.
Client coordinationstoreFetch calls, form and list state, toasts and UI actions.
DisplayUnit · ViewUnit repeats a light model; View shows one full model in detail.
Page sectionsZoneLoad wrappers, Unit/View, Util controls and the section's layout.
Small controlsUtilToolboxes, action buttons, dialog triggers, query panels and navigation helpers.

Recommended Reading Paths

Pick the column for the task you are building and read it top to bottom: that is the order to open the files in. The first one, abstract, is the best place to inspect or design the change.
  • New model: when defining a business object from scratch.
  • List: when a page needs list data, filtering, pagination and cards.
  • Detail/edit: when showing a model's full data, or editing an existing one.
  • Action: when a user's click should run a business workflow.
File, in reading order
New model
List
Detail/edit
Action
Logic files
abstract
✓
✓
✓
✓
Every path starts here, with the rules the change must keep.
constant
✓
The new object's fields and model layers.
dictionary
✓
Names for the new fields, errors and UI text.
document
✓
Filters, document methods and indexes for the stored data.
service
✓
✓
The workflow the new model or the click runs.
signal
✓
✓
✓
✓
A slice for a list, the get guard behind view<Model> for detail, an endpoint for an action.
store
✓
✓
✓
✓
The state the screen reads. For an action, the store action a button calls.
UI files
Zone
✓
✓
The section that takes the route's data and fills the list or the detail.
Unit
✓
One card or row of the list.
View
✓
The detail of one full record.
Template
✓
✓
The edit form. For an action, the button can live here or in Util.
Util
✓
The action's button when it is a control of its own.
✓Read for this taskNot needed

Practical Rules

Four habits that keep a module easy to follow:
  • Connect files through generated types. Let cnst, fetch and st carry shapes between files instead of copying them by hand.
  • Server before UI. When a feature changes stored data, design the server behaviour first.
  • UI files compose and present. Business decisions never hide in them; a display or predicate rule goes on Light<Model> as a method.
  • Split before a Zone grows. When a section gets large, move display into Unit/View and controls into Util first.

Released under the MIT License

Connect your AI to these docs

MCPhttps://akanjs.com/mcp
Copyright © 2026 Akan.js All rights reserved.System managed bybassman