FoalTS architecture is organized around three main components: controllers, services and hooks.
Controllers are classes instantiated as singletons. Their methods process the incoming HTTP requests.
Services are also classes instantiated as singletons. They are used by the controllers (or hooks) to perform specific tasks.
Hooks are small functions that add extra logic before or after the execution of a controller method.
Controllers 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.