Creating Modules
Loopstack uses NestJS modules to organize your application into cohesive blocks of functionality. Each module groups related workspaces, workflows, tools, and documents together.
Basic Module Structure
Create a module file (e.g., my-feature.module.ts):
import { Module } from '@nestjs/common';
import { LoopCoreModule } from '@loopstack/core';
@Module({
imports: [
LoopCoreModule,
// Other modules your feature depends on
],
providers: [
MyWorkspace,
MyWorkflow,
MyTool,
MyDocument,
],
})
export class MyFeatureModule {}The @Module decorator takes a configuration object with two key properties:
- imports β Other modules this module depends on. Always include
LoopCoreModulefor core Loopstack functionality. - providers β Your workspaces, workflows, tools, and documents that belong to this module.
Registering Your Module
Add your module to the main AppModule to make it available in your application:
@Module({
imports: [
MyFeatureModule,
],
})
export class AppModule {}Last updated on