@venizia/ignis-docs 0.0.1-1

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 (123) hide show
  1. package/mcp-server/dist/common/config.d.ts +27 -0
  2. package/mcp-server/dist/common/config.d.ts.map +1 -0
  3. package/mcp-server/dist/common/config.js +27 -0
  4. package/mcp-server/dist/common/config.js.map +1 -0
  5. package/mcp-server/dist/common/index.d.ts +3 -0
  6. package/mcp-server/dist/common/index.d.ts.map +1 -0
  7. package/mcp-server/dist/common/index.js +19 -0
  8. package/mcp-server/dist/common/index.js.map +1 -0
  9. package/mcp-server/dist/common/paths.d.ts +13 -0
  10. package/mcp-server/dist/common/paths.d.ts.map +1 -0
  11. package/mcp-server/dist/common/paths.js +23 -0
  12. package/mcp-server/dist/common/paths.js.map +1 -0
  13. package/mcp-server/dist/helpers/docs.helper.d.ts +81 -0
  14. package/mcp-server/dist/helpers/docs.helper.d.ts.map +1 -0
  15. package/mcp-server/dist/helpers/docs.helper.js +171 -0
  16. package/mcp-server/dist/helpers/docs.helper.js.map +1 -0
  17. package/mcp-server/dist/helpers/index.d.ts +3 -0
  18. package/mcp-server/dist/helpers/index.d.ts.map +1 -0
  19. package/mcp-server/dist/helpers/index.js +19 -0
  20. package/mcp-server/dist/helpers/index.js.map +1 -0
  21. package/mcp-server/dist/helpers/logger.helper.d.ts +7 -0
  22. package/mcp-server/dist/helpers/logger.helper.d.ts.map +1 -0
  23. package/mcp-server/dist/helpers/logger.helper.js +22 -0
  24. package/mcp-server/dist/helpers/logger.helper.js.map +1 -0
  25. package/mcp-server/dist/index.d.ts +3 -0
  26. package/mcp-server/dist/index.d.ts.map +1 -0
  27. package/mcp-server/dist/index.js +62 -0
  28. package/mcp-server/dist/index.js.map +1 -0
  29. package/mcp-server/dist/tools/base.tool.d.ts +98 -0
  30. package/mcp-server/dist/tools/base.tool.d.ts.map +1 -0
  31. package/mcp-server/dist/tools/base.tool.js +47 -0
  32. package/mcp-server/dist/tools/base.tool.js.map +1 -0
  33. package/mcp-server/dist/tools/get-doc-content.tool.d.ts +30 -0
  34. package/mcp-server/dist/tools/get-doc-content.tool.d.ts.map +1 -0
  35. package/mcp-server/dist/tools/get-doc-content.tool.js +127 -0
  36. package/mcp-server/dist/tools/get-doc-content.tool.js.map +1 -0
  37. package/mcp-server/dist/tools/get-doc-metadata.tool.d.ts +40 -0
  38. package/mcp-server/dist/tools/get-doc-metadata.tool.d.ts.map +1 -0
  39. package/mcp-server/dist/tools/get-doc-metadata.tool.js +121 -0
  40. package/mcp-server/dist/tools/get-doc-metadata.tool.js.map +1 -0
  41. package/mcp-server/dist/tools/index.d.ts +8 -0
  42. package/mcp-server/dist/tools/index.d.ts.map +1 -0
  43. package/mcp-server/dist/tools/index.js +18 -0
  44. package/mcp-server/dist/tools/index.js.map +1 -0
  45. package/mcp-server/dist/tools/list-categories.tool.d.ts +20 -0
  46. package/mcp-server/dist/tools/list-categories.tool.d.ts.map +1 -0
  47. package/mcp-server/dist/tools/list-categories.tool.js +105 -0
  48. package/mcp-server/dist/tools/list-categories.tool.js.map +1 -0
  49. package/mcp-server/dist/tools/list-docs.tool.d.ts +32 -0
  50. package/mcp-server/dist/tools/list-docs.tool.d.ts.map +1 -0
  51. package/mcp-server/dist/tools/list-docs.tool.js +121 -0
  52. package/mcp-server/dist/tools/list-docs.tool.js.map +1 -0
  53. package/mcp-server/dist/tools/search-docs.tool.d.ts +32 -0
  54. package/mcp-server/dist/tools/search-docs.tool.d.ts.map +1 -0
  55. package/mcp-server/dist/tools/search-docs.tool.js +120 -0
  56. package/mcp-server/dist/tools/search-docs.tool.js.map +1 -0
  57. package/package.json +102 -0
  58. package/wiki/get-started/5-minute-quickstart.md +266 -0
  59. package/wiki/get-started/best-practices/api-usage-examples.md +222 -0
  60. package/wiki/get-started/best-practices/architectural-patterns.md +129 -0
  61. package/wiki/get-started/best-practices/code-style-standards.md +122 -0
  62. package/wiki/get-started/best-practices/common-pitfalls.md +136 -0
  63. package/wiki/get-started/best-practices/contribution-workflow.md +145 -0
  64. package/wiki/get-started/best-practices/deployment-strategies.md +121 -0
  65. package/wiki/get-started/best-practices/performance-optimization.md +88 -0
  66. package/wiki/get-started/best-practices/security-guidelines.md +97 -0
  67. package/wiki/get-started/best-practices/troubleshooting-tips.md +100 -0
  68. package/wiki/get-started/building-a-crud-api.md +717 -0
  69. package/wiki/get-started/core-concepts/application.md +168 -0
  70. package/wiki/get-started/core-concepts/components.md +96 -0
  71. package/wiki/get-started/core-concepts/controllers.md +441 -0
  72. package/wiki/get-started/core-concepts/dependency-injection.md +160 -0
  73. package/wiki/get-started/core-concepts/persistent.md +591 -0
  74. package/wiki/get-started/core-concepts/services.md +88 -0
  75. package/wiki/get-started/index.md +65 -0
  76. package/wiki/get-started/mcp-docs-server.md +840 -0
  77. package/wiki/get-started/philosophy.md +123 -0
  78. package/wiki/get-started/prerequisites.md +113 -0
  79. package/wiki/get-started/quickstart.md +382 -0
  80. package/wiki/index.md +48 -0
  81. package/wiki/references/base/application.md +67 -0
  82. package/wiki/references/base/components.md +80 -0
  83. package/wiki/references/base/controllers.md +361 -0
  84. package/wiki/references/base/datasources.md +105 -0
  85. package/wiki/references/base/dependency-injection.md +83 -0
  86. package/wiki/references/base/models.md +104 -0
  87. package/wiki/references/base/repositories.md +118 -0
  88. package/wiki/references/base/services.md +97 -0
  89. package/wiki/references/components/authentication.md +224 -0
  90. package/wiki/references/components/health-check.md +190 -0
  91. package/wiki/references/components/index.md +61 -0
  92. package/wiki/references/components/request-tracker.md +35 -0
  93. package/wiki/references/components/socket-io.md +127 -0
  94. package/wiki/references/components/swagger.md +175 -0
  95. package/wiki/references/helpers/cron.md +94 -0
  96. package/wiki/references/helpers/crypto.md +117 -0
  97. package/wiki/references/helpers/env.md +67 -0
  98. package/wiki/references/helpers/error.md +80 -0
  99. package/wiki/references/helpers/index.md +21 -0
  100. package/wiki/references/helpers/inversion.md +141 -0
  101. package/wiki/references/helpers/logger.md +98 -0
  102. package/wiki/references/helpers/network.md +143 -0
  103. package/wiki/references/helpers/queue.md +131 -0
  104. package/wiki/references/helpers/redis.md +121 -0
  105. package/wiki/references/helpers/socket-io.md +103 -0
  106. package/wiki/references/helpers/storage.md +130 -0
  107. package/wiki/references/helpers/testing.md +115 -0
  108. package/wiki/references/helpers/worker-thread.md +162 -0
  109. package/wiki/references/src-details/core.md +249 -0
  110. package/wiki/references/src-details/dev-configs.md +302 -0
  111. package/wiki/references/src-details/docs.md +61 -0
  112. package/wiki/references/src-details/helpers.md +211 -0
  113. package/wiki/references/src-details/inversion.md +345 -0
  114. package/wiki/references/src-details/mcp-server.md +726 -0
  115. package/wiki/references/utilities/crypto.md +39 -0
  116. package/wiki/references/utilities/date.md +72 -0
  117. package/wiki/references/utilities/index.md +12 -0
  118. package/wiki/references/utilities/module.md +40 -0
  119. package/wiki/references/utilities/parse.md +68 -0
  120. package/wiki/references/utilities/performance.md +64 -0
  121. package/wiki/references/utilities/promise.md +83 -0
  122. package/wiki/references/utilities/request.md +66 -0
  123. package/wiki/references/utilities/schema.md +88 -0
@@ -0,0 +1,162 @@
1
+ # Worker Thread Helper
2
+
3
+ Manage Node.js `worker_threads` for concurrent CPU-bound task execution.
4
+
5
+ ## Quick Reference
6
+
7
+ | Helper | Purpose |
8
+ |--------|---------|
9
+ | **WorkerPoolHelper** | Singleton managing pool of workers (matches CPU cores) |
10
+ | **BaseWorkerHelper** | Create and manage single worker thread lifecycle |
11
+ | **BaseWorkerBusHelper** | Two-way communication via `MessagePort` |
12
+
13
+ ### Use Cases
14
+
15
+ - CPU-intensive calculations
16
+ - Large data processing
17
+ - Parallel computations
18
+ - Video/image processing
19
+
20
+ ### Worker Communication
21
+
22
+ | Pattern | Complexity | Use When |
23
+ |---------|------------|----------|
24
+ | **Simple (parentPort)** | Low | One-way or basic messaging |
25
+ | **WorkerBus (MessageChannel)** | High | Complex two-way communication |
26
+
27
+ ### WorkerPoolHelper Methods
28
+
29
+ | Method | Purpose |
30
+ |--------|---------|
31
+ | `getInstance()` | Get singleton instance |
32
+ | `register({ key, worker })` | Add worker to pool |
33
+ | `unregister({ key })` | Remove and terminate worker |
34
+
35
+ ## `WorkerPoolHelper`
36
+
37
+ The `WorkerPoolHelper` is a singleton that manages the creation, registration, and termination of worker threads.
38
+
39
+ ### Usage
40
+
41
+ ```typescript
42
+ import { WorkerPoolHelper, BaseWorkerHelper } from '@venizia/ignis';
43
+
44
+ const workerPool = WorkerPoolHelper.getInstance();
45
+
46
+ // Create a new worker
47
+ const myWorker = new BaseWorkerHelper({
48
+ identifier: 'my-cpu-intensive-task',
49
+ path: './path/to/my-worker.js',
50
+ options: {
51
+ workerData: { some: 'data' },
52
+ },
53
+ });
54
+
55
+ // Register the worker with the pool
56
+ workerPool.register({ key: 'my-worker-1', worker: myWorker });
57
+
58
+ // Later, to terminate the worker
59
+ workerPool.unregister({ key: 'my-worker-1' });
60
+ ```
61
+
62
+ ## Creating a Worker
63
+
64
+ You can create a worker from the main thread that executes a separate script file.
65
+
66
+ ### Main Thread (`main.ts`)
67
+
68
+ ```typescript
69
+ import { BaseWorkerHelper } from '@venizia/ignis';
70
+ import path from 'node:path';
71
+
72
+ const worker = new BaseWorkerHelper({
73
+ identifier: 'my-worker',
74
+ path: path.resolve(__dirname, './worker.ts'), // Path to the worker script
75
+ options: {
76
+ workerData: { message: 'Hello from main thread!' },
77
+ },
78
+ eventHandlers: {
79
+ onMessage: ({ message }) => {
80
+ console.log('Received message from worker:', message);
81
+ },
82
+ onError: ({ error }) => {
83
+ console.error('Worker error:', error);
84
+ },
85
+ },
86
+ });
87
+ ```
88
+
89
+ ### Worker Thread (`worker.ts`)
90
+
91
+ Inside the worker script, you can perform CPU-intensive tasks and communicate back to the main thread.
92
+
93
+ ```typescript
94
+ import { parentPort, workerData } from 'node:worker_threads';
95
+
96
+ console.log('Worker started with data:', workerData);
97
+
98
+ // Perform a CPU-intensive task
99
+ const result = performHeavyCalculation();
100
+
101
+ // Send the result back to the main thread
102
+ parentPort?.postMessage({ result });
103
+ ```
104
+
105
+ ## `WorkerBus` for Two-Way Communication
106
+
107
+ For more complex scenarios requiring two-way communication, you can use the `WorkerBus` helpers.
108
+
109
+ ### Main Thread (`main.ts`)
110
+
111
+ ```typescript
112
+ // ... (in main thread)
113
+ import { MessageChannel } from 'node:worker_threads';
114
+ import { BaseWorkerBusHelper, ... } from '@venizia/ignis';
115
+
116
+ const { port1, port2 } = new MessageChannel();
117
+
118
+ const worker = new BaseWorkerHelper({
119
+ // ...
120
+ options: {
121
+ workerData: { port: port2 }, // Pass one port to the worker
122
+ transferList: [port2], // Transfer ownership of the port
123
+ },
124
+ });
125
+
126
+ const mainThreadBus = new BaseWorkerBusHelper({
127
+ scope: 'main-bus',
128
+ port: port1,
129
+ busHandler: new BaseWorkerMessageBusHandlerHelper({
130
+ scope: 'main-bus-handler',
131
+ onMessage: ({ message }) => {
132
+ console.log('Main thread received:', message);
133
+ },
134
+ }),
135
+ });
136
+
137
+ mainThreadBus.postMessage({ message: { command: 'start-work' } });
138
+ ```
139
+
140
+ ### Worker Thread (`worker.ts`)
141
+
142
+ ```typescript
143
+ // ... (in worker thread)
144
+ import { workerData } from 'node:worker_threads';
145
+ import { BaseWorkerBusHelper, ... } from '@venizia/ignis';
146
+
147
+ const { port } = workerData;
148
+
149
+ const workerBus = new BaseWorkerBusHelper({
150
+ scope: 'worker-bus',
151
+ port: port,
152
+ busHandler: new BaseWorkerMessageBusHandlerHelper({
153
+ scope: 'worker-bus-handler',
154
+ onMessage: ({ message }) => {
155
+ console.log('Worker received:', message);
156
+ if (message.command === 'start-work') {
157
+ workerBus.postMessage({ message: { status: 'work-done' } });
158
+ }
159
+ },
160
+ }),
161
+ });
162
+ ```
@@ -0,0 +1,249 @@
1
+ # Package: `@venizia/ignis`
2
+
3
+ Detailed breakdown of the core framework directory structure.
4
+
5
+ ## Quick Reference
6
+
7
+ **Package:** Core framework with fundamental building blocks, architectural layers, and modular features.
8
+
9
+ ### Top-Level Directories
10
+
11
+ | Directory | Primary Focus | Key Components |
12
+ |-----------|---------------|----------------|
13
+ | **`base`** | Core architecture | Applications, Controllers, Repositories, Services, Models |
14
+ | **`components`** | Pluggable features | Auth, Swagger, HealthCheck, SocketIO |
15
+ | **`helpers`** | Utilities | Re-exports from `@venizia/ignis-helpers` |
16
+ | **`common`** | Shared code | Constants, bindings, types, environments |
17
+ | **`utilities`** | Pure functions | Crypto, date, parse, performance, schema |
18
+ | **`__tests__`** | Tests | Integration and E2E tests |
19
+
20
+ ## Project Structure Overview
21
+
22
+ Top-level breakdown of the `src` directory:
23
+
24
+ | Folder | Purpose |
25
+ | :--------------- | :--------------------------------------------------------------------------------------------------------------------- |
26
+ | **`__tests__`** | Contains integration and end-to-end tests for the framework's features. |
27
+ | **`base`** | The core building blocks and abstract classes of the framework. This is where the fundamental architecture is defined. |
28
+ | **`common`** | A directory for code that is shared and used across the entire framework. |
29
+ | **`components`** | A collection of ready-to-use, high-level components that can be plugged into an Ignis application. |
30
+ | **`helpers`** | Re-exports all modules from the dedicated `@venizia/ignis-helpers` package. |
31
+ | **`utilities`** | A collection of pure, standalone utility functions. |
32
+
33
+ ---
34
+
35
+ ## Detailed Sections
36
+
37
+ ### `__tests__`
38
+
39
+ This directory is dedicated to the framework's test suite.
40
+
41
+ | File/Folder | Purpose/Key Details |
42
+ | :---------------------- | :------------------------------------------------------------------------------------------------------------------------------- |
43
+ | `jwt/` | Contains test cases specifically for the JWT authentication functionality, demonstrating how tokens are generated and validated. |
44
+ | `jwt/test-cases/jwt.ts` | Example: defines `TestCase001` to check JWT creation. |
45
+
46
+ ### `base`
47
+
48
+ This is the foundational layer of Ignis, defining the core architecture and abstract classes that other parts of the framework extend or implement.
49
+
50
+ #### `base/applications`
51
+
52
+ | File/Folder | Purpose/Key Details |
53
+ | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
54
+ | `abstract.ts` | Defines `AbstractApplication`, the base class for Ignis applications. Handles core server setup (Hono instance, runtime detection for Bun/Node.js), environment validation, and route inspection. Mandates abstract methods for middleware setup and configuration. |
55
+ | `base.ts` | Extends `AbstractApplication` to provide `BaseApplication`, implementing common functionalities like component, controller, service, repository, and datasource registration. Includes default middleware registration (e.g., error handling, favicon, request tracking) and startup information logging. |
56
+ | `types.ts` | Contains interfaces for application configurations (`IApplicationConfigs`), application information (`IApplicationInfo`), and various middleware options (e.g., `ICORSOptions`, `ICSRFOptions`). |
57
+
58
+ #### `base/components`
59
+
60
+ | File/Folder | Purpose/Key Details |
61
+ | :---------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- |
62
+ | `base.ts` | Defines `BaseComponent`, the abstract class for all pluggable components. Manages component-specific bindings and a `configure()` method for setup logic. |
63
+
64
+ #### `base/controllers`
65
+
66
+ | File/Folder | Purpose/Key Details |
67
+ | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
68
+ | `abstract.ts` | Defines `AbstractController`, an abstract class providing core controller functionalities like `getRouteConfigs` for standardizing route configurations, and `registerRoutesFromRegistry()` for automatically registering decorator-based routes. |
69
+ | `base.ts` | Extends `AbstractController` to provide `BaseController`, an abstract class for handling HTTP requests. Integrates with `@hono/zod-openapi` for route definition and OpenAPI schema generation. Key methods include `defineRoute` and `bindRoute`. |
70
+ | `factory/` | Contains the `ControllerFactory` and related helpers for generating controllers. |
71
+ | `factory/controller.ts` | Provides `ControllerFactory` to generate pre-configured CRUD controllers from a given entity and repository. |
72
+ | `factory/definition.ts` | Exports route definition helpers. |
73
+ | `common/` | Contains shared types (`types.ts`) and constants (`constants.ts`) for the controller layer. |
74
+
75
+ #### `base/datasources`
76
+
77
+ | File/Folder | Purpose/Key Details |
78
+ | :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
79
+ | `base.ts` | Contains `AbstractDataSource` and `BaseDataSource`, abstract classes for managing database connections. They define methods for configuration (`configure()`) and retrieving connection strings. |
80
+ | `types.ts` | Defines `IDataSource` interface and `TDataSourceDriver` (e.g., `node-postgres`). |
81
+
82
+ #### `base/helpers`
83
+
84
+ | File/Folder | Purpose/Key Details |
85
+ | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
86
+ | `base.ts` | `BaseHelper` is a generic base class providing common utilities like a logger instance and scope management. Many other helpers and components extend this class. |
87
+
88
+ #### `base/metadata`
89
+
90
+ This directory centralizes the metadata handling for decorators, crucial for Ignis's DI and routing systems.
91
+
92
+ | File/Folder | Purpose/Key Details |
93
+ | :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
94
+ | `injectors.ts` | Defines the `@injectable` and `@inject` decorators for dependency injection. |
95
+ | `persistents.ts` | Contains `@model` and `@datasource` decorators for marking classes as data models or data sources, respectively. |
96
+ | `routes.ts` | Defines the `@controller` decorator for marking classes as API controllers, and the new decorator set (`@api`, `@get`, `@post`, etc.) for defining routes on controller methods. |
97
+
98
+ #### `base/middlewares`
99
+
100
+ A collection of essential, low-level middlewares used by the application.
101
+
102
+ | File/Folder | Purpose/Key Details |
103
+ | :-------------------------------- | :------------------------------------------------------------------------------------------------------------- |
104
+ | `app-error.middleware.ts` | Global error handling middleware that catches `ApplicationError` instances and formats responses consistently. |
105
+ | `emoji-favicon.middleware.ts` | Serves a simple emoji favicon for the application. |
106
+ | `not-found.middleware.ts` | Handles 404 Not Found errors. |
107
+ | `request-normalize.middleware.ts` | Normalizes incoming requests, particularly for parsing JSON bodies. |
108
+ | `request-spy.middleware.ts` | Logs incoming requests and adds a unique request ID for tracing. |
109
+
110
+ #### `base/mixins`
111
+
112
+ Contains mixins to extend the functionality of core classes, particularly `AbstractApplication`.
113
+
114
+ | File/Folder | Purpose/Key Details |
115
+ | :-------------------- | :------------------------------------------------------- |
116
+ | `component.mixin.ts` | Adds `component()` and `registerComponents()` methods. |
117
+ | `controller.mixin.ts` | Adds `controller()` and `registerControllers()` methods. |
118
+ | `repository.mixin.ts` | Adds `dataSource()` and `repository()` methods. |
119
+ | `service.mixin.ts` | Adds `service()` method. |
120
+ | `types.ts` | Defines interfaces for these mixins. |
121
+
122
+ #### `base/models`
123
+
124
+ Defines base classes and utilities for data models, often used with Drizzle ORM.
125
+
126
+ | File/Folder | Purpose/Key Details |
127
+ | :--------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
128
+ | `base.ts` | Contains `BaseEntity`, a base class for models that wrap Drizzle ORM schemas and provide methods for generating Zod schemas for CRUD operations. |
129
+ | `common/` | Contains shared types (`types.ts`) and constants (`constants.ts`) for the model layer, including definitions for `IdType`, `TTableSchemaWithId`, and `SchemaTypes`. |
130
+ | `enrichers/` | Sub-directory for functions that add common fields to Drizzle ORM schemas. |
131
+ | `enrichers/data-type.enricher.ts` | Adds generic data type columns (number, text, byte, JSON, boolean). |
132
+ | `enrichers/id.enricher.ts` | Adds `id` column with number (serial) or string (UUID) types. |
133
+ | `enrichers/principal.enricher.ts` | Adds polymorphic fields for associating with different principal types. |
134
+ | `enrichers/tz.enricher.ts` | Adds `createdAt` and `modifiedAt` timestamp columns. |
135
+ | `enrichers/user-audit.enricher.ts` | Adds `createdBy` and `modifiedBy` fields. |
136
+
137
+ #### `base/providers`
138
+
139
+ | File/Folder | Purpose/Key Details |
140
+ | :---------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
141
+ | `base.ts` | Contains `BaseProvider`, an abstract class for creating custom dependency injection providers. Providers are used for dependencies that require complex instantiation logic. |
142
+
143
+ #### `base/repositories`
144
+
145
+ | File/Folder | Purpose/Key Details |
146
+ | :--------------------- | :----------------------------------------------------------------------------------------------------------------------------------------- |
147
+ | `core/base.ts` | Defines `AbstractRepository`, the abstract base class for all repositories. |
148
+ | `core/readable.ts` | Implements `ReadableRepository` for **read-only** data access. |
149
+ | `core/persistable.ts` | Implements `PersistableRepository`, extending `ReadableRepository` with write capabilities (`create`, `update`, `delete`). |
150
+ | `core/default-crud.ts` | Provides `DefaultCRUDRepository`, the standard full CRUD repository that extends `PersistableRepository`. |
151
+ | `common/types.ts` | Defines interfaces for filters (`TFilter`), WHERE clauses (`TWhere`), and repository operations (`IRepository`, `IPersistableRepository`). |
152
+
153
+ #### `base/services`
154
+
155
+ | File/Folder | Purpose/Key Details |
156
+ | :---------- | :------------------------------------------------------------------------ |
157
+ | `base.ts` | Defines `BaseService`, the abstract base for all business logic services. |
158
+ | `types.ts` | Defines `IService` and `ICrudService` interfaces. |
159
+
160
+ ### `common`
161
+
162
+ This directory holds various shared definitions and constants used throughout the framework.
163
+
164
+ | File/Folder | Purpose/Key Details |
165
+ | :---------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
166
+ | `bindings.ts` | Defines `BindingNamespaces` (e.g., `COMPONENT`, `SERVICE`) and `BindingKeys` (`APPLICATION_INSTANCE`, `APPLICATION_SERVER`) for the dependency injection container. |
167
+ | `constants.ts` | Contains application-wide constants such as `HTTP` methods and status codes, `MimeTypes`, `RuntimeModules` (Bun, Node.js), and `DataTypes`. |
168
+ | `environments.ts` | Defines `Environment` types (e.g., `DEVELOPMENT`, `PRODUCTION`) and `EnvironmentKeys` for structured access to environment variables. |
169
+ | `statuses.ts` | Defines various status constants like `UserStatuses`, `RoleStatuses`, and `MigrationStatuses`. |
170
+ | `types.ts` | Contains general TypeScript utility types like `ValueOrPromise`, `AnyObject`, `IClass`, `TMixinTarget`, and `IProvider`. |
171
+
172
+ ### `components`
173
+
174
+ This directory contains high-level, pluggable components that encapsulate specific features, extending the application's functionality.
175
+
176
+ #### `components/auth/`
177
+
178
+ Provides authentication and authorization features.
179
+
180
+ | File/Folder | Purpose/Key Details |
181
+ | :--------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------- |
182
+ | `authenticate/` | JWT-based authentication. |
183
+ | `authenticate/common/` | Constants, keys, and types for authentication. |
184
+ | `authenticate/component.ts` | `AuthenticateComponent` registers authentication services and controllers. |
185
+ | `authenticate/controllers/factory.ts` | `defineAuthController` creates a pre-configured controller with sign-in, sign-up, change password, and "who am I" routes. |
186
+ | `authenticate/services/jwt-token.service.ts` | `JWTTokenService` handles JWT generation, verification, and payload encryption/decryption. |
187
+ | `authenticate/strategies/` | Authentication strategies, e.g., `JWTAuthenticationStrategy`. |
188
+ | `authenticate/strategies/strategy-registry.ts` | `AuthenticationStrategyRegistry` manages and provides authentication strategies. |
189
+ | `models/` | Data models (entities and requests) for authentication, including `User`, `Role`, `Permission`, `SignInRequestSchema`, `SignUpRequestSchema`, etc. |
190
+
191
+ #### `components/health-check/`
192
+
193
+ Adds a simple `/health` endpoint to the application.
194
+
195
+ | File/Folder | Purpose/Key Details |
196
+ | :-------------- | :------------------------------------------------------------ |
197
+ | `component.ts` | `HealthCheckComponent` registers the `HealthCheckController`. |
198
+ | `controller.ts` | `HealthCheckController` defines the `/health` route. |
199
+
200
+ #### `components/request-tracker/`
201
+
202
+ Logs and traces incoming requests.
203
+
204
+ | File/Folder | Purpose/Key Details |
205
+ | :------------- | :------------------------------------------------------------------------------------------------------ |
206
+ | `component.ts` | `RequestTrackerComponent` integrates `hono/request-id` and `RequestSpyMiddleware` for request tracking. |
207
+
208
+ #### `components/socket-io/`
209
+
210
+ Integrates Socket.IO for real-time communication.
211
+
212
+ | File/Folder | Purpose/Key Details |
213
+ | :------------- | :--------------------------------------------------------------------------------------------------------------- |
214
+ | `component.ts` | `SocketIOComponent` sets up the Socket.IO server, integrates with Redis for scaling, and handles authentication. |
215
+
216
+ #### `components/swagger/`
217
+
218
+ Generates interactive OpenAPI documentation.
219
+
220
+ | File/Folder | Purpose/Key Details |
221
+ | :------------- | :-------------------------------------------------------------------------------------------------------------------------------------- |
222
+ | `component.ts` | `SwaggerComponent` configures Swagger UI using `@hono/zod-openapi` and `@hono/swagger-ui`, generating documentation from route schemas. |
223
+
224
+ ### `helpers`
225
+
226
+ The `helpers` directory has been refactored into its own dedicated package, `@venizia/ignis-helpers`, to improve modularity. The `src/helpers` directory within the core framework now simply re-exports all modules from this new package.
227
+
228
+ | File/Folder | Purpose/Key Details |
229
+ | :---------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------- |
230
+ | `index.ts` | Re-exports all helpers from the `@venizia/ignis-helpers` package, making them available through the core framework for backward compatibility and convenience. |
231
+
232
+ ### `utilities`
233
+
234
+ This directory contains pure, standalone utility functions that perform common, stateless operations.
235
+
236
+ | File/Folder | Purpose/Key Details |
237
+ | :----------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
238
+ | `crypto.utility.ts` | Provides a `hash()` function for cryptographic hashing (SHA256, MD5). |
239
+ | `date.utility.ts` | Date and time manipulation functions (`dayjs` integration, `sleep`, `isWeekday`, `getDateTz`, `hrTime`). |
240
+ | `module.utility.ts` | `validateModule()` to check for module existence at runtime. |
241
+ | `parse.utility.ts` | Functions for type checking (`isInt`, `isFloat`), type conversion (`int`, `float`, `toBoolean`), string/object transformation (`toCamel`, `keysToCamel`), array transformations (`parseArrayToRecordWithKey`, `parseArrayToMapWithKey`), and `getUID()` for unique IDs. |
242
+ | `performance.utility.ts` | Utilities for measuring code execution time (`executeWithPerformanceMeasure`, `getPerformanceCheckpoint`, `getExecutedPerformance`). |
243
+ | `promise.utility.ts` | Helper functions for Promises (`executePromiseWithLimit`, `isPromiseLike`, `transformValueOrPromise`, `getDeepProperty`). |
244
+ | `request.utility.ts` | Utilities for handling HTTP request data, such as `parseMultipartBody` for multipart form data. |
245
+ | `schema.utility.ts` | Helper functions and predefined schemas for `zod` and `@hono/zod-openapi` (`jsonContent`, `jsonResponse`, `requiredString`, `AnyObjectSchema`, `IdParamsSchema`, `UUIDParamsSchema`). |
246
+
247
+ ---
248
+
249
+ This detailed breakdown illustrates the modular and layered design of the Ignis framework, emphasizing its extensibility and adherence to robust architectural patterns.