Source folder layout

Description of Aura Bot Platform src/ repository

Introduction

The repository aura-bot-platform has a folder layout inside src folder, to organize the code according to functionality groups.

In src root folder, only main files should be placed, such as index.ts, or main server file server.ts (app.ts in aura-bot).

src/ sub-folders

src/bots

Currently, only the file aura-bot.ts is included here, that is the main ActivityHandler (kind of replace of previous UniversalBot).

In a near future, more Bot Builder adapters could be located here.

src/config

In this folder, files that load configurations are included. These files are required in other places, such as channel configuration, env vars, etc.

src/db

In this folder, files that manage and connect to databases are located, such as MongoDB.

src/events

Files handling events (such as ModuleObserver subclasses) should be placed in this folder.

src/dialogs

This folder contains aura-bot main dialog and custom prompts, as use case dialogs will be located in libraries, loaded as dependencies.

src/make

In this folder, the code related with joining all the library-specific data with global ones is included, corresponding to the make-up process.

src/middlewares

This folder contains abstract middleware base classes, and specific middleware implementation (final classes).

src/middlewares/recognizers

This folder contains all the recognizers, such as nlp-recognizer-middleware, aura-command-recognizer-middleware, etc.

src/models

Files located within this folder will have exported types and interfaces required in different parts of the code (types and interfaces required only within a file could be self-contained).

src/modules

This folder contains independent code blocks, that could be exported as a reusable packages if required in different components, such as cache manager, locale manager, etc.

src/plugin

This folder contains the modules in charge of loading plugins: charging dialogs, middlewares, delivery configuration for these components, etc.

src/routing

Here, code related with intent-to-dialog routing is located, as this is not part of Bot Builder anymore.

src/utils

This folder contains utility classes and methods that are not part or any other block. We should maintain this folder organized and tidy, to avoid lots of unspecific files.