@venizia/ignis-docs 0.0.7-2 → 0.0.8-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/dist/mcp-server/common/paths.d.ts +4 -2
  2. package/dist/mcp-server/common/paths.d.ts.map +1 -1
  3. package/dist/mcp-server/common/paths.js +8 -6
  4. package/dist/mcp-server/common/paths.js.map +1 -1
  5. package/dist/mcp-server/tools/docs/get-document-content.tool.d.ts +1 -1
  6. package/dist/mcp-server/tools/docs/get-document-content.tool.d.ts.map +1 -1
  7. package/dist/mcp-server/tools/docs/get-document-content.tool.js +7 -7
  8. package/dist/mcp-server/tools/docs/get-document-metadata.tool.js +3 -3
  9. package/dist/mcp-server/tools/docs/get-package-overview.tool.d.ts +1 -1
  10. package/dist/mcp-server/tools/docs/get-package-overview.tool.js +1 -1
  11. package/package.json +1 -1
  12. package/wiki/best-practices/api-usage-examples.md +9 -9
  13. package/wiki/best-practices/architectural-patterns.md +19 -3
  14. package/wiki/best-practices/architecture-decisions.md +6 -6
  15. package/wiki/best-practices/code-style-standards/advanced-patterns.md +1 -1
  16. package/wiki/best-practices/code-style-standards/control-flow.md +1 -1
  17. package/wiki/best-practices/code-style-standards/function-patterns.md +2 -2
  18. package/wiki/best-practices/code-style-standards/index.md +2 -2
  19. package/wiki/best-practices/code-style-standards/naming-conventions.md +1 -1
  20. package/wiki/best-practices/code-style-standards/route-definitions.md +4 -4
  21. package/wiki/best-practices/data-modeling.md +1 -1
  22. package/wiki/best-practices/deployment-strategies.md +1 -1
  23. package/wiki/best-practices/error-handling.md +2 -2
  24. package/wiki/best-practices/performance-optimization.md +3 -3
  25. package/wiki/best-practices/security-guidelines.md +2 -2
  26. package/wiki/best-practices/troubleshooting-tips.md +1 -1
  27. package/wiki/{references → extensions}/components/authentication/api.md +12 -20
  28. package/wiki/{references → extensions}/components/authentication/errors.md +1 -1
  29. package/wiki/{references → extensions}/components/authentication/index.md +5 -8
  30. package/wiki/{references → extensions}/components/authentication/usage.md +20 -36
  31. package/wiki/{references → extensions}/components/authorization/api.md +62 -13
  32. package/wiki/{references → extensions}/components/authorization/errors.md +12 -7
  33. package/wiki/{references → extensions}/components/authorization/index.md +93 -6
  34. package/wiki/{references → extensions}/components/authorization/usage.md +42 -4
  35. package/wiki/{references → extensions}/components/health-check.md +5 -4
  36. package/wiki/{references → extensions}/components/index.md +2 -0
  37. package/wiki/{references → extensions}/components/mail/index.md +1 -1
  38. package/wiki/{references → extensions}/components/request-tracker.md +1 -1
  39. package/wiki/{references → extensions}/components/socket-io/api.md +2 -2
  40. package/wiki/{references → extensions}/components/socket-io/errors.md +2 -0
  41. package/wiki/{references → extensions}/components/socket-io/index.md +24 -20
  42. package/wiki/{references → extensions}/components/socket-io/usage.md +2 -2
  43. package/wiki/{references → extensions}/components/static-asset/api.md +14 -15
  44. package/wiki/{references → extensions}/components/static-asset/errors.md +3 -1
  45. package/wiki/{references → extensions}/components/static-asset/index.md +158 -89
  46. package/wiki/{references → extensions}/components/static-asset/usage.md +8 -5
  47. package/wiki/{references → extensions}/components/swagger.md +3 -3
  48. package/wiki/{references → extensions}/components/template/index.md +4 -4
  49. package/wiki/{references → extensions}/components/template/setup-page.md +1 -1
  50. package/wiki/{references → extensions}/components/template/single-page.md +1 -1
  51. package/wiki/{references → extensions}/components/websocket/api.md +7 -6
  52. package/wiki/{references → extensions}/components/websocket/errors.md +17 -3
  53. package/wiki/{references → extensions}/components/websocket/index.md +17 -11
  54. package/wiki/{references → extensions}/components/websocket/usage.md +2 -2
  55. package/wiki/{references → extensions}/helpers/crypto/index.md +1 -1
  56. package/wiki/{references → extensions}/helpers/env/index.md +9 -5
  57. package/wiki/{references → extensions}/helpers/error/index.md +2 -7
  58. package/wiki/{references → extensions}/helpers/index.md +18 -6
  59. package/wiki/{references → extensions}/helpers/kafka/admin.md +33 -16
  60. package/wiki/extensions/helpers/kafka/consumer.md +384 -0
  61. package/wiki/extensions/helpers/kafka/examples.md +361 -0
  62. package/wiki/extensions/helpers/kafka/index.md +639 -0
  63. package/wiki/{references → extensions}/helpers/kafka/producer.md +100 -96
  64. package/wiki/extensions/helpers/kafka/schema-registry.md +214 -0
  65. package/wiki/{references → extensions}/helpers/logger/index.md +2 -2
  66. package/wiki/{references → extensions}/helpers/queue/index.md +400 -4
  67. package/wiki/{references → extensions}/helpers/storage/api.md +170 -10
  68. package/wiki/{references → extensions}/helpers/storage/index.md +44 -8
  69. package/wiki/{references → extensions}/helpers/template/index.md +1 -1
  70. package/wiki/{references → extensions}/helpers/testing/index.md +4 -4
  71. package/wiki/{references → extensions}/helpers/types/index.md +63 -16
  72. package/wiki/{references → extensions}/helpers/websocket/index.md +1 -1
  73. package/wiki/extensions/index.md +48 -0
  74. package/wiki/guides/core-concepts/application/bootstrapping.md +55 -37
  75. package/wiki/guides/core-concepts/application/index.md +95 -35
  76. package/wiki/guides/core-concepts/components-guide.md +23 -19
  77. package/wiki/guides/core-concepts/components.md +34 -10
  78. package/wiki/guides/core-concepts/dependency-injection.md +99 -34
  79. package/wiki/guides/core-concepts/grpc-controllers.md +295 -0
  80. package/wiki/guides/core-concepts/persistent/datasources.md +27 -8
  81. package/wiki/guides/core-concepts/persistent/models.md +43 -1
  82. package/wiki/guides/core-concepts/persistent/repositories.md +75 -8
  83. package/wiki/guides/core-concepts/persistent/transactions.md +38 -8
  84. package/wiki/guides/core-concepts/{controllers.md → rest-controllers.md} +30 -33
  85. package/wiki/guides/core-concepts/services.md +19 -5
  86. package/wiki/guides/get-started/5-minute-quickstart.md +6 -7
  87. package/wiki/guides/get-started/philosophy.md +1 -1
  88. package/wiki/guides/index.md +2 -2
  89. package/wiki/guides/reference/glossary.md +7 -7
  90. package/wiki/guides/reference/mcp-docs-server.md +1 -1
  91. package/wiki/guides/tutorials/building-a-crud-api.md +2 -2
  92. package/wiki/guides/tutorials/complete-installation.md +17 -14
  93. package/wiki/guides/tutorials/ecommerce-api.md +18 -18
  94. package/wiki/guides/tutorials/realtime-chat.md +8 -8
  95. package/wiki/guides/tutorials/testing.md +2 -2
  96. package/wiki/index.md +4 -3
  97. package/wiki/references/base/application.md +341 -21
  98. package/wiki/references/base/bootstrapping.md +43 -13
  99. package/wiki/references/base/components.md +259 -8
  100. package/wiki/references/base/controllers.md +556 -253
  101. package/wiki/references/base/datasources.md +159 -79
  102. package/wiki/references/base/dependency-injection.md +299 -48
  103. package/wiki/references/base/filter-system/application-usage.md +18 -2
  104. package/wiki/references/base/filter-system/array-operators.md +14 -6
  105. package/wiki/references/base/filter-system/comparison-operators.md +9 -3
  106. package/wiki/references/base/filter-system/default-filter.md +28 -3
  107. package/wiki/references/base/filter-system/fields-order-pagination.md +17 -13
  108. package/wiki/references/base/filter-system/index.md +169 -11
  109. package/wiki/references/base/filter-system/json-filtering.md +51 -18
  110. package/wiki/references/base/filter-system/list-operators.md +4 -3
  111. package/wiki/references/base/filter-system/logical-operators.md +7 -2
  112. package/wiki/references/base/filter-system/null-operators.md +50 -0
  113. package/wiki/references/base/filter-system/quick-reference.md +82 -243
  114. package/wiki/references/base/filter-system/range-operators.md +7 -1
  115. package/wiki/references/base/filter-system/tips.md +34 -7
  116. package/wiki/references/base/filter-system/use-cases.md +6 -5
  117. package/wiki/references/base/grpc-controllers.md +984 -0
  118. package/wiki/references/base/index.md +32 -24
  119. package/wiki/references/base/middleware.md +347 -0
  120. package/wiki/references/base/models.md +390 -46
  121. package/wiki/references/base/providers.md +14 -14
  122. package/wiki/references/base/repositories/advanced.md +84 -69
  123. package/wiki/references/base/repositories/index.md +447 -12
  124. package/wiki/references/base/repositories/mixins.md +103 -98
  125. package/wiki/references/base/repositories/relations.md +129 -45
  126. package/wiki/references/base/repositories/soft-deletable.md +104 -23
  127. package/wiki/references/base/services.md +94 -14
  128. package/wiki/references/index.md +12 -10
  129. package/wiki/references/quick-reference.md +98 -65
  130. package/wiki/references/utilities/crypto.md +21 -4
  131. package/wiki/references/utilities/date.md +25 -7
  132. package/wiki/references/utilities/index.md +26 -24
  133. package/wiki/references/utilities/jsx.md +54 -54
  134. package/wiki/references/utilities/module.md +8 -6
  135. package/wiki/references/utilities/parse.md +16 -9
  136. package/wiki/references/utilities/performance.md +22 -7
  137. package/wiki/references/utilities/promise.md +19 -16
  138. package/wiki/references/utilities/request.md +48 -26
  139. package/wiki/references/utilities/schema.md +69 -6
  140. package/wiki/references/utilities/statuses.md +131 -140
  141. package/wiki/references/helpers/kafka/consumer.md +0 -473
  142. package/wiki/references/helpers/kafka/examples.md +0 -234
  143. package/wiki/references/helpers/kafka/index.md +0 -482
  144. /package/wiki/{references → extensions}/components/mail/api.md +0 -0
  145. /package/wiki/{references → extensions}/components/mail/errors.md +0 -0
  146. /package/wiki/{references → extensions}/components/mail/usage.md +0 -0
  147. /package/wiki/{references → extensions}/components/template/api-page.md +0 -0
  148. /package/wiki/{references → extensions}/components/template/errors-page.md +0 -0
  149. /package/wiki/{references → extensions}/components/template/usage-page.md +0 -0
  150. /package/wiki/{references → extensions}/helpers/cron/index.md +0 -0
  151. /package/wiki/{references → extensions}/helpers/inversion/index.md +0 -0
  152. /package/wiki/{references → extensions}/helpers/network/api.md +0 -0
  153. /package/wiki/{references → extensions}/helpers/network/index.md +0 -0
  154. /package/wiki/{references → extensions}/helpers/redis/index.md +0 -0
  155. /package/wiki/{references → extensions}/helpers/socket-io/api.md +0 -0
  156. /package/wiki/{references → extensions}/helpers/socket-io/index.md +0 -0
  157. /package/wiki/{references → extensions}/helpers/template/single-page.md +0 -0
  158. /package/wiki/{references → extensions}/helpers/uid/index.md +0 -0
  159. /package/wiki/{references → extensions}/helpers/websocket/api.md +0 -0
  160. /package/wiki/{references → extensions}/helpers/worker-thread/index.md +0 -0
  161. /package/wiki/{references → extensions}/src-details/mcp-server.md +0 -0
@@ -23,11 +23,11 @@ export const appConfigs: IApplicationConfigs = {
23
23
  host: process.env.APP_ENV_SERVER_HOST,
24
24
  port: +(process.env.APP_ENV_SERVER_PORT ?? 3000),
25
25
  path: {
26
- base: process.env.APP_ENV_SERVER_BASE_PATH,
26
+ base: process.env.APP_ENV_SERVER_BASE_PATH ?? "/",
27
27
  isStrict: true,
28
28
  },
29
29
  debug: {
30
- showRoutes: process.env.NODE_ENV !== "production",
30
+ shouldShowRoutes: process.env.NODE_ENV !== "production",
31
31
  },
32
32
  };
33
33
 
@@ -40,18 +40,18 @@ export class Application extends BaseApplication {
40
40
  staticConfigure(): void {
41
41
  // e.g., this.static({ folderPath: './public' })
42
42
  }
43
-
43
+
44
44
  preConfigure(): ValueOrPromise<void> {
45
45
  // Register your resources
46
46
  this.dataSource(MyDataSource);
47
47
  this.service(MyService);
48
48
  this.controller(MyController);
49
49
  }
50
-
50
+
51
51
  postConfigure(): ValueOrPromise<void> {
52
52
  // Logic to run after everything is configured
53
53
  }
54
-
54
+
55
55
  setupMiddlewares(): ValueOrPromise<void> {
56
56
  // Add any custom application-wide middlewares
57
57
  }
@@ -64,9 +64,9 @@ The `Ignis` application has a well-defined lifecycle, managed primarily by the `
64
64
 
65
65
  | Method | Description |
66
66
  | :--- | :--- |
67
- | **`constructor(opts)`** | Initializes the application, sets up the Hono server, and detects the runtime (Bun/Node). |
68
- | **`start()`** | The main entry point. It calls `initialize()`, sets up middlewares, and starts the HTTP server. |
69
- | **`stop()`** | Stops the application server. |
67
+ | **`constructor(opts)`** | Initializes the application, sets up the Hono server (`OpenAPIHono`), and detects the runtime (Bun/Node). The `Application` extends `Container` (IoC container). |
68
+ | **`start()`** | The main entry point. It calls `initialize()`, sets up middlewares, mounts the root router, and starts the HTTP server. |
69
+ | **`stop()`** | Stops the application server (calls `Bun.serve.stop()` or `node-server.close()`). |
70
70
  | **`initialize()`** | Orchestrates the entire setup process, calling the various configuration and registration methods in the correct order. |
71
71
 
72
72
  The `BaseApplication` class provides several **overridable hook methods** that allow you to customize the startup process. These are the primary places you'll write your application-specific setup code.
@@ -74,10 +74,10 @@ The `BaseApplication` class provides several **overridable hook methods** that a
74
74
  | Hook Method | Purpose |
75
75
  | :--- | :--- |
76
76
  | `getAppInfo()` | **Required.** Return application metadata, usually from `package.json`. Used for OpenAPI docs. |
77
- | `staticConfigure()` | Configure static file serving. |
77
+ | `staticConfigure()` | Configure static file serving. Called before `preConfigure()`. |
78
78
  | `preConfigure()` | **Most Important Hook.** Set up application resources like components, controllers, services, and datasources. Can be skipped if using [Bootstrapping](./bootstrapping). |
79
- | `postConfigure()` | Perform actions *after* all resources have been configured and instantiated. |
80
- | `setupMiddlewares()`| Add custom application-level middlewares to the Hono instance. |
79
+ | `postConfigure()` | Perform actions *after* all resources have been configured and instantiated. Note: do not bind new datasources, components, or controllers here -- they will not be auto-configured. |
80
+ | `setupMiddlewares()`| Add custom application-level middlewares to the Hono instance. Called after `initialize()` completes. |
81
81
 
82
82
  ## Lifecycle Diagram
83
83
 
@@ -89,25 +89,27 @@ start()
89
89
 
90
90
  initialize()
91
91
 
92
- ├─► boot() (if bootOptions configured)
93
92
  ├─► printStartUpInfo
94
93
  ├─► validateEnvs
95
- ├─► registerDefaultMiddlewares
96
- ├─► staticConfigure() ← Override hook
97
- ├─► preConfigure() ← Override hook
98
- ├─► registerDataSources
99
- ├─► registerComponents
100
- ├─► registerControllers
101
- └─► postConfigure() ← Override hook
94
+ ├─► registerDefaultMiddlewares (error handler, contextStorage, RequestTracker, favicon)
95
+ ├─► staticConfigure() ← Override hook
96
+ ├─► preConfigure() ← Override hook
97
+ ├─► registerDataSources() (configures all datasource bindings)
98
+ ├─► registerComponents() (configures all component bindings)
99
+ ├─► registerControllers() (REST + gRPC transport components)
100
+ └─► postConfigure() ← Override hook
101
+
102
+
103
+ setupMiddlewares() ← Override hook
102
104
 
103
105
 
104
- setupMiddlewares() ← Override hook
106
+ Mount Root Router (server.route(basePath, rootRouter))
105
107
 
106
108
 
107
- Mount Root Router
109
+ Start HTTP Server (Bun.serve or @hono/node-server)
108
110
 
109
111
 
110
- Start HTTP Server
112
+ executePostStartHooks()
111
113
  ```
112
114
 
113
115
  ## Configuration
@@ -118,17 +120,23 @@ Application configuration is passed to the `BaseApplication` constructor via an
118
120
 
119
121
  | Option | Type | Default | Description |
120
122
  | :--- | :--- | :--- | :--- |
121
- | `host` | `string` | `'localhost'` | The host address to bind the server to. |
122
- | `port` | `number` | `3000` | The port to listen on. |
123
+ | `host` | `string` | `'localhost'` | The host address. Falls back to `HOST` or `APP_ENV_SERVER_HOST` env vars. |
124
+ | `port` | `number` | `3000` | The port to listen on. Falls back to `PORT` or `APP_ENV_SERVER_PORT` env vars. |
123
125
  | `path.base`| `string` | `'/'` | The base path for all application routes (e.g., `/api`). |
124
126
  | `path.isStrict`| `boolean`| `true` | If `true`, the router is strict about trailing slashes. |
125
- | `debug.showRoutes`| `boolean`| `false`| If `true`, prints all registered routes to the console on startup. |
127
+ | `debug.shouldShowRoutes`| `boolean`| `false`| If `true`, prints all registered routes to the console on startup. |
126
128
  | `favicon` | `string` | `'🔥'` | An emoji to be used as the application's favicon. |
127
129
  | `bootOptions` | `IBootOptions` | `undefined` | Enable auto-discovery of artifacts. See [Bootstrapping](./bootstrapping). |
130
+ | `asyncContext.enable` | `boolean` | `true` | Enable Hono's async context storage (powered by `contextStorage()`). |
131
+ | `transports` | `TControllerTransport[]` | `['rest']` | Controller transports to enable. Add `'grpc'` for gRPC support. |
132
+ | `error.rootKey` | `string` | `undefined` | Optional root key for error response wrapping. |
133
+ | `strictPath` | `boolean` | `true` | Controls trailing slash strictness on the main Hono server. |
128
134
 
129
135
  ### Example Configuration
130
136
 
131
137
  ```typescript
138
+ import { ControllerTransports } from '@venizia/ignis';
139
+
132
140
  export const appConfigs: IApplicationConfigs = {
133
141
  host: "0.0.0.0",
134
142
  port: 3000,
@@ -137,8 +145,9 @@ export const appConfigs: IApplicationConfigs = {
137
145
  isStrict: true,
138
146
  },
139
147
  debug: {
140
- showRoutes: true,
148
+ shouldShowRoutes: true,
141
149
  },
150
+ transports: [ControllerTransports.REST, ControllerTransports.GRPC],
142
151
  };
143
152
  ```
144
153
 
@@ -146,28 +155,79 @@ export const appConfigs: IApplicationConfigs = {
146
155
 
147
156
  Register resources in `preConfigure()` to tell the DI container about your classes:
148
157
 
149
- | Method | Example | When to Use |
150
- |--------|---------|-------------|
151
- | `this.controller(...)` | `this.controller(UserController)` | Register API endpoints |
152
- | `this.service(...)` | `this.service(UserService)` | Register business logic |
153
- | `this.repository(...)` | `this.repository(UserRepository)` | Register data access |
154
- | `this.dataSource(...)` | `this.dataSource(PostgresDataSource)` | Register database connection |
155
- | `this.component(...)` | `this.component(AuthComponent)` | Register reusable modules |
158
+ | Method | Example | Binding Scope | When to Use |
159
+ |--------|---------|---------------|-------------|
160
+ | `this.dataSource(...)` | `this.dataSource(PostgresDataSource)` | **Singleton** | Register database connection |
161
+ | `this.component(...)` | `this.component(AuthComponent)` | **Singleton** | Register reusable modules |
162
+ | `this.repository(...)` | `this.repository(UserRepository)` | Transient | Register data access |
163
+ | `this.service(...)` | `this.service(UserService)` | Transient | Register business logic |
164
+ | `this.controller(...)` | `this.controller(UserController)` | Transient | Register API endpoints |
165
+ | `this.booter(...)` | `this.booter(CustomBooter)` | Tagged `'booter'` | Register custom booters |
166
+
167
+ All registration methods accept an optional second parameter to customize the binding key:
168
+
169
+ ```typescript
170
+ // Default binding (key: 'controllers.UserController')
171
+ this.controller(UserController);
172
+
173
+ // Custom binding key
174
+ this.controller(UserController, {
175
+ binding: { namespace: 'controllers', key: 'CustomUserController' }
176
+ });
177
+ ```
156
178
 
157
179
  **Registration order:**
158
180
  1. DataSources first (database connections)
159
181
  2. Repositories (depend on DataSources)
160
182
  3. Services (depend on Repositories)
161
183
  4. Controllers (depend on Services)
162
- 5. Components last
184
+ 5. Components (can add more datasources/controllers during configuration)
163
185
 
164
186
  > **Deep Dive:** See [Dependency Injection](../dependency-injection.md) for how registration and injection work together.
165
187
 
188
+ ## Runtime Support
189
+
190
+ The application detects the runtime automatically via `RuntimeModules.detect()`:
191
+
192
+ ```typescript
193
+ // Bun (default) — uses Bun.serve
194
+ Bun.serve({ port, hostname, fetch: server.fetch })
195
+
196
+ // Node.js — requires @hono/node-server
197
+ import { serve } from '@hono/node-server'
198
+ serve({ fetch: server.fetch, port, hostname })
199
+ ```
200
+
201
+ ## Post-Start Hooks
202
+
203
+ Register hooks that execute after the HTTP server has started:
204
+
205
+ ```typescript
206
+ this.registerPostStartHook({
207
+ identifier: 'cache-warmup',
208
+ hook: async () => {
209
+ // Warm up caches, start background jobs, etc.
210
+ },
211
+ });
212
+ ```
213
+
214
+ ## Static File Serving
215
+
216
+ Serve static files with runtime-aware implementation:
217
+
218
+ ```typescript
219
+ staticConfigure(): void {
220
+ this.static({ restPath: '/public/*', folderPath: './public' });
221
+ }
222
+ ```
223
+
224
+ Uses `hono/bun` `serveStatic` for Bun runtime, `@hono/node-server/serve-static` for Node.js.
225
+
166
226
  ## See Also
167
227
 
168
228
  - **Related Concepts:**
169
229
  - [Bootstrapping](./bootstrapping) - Auto-discovery of artifacts
170
- - [Controllers](/guides/core-concepts/controllers) - Creating HTTP endpoints
230
+ - [REST Controllers](/guides/core-concepts/rest-controllers) | [gRPC Controllers](/guides/core-concepts/grpc-controllers) - Creating HTTP/gRPC endpoints
171
231
  - [Services](/guides/core-concepts/services) - Business logic layer
172
232
  - [Dependency Injection](/guides/core-concepts/dependency-injection) - How DI works in IGNIS
173
233
 
@@ -7,7 +7,7 @@ This guide walks you through creating your own components step-by-step.
7
7
  Imagine you're building multiple applications that all need the same features: authentication, health checks, file uploads. Without components, you'd copy-paste code between projects:
8
8
 
9
9
  ```typescript
10
- // Without Components - Copy-paste everywhere
10
+ // Without Components - Copy-paste everywhere
11
11
  export class Application extends BaseApplication {
12
12
  preConfigure() {
13
13
  // Auth feature - copied to every project
@@ -28,7 +28,7 @@ export class Application extends BaseApplication {
28
28
  **Components solve this** by packaging related functionality into reusable, plug-and-play modules:
29
29
 
30
30
  ```typescript
31
- // With Components - Clean and reusable
31
+ // With Components - Clean and reusable
32
32
  export class Application extends BaseApplication {
33
33
  preConfigure() {
34
34
  this.component(AuthenticateComponent); // All auth features in one line
@@ -57,11 +57,11 @@ When you register a component, all of these get added to your application automa
57
57
 
58
58
  | Scenario | Use Component? | Why |
59
59
  |----------|----------------|-----|
60
- | Feature used in **one** project only | No | Just register services/controllers directly |
61
- | Feature **shared across projects** | Yes | Package once, reuse everywhere |
62
- | Feature with **multiple related parts** | Yes | Keep related code together |
63
- | Building a **library/package** | Yes | Easy distribution and installation |
64
- | **Configurable feature** with options | Yes | Components handle configuration elegantly |
60
+ | Feature used in **one** project only | No | Just register services/controllers directly |
61
+ | Feature **shared across projects** | Yes | Package once, reuse everywhere |
62
+ | Feature with **multiple related parts** | Yes | Keep related code together |
63
+ | Building a **library/package** | Yes | Easy distribution and installation |
64
+ | **Configurable feature** with options | Yes | Components handle configuration elegantly |
65
65
 
66
66
  ## Creating Your First Component
67
67
 
@@ -129,7 +129,7 @@ export class NotificationService extends BaseService {
129
129
  ```typescript
130
130
  // src/components/notification/controllers/controller.ts
131
131
  import {
132
- BaseController,
132
+ BaseRestController,
133
133
  controller,
134
134
  post,
135
135
  inject,
@@ -143,7 +143,6 @@ import { NotificationService } from '../services';
143
143
 
144
144
  const NotificationRoutes = {
145
145
  SEND: {
146
- method: HTTP.Methods.POST,
147
146
  path: '/send',
148
147
  request: {
149
148
  body: jsonContent({
@@ -160,12 +159,12 @@ const NotificationRoutes = {
160
159
  } as const;
161
160
 
162
161
  @controller({ path: '/notifications' })
163
- export class NotificationController extends BaseController {
162
+ export class NotificationController extends BaseRestController {
164
163
  constructor(
165
164
  @inject({ key: 'services.NotificationService' })
166
165
  private _notificationService: NotificationService,
167
166
  ) {
168
- super({ scope: NotificationController.name, path: '/notifications' });
167
+ super({ scope: NotificationController.name });
169
168
  }
170
169
 
171
170
  @post({ configs: NotificationRoutes.SEND })
@@ -317,22 +316,25 @@ export class Application extends BaseApplication {
317
316
  Application.preConfigure()
318
317
 
319
318
 
320
- this.component(MyComponent)
319
+ this.component(MyComponent) (registers binding as SINGLETON)
320
+
321
+
322
+ Application.registerComponents() (called during initialize())
321
323
 
322
324
 
323
325
  ┌────────────────────────────────┐
324
326
  │ 1. Constructor called │
325
327
  │ - Inject application │
326
328
  │ - Set up component scope │
329
+ │ - Define default bindings │
327
330
  └────────────────────────────────┘
328
331
 
329
332
 
330
333
  ┌────────────────────────────────┐
331
- │ 2. binding() called
332
- │ - Register services │
333
- │ - Register controllers
334
- │ - Register repositories
335
- │ - Bind default options │
334
+ │ 2. configure() called
335
+ │ - initDefaultBindings() │ (if initDefault.enable = true)
336
+ │ - binding() │ (register services, controllers, etc.)
337
+ │ - isConfigured = true (idempotent guard)
336
338
  └────────────────────────────────┘
337
339
 
338
340
 
@@ -491,6 +493,8 @@ export class MyComponent extends BaseComponent {
491
493
  | **Key method** | `binding()` - register all resources here |
492
494
  | **Configuration** | Use binding keys + `isBound()` check for overridable options |
493
495
  | **Registration** | `this.component(MyComponent)` in `preConfigure()` |
496
+ | **Scope** | Components are always registered as **singletons** |
497
+ | **Idempotent** | `configure()` only runs once, even if called multiple times |
494
498
 
495
499
  ## See Also
496
500
 
@@ -501,8 +505,8 @@ export class MyComponent extends BaseComponent {
501
505
 
502
506
  - **References:**
503
507
  - [BaseComponent API](/references/base/components) - Complete API reference
504
- - [Authentication Component](/references/components/authentication/) - Real-world component example
505
- - [Health Check Component](/references/components/health-check) - Simple component example
508
+ - [Authentication Component](/extensions/components/authentication/) - Real-world component example
509
+ - [Health Check Component](/extensions/components/health-check) - Simple component example
506
510
 
507
511
  - **Best Practices:**
508
512
  - [Architectural Patterns](/best-practices/architectural-patterns) - Component architecture patterns
@@ -1,6 +1,6 @@
1
1
  # Components
2
2
 
3
- Components are reusable, pluggable modules that encapsulate a group of related features. A component acts as a powerful container for various resourcesincluding providers, services, controllers, repositories, and even entire mini-applicationsmaking it easy to share and integrate complex functionality across projects.
3
+ Components are reusable, pluggable modules that encapsulate a group of related features. A component acts as a powerful container for various resources--including providers, services, controllers, repositories, and even entire mini-applications--making it easy to share and integrate complex functionality across projects.
4
4
 
5
5
  > **Deep Dive:** See [Components Reference](../../references/base/components.md) for detailed implementation patterns, directory structure, and best practices.
6
6
 
@@ -11,11 +11,30 @@ A component is a class that extends `BaseComponent` and is responsible for:
11
11
  - **Binding Dependencies**: Registering services, controllers, repositories, providers, or other resources with the application's dependency injection container.
12
12
  - **Configuring Features**: Setting up middlewares, initializing services, or performing any other setup required for the feature to work.
13
13
 
14
- A single component can bundle everything needed for a specific domainfor example, an "AuthComponent" might include multiple services for token management, repositories for user data, and controllers for login/signup endpoints, essentially functioning as a plug-and-play mini-application.
14
+ A single component can bundle everything needed for a specific domain--for example, an "AuthComponent" might include multiple services for token management, repositories for user data, and controllers for login/signup endpoints, essentially functioning as a plug-and-play mini-application.
15
15
 
16
16
  ## Built-in Components
17
17
 
18
- Ignis includes ready-to-use components for common features like authentication, API documentation, health checks, and more. See the [**Built-in Components Reference**](../../references/components/) for the complete list with detailed documentation.
18
+ Ignis includes ready-to-use components for common features. The following are exported from the main barrel (`@venizia/ignis`):
19
+
20
+ | Component | Description |
21
+ | :--- | :--- |
22
+ | **Authentication** | JWT + Basic auth strategies, token services, strategy registry |
23
+ | **Authorization** | Casbin-based RBAC, permission mapping, `authorize()` middleware |
24
+ | **HealthCheckComponent** | `GET /health`, `/health/live`, `/health/ready` |
25
+ | **SwaggerComponent** | Swagger UI or Scalar UI for API documentation |
26
+ | **RequestTrackerComponent** | `x-request-id` header, request body parsing |
27
+
28
+ The following components require direct subpath imports:
29
+
30
+ | Component | Import From | Description |
31
+ | :--- | :--- | :--- |
32
+ | **MailComponent** | `@venizia/ignis/components/mail` | Nodemailer/Mailgun transporters with queue executors |
33
+ | **SocketIOComponent** | `@venizia/ignis/components/socket-io` | Socket.IO server with Redis adapter |
34
+ | **StaticAssetComponent** | `@venizia/ignis/components/static-asset` | File upload/download CRUD, MinIO/Disk storage |
35
+ | **WebSocketComponent** | `@venizia/ignis/components/websocket` | Native WebSocket support |
36
+
37
+ See the [**Built-in Components Reference**](../../extensions/components/) for detailed documentation.
19
38
 
20
39
  ## Creating a Simple Component
21
40
 
@@ -29,7 +48,7 @@ class NotificationService {
29
48
 
30
49
  // Define a controller
31
50
  @controller({ path: '/notifications' })
32
- class NotificationController extends BaseController {
51
+ class NotificationController extends BaseRestController {
33
52
  constructor(
34
53
  @inject({ key: 'services.NotificationService' })
35
54
  private _notificationService: NotificationService
@@ -65,7 +84,10 @@ export class NotificationComponent extends BaseComponent {
65
84
  | Stage | Method | Description |
66
85
  | :--- | :--- | :--- |
67
86
  | **1. Instantiation** | `constructor()` | Component is created. Define default `bindings` here. |
68
- | **2. Configuration** | `binding()` | Called during startup. Register controllers and resources here. |
87
+ | **2. Init Defaults** | `initDefaultBindings()` | If `initDefault.enable` is `true`, default bindings are registered in the container (only if not already bound). |
88
+ | **3. Configuration** | `binding()` | Called during startup. Register controllers and additional resources here. |
89
+
90
+ The `configure()` method is **idempotent** -- calling it multiple times has no effect after the first call.
69
91
 
70
92
  ## Registering a Component
71
93
 
@@ -82,6 +104,8 @@ export class Application extends BaseApplication {
82
104
  }
83
105
  ```
84
106
 
107
+ Components are bound as **singletons** automatically when registered via `this.component()`.
108
+
85
109
  ## Customizing Component Options
86
110
 
87
111
  Most components accept configuration options. Override them before registration:
@@ -102,7 +126,7 @@ export class Application extends BaseApplication {
102
126
  > **Next Steps:**
103
127
  > - [Creating Components Guide](./components-guide.md) - Step-by-step tutorial for building your own components
104
128
  > - [Components Reference](../../references/base/components.md) - Directory structure, keys, types, constants patterns
105
- > - [Built-in Components](../../references/components/) - Detailed documentation for each component
129
+ > - [Built-in Components](../../extensions/components/) - Detailed documentation for each component
106
130
 
107
131
  ## See Also
108
132
 
@@ -113,10 +137,10 @@ export class Application extends BaseApplication {
113
137
 
114
138
  - **References:**
115
139
  - [BaseComponent API](/references/base/components) - Complete API reference
116
- - [Authentication Component](/references/components/authentication/) - JWT authentication
117
- - [Health Check Component](/references/components/health-check) - Health endpoints
118
- - [Swagger Component](/references/components/swagger) - API documentation
119
- - [Socket.IO Component](/references/components/socket-io/) - WebSocket support
140
+ - [Authentication Component](/extensions/components/authentication/) - JWT authentication
141
+ - [Health Check Component](/extensions/components/health-check) - Health endpoints
142
+ - [Swagger Component](/extensions/components/swagger) - API documentation
143
+ - [Socket.IO Component](/extensions/components/socket-io/) - WebSocket support
120
144
 
121
145
  - **Best Practices:**
122
146
  - [Architectural Patterns](/best-practices/architectural-patterns) - Component design patterns