Architecture Overview
FoalTS is a framework for creating server-side Node.js applications. It is written in TypeScript, a typed superset of JavaScript that provides advanced development tools and the latest language features.
FoalTS architecture is organized around three main components: controllers, services and hooks.
#
ControllersControllers are classes instantiated as singletons. Their methods process the incoming HTTP requests.
#
ServicesServices are also classes instantiated as singletons. They are used by the controllers (or hooks) to perform specific tasks.
#
HooksHooks are small functions that add extra logic before or after the execution of a controller method.
#
A Simple ApplicationControllers may have sub-controllers. Hooks can be attached to the controllers or their methods.
Here's an example of what a FoalTS application may look like.