image
Akan.js
English
DocsConventionsReferencesCheatsheet
image
Akan.js
DocsConventionsReferencesCheatsheet
Released under the MIT License
Official Akan.js Consulting onAkansoft
Copyright © 2026 Akan.js All rights reserved.
System managed bybassman
General
• Authorization
• Schema Design
• Edge Computing
• File Management
• Single Sign-On
• DataList & Enum
Interface
• CRUD
• Endpoint
• Form
Observability
• Logging
• Dependency Injection
• Error Handling
• Metrics
Performance
• Caching
• Image Optimization
• Lazy Loading
• Querying
• Queueing
• Realtime
Development
• Documentation
• Script
• Docker
• Kubernetes
General
• Authorization
• Schema Design
• Edge Computing
• File Management
• Single Sign-On
• DataList & Enum
Interface
• CRUD
• Endpoint
• Form
Observability
• Logging
• Dependency Injection
• Error Handling
• Metrics
Performance
• Caching
• Image Optimization
• Lazy Loading
• Querying
• Queueing
• Realtime
Development
• Documentation
• Script
• Docker
• Kubernetes
Previous
Documentation
Next
Docker

Scripts

Use `akan script` for one-time developer or operator jobs: seed data, migrations, checks, and small maintenance fixes.
  • The script starts the app server container without opening a normal web page.
  • You can reuse services, signals, and adaptors that the app already wires together.
  • Keep each script small and easy to delete after the job is done.

Command

Put scripts under `apps/myapp/script`. The filename becomes the command target.
Run a script

Server Lifecycle

Start the server, do the job, and always stop it in `finally`. This makes database connections, timers, and adaptors clean up correctly.
apps/myapp/script/hello.ts

Use Services

Most maintenance jobs should call services. Services already know the domain rules, database access, and other dependencies.
Read and update data

Lookup Helpers

  • `server.get(ArticleService)`: class-based lookup with strong types.
  • `server.getService("article")`: refName-based service lookup.
  • `server.getSignal("article")`: signal lookup for a script that wants to call signal logic.
  • `server.getAdaptor("storage")`: adaptor lookup for infrastructure tasks.

Tips

  • Print the target environment before changing data.
  • For destructive scripts, add a confirm flag or dry-run mode.
  • Prefer service methods over direct database writes so domain rules stay in one place.
Scripts
Command
Server Lifecycle
Use Services
Lookup Helpers
Tips