Actionhero is moving to Typescript in v21!
To learn more about the new features and the upgrade process, visit the Typescript Tutorial.


Why Actionhero


Introduction


Actionhero Whitepaper

The Case for Conventions and Built-in Tools

We are often asked why one might choose Actionhero to power their API/App vs one of the other node.js frameworks. This document is organized around the various topics you may consider when starting a new project.

Actionhero is an opinionated Node.js API server framework providing robust and proven options out of the box for: logging, testing, HTTP and WebSockets, caching, asynchronous task processing, project structure, and clustering (both local and distributed). By providing these capabilities Actionhero helps developers focus on building features instead of building infrastructure. Conversely, most other Node API server projects require that developers invest significant time in choosing and integrating third-party plugins and extensions to deliver these capabilities.


Why Actionhero


Unlike Express and Koa, but similar to Loopback, Actionhero is an API server framework. Instead of focusing on HTTP request handling Actionhero separates the transport mechanism (HTTP, Websocket, etc) from the API logic with the concept of Actions. Actions are discrete and synchronous units of logic that can be invoked using any transport (i.e. Servers). This separation helps us to accomplish many things.

General Use Case
  • Simplifies test development
  • Reduces complexity by removing transport specific error/response handling
  • Allows the same code to be used for both HTTP and websocket clients
  • Provides a convenient, per route way to apply middleware, authentication, and validation
Deployability and Scalability
  • Stand-alone app, but also...
  • Same-machine cluster to utilize all CPUs (doesn’t require forever or pm2)
  • Multi-machine cluster with only redis to communicate
  • Includes shared cache, cluster broadcast, and other features
  • Built with Docker deployments in mind; minimal docker & compose files included
Background Jobs
  • Actionhero’s task system is based on node-resque
  • A proven background job system compatible with ruby, php, and python
  • Support for multiple queues, retry semantics, and periodic tasks
Project Coordination
  • Conventions for config follow 12-factor app patterns
  • Project organization with automatic-loading
  • hot-reloading developer experience
Localization
  • i18n built in
  • Customizable keys for localization (URL, Header, etc)
Testing
  • Uses Jest for server code testing
  • Testing library (specHelper) for running actions and tasks - integration tests out of the box
  • Generator includes test files
Real-time & Connections other than HTTP
  • Websocket first-class citizen. Sessions linked with HTTP requests
  • Client-side library
  • Built on Primus, with support for multiple WS implementations
  • Other servers possible for input (like Twitter, JSON over TCP, QUIC, etc)
Databases
  • None included for flexibility
  • Plugins integrate with Seqeulize, Mongo, and more

Comparison


 ActionheroExpressKoaLoopbackSails
HTTP
WebSocket🚫🚫🚫🚫
TCP Socket🚫🚫🚫🚫
Shared Cache🚫🚫🚫🚫
Logging🚫🚫
Parallel Processes🚫🚫🚫🚫
Multiple Host Cluster🚫🚫🚫🚫
Background Processing🚫🚫🚫🚫
Middleware🚫
Testing Support🚫🚫🚫
Project Organization Conventions🚫🚫

Solutions

Actionhero was built from the ground up to include all the features you expect from a modern API framework.

Open Source


The Actionhero server is open source, under the Apache-2 license


Actionhero runs on Linux, OS X, and Windows


You always have access to the Actionhero team via Slack and Github



Enterprise


For larger customers in need of a support contract, we offer an enterprise plan including everything in the Premium plan plus:


  • 24/7 access to core members of the Actionhero Team
  • Emergency response packages
  • Deployment support
  • ...and custom development against Actionhero’s core as needed.