@venizia/ignis-docs 0.0.1-1 → 0.0.1-10
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.
- package/LICENSE.md +102 -0
- package/README.md +459 -0
- package/dist/mcp-server/common/config.d.ts +64 -0
- package/dist/mcp-server/common/config.d.ts.map +1 -0
- package/dist/mcp-server/common/config.js +82 -0
- package/dist/mcp-server/common/config.js.map +1 -0
- package/dist/mcp-server/common/index.d.ts +3 -0
- package/dist/mcp-server/common/index.d.ts.map +1 -0
- package/dist/mcp-server/common/index.js.map +1 -0
- package/dist/mcp-server/common/paths.d.ts.map +1 -0
- package/{mcp-server/dist → dist/mcp-server}/common/paths.js +13 -11
- package/dist/mcp-server/common/paths.js.map +1 -0
- package/{mcp-server/dist → dist/mcp-server}/helpers/docs.helper.d.ts +5 -5
- package/dist/mcp-server/helpers/docs.helper.d.ts.map +1 -0
- package/{mcp-server/dist → dist/mcp-server}/helpers/docs.helper.js +38 -34
- package/dist/mcp-server/helpers/docs.helper.js.map +1 -0
- package/dist/mcp-server/helpers/github.helper.d.ts +37 -0
- package/dist/mcp-server/helpers/github.helper.d.ts.map +1 -0
- package/dist/mcp-server/helpers/github.helper.js +100 -0
- package/dist/mcp-server/helpers/github.helper.js.map +1 -0
- package/dist/mcp-server/helpers/index.d.ts +4 -0
- package/dist/mcp-server/helpers/index.d.ts.map +1 -0
- package/{mcp-server/dist → dist/mcp-server}/helpers/index.js +1 -0
- package/dist/mcp-server/helpers/index.js.map +1 -0
- package/dist/mcp-server/helpers/logger.helper.d.ts.map +1 -0
- package/dist/mcp-server/helpers/logger.helper.js.map +1 -0
- package/{mcp-server/dist → dist/mcp-server}/index.d.ts.map +1 -1
- package/dist/mcp-server/index.js +90 -0
- package/dist/mcp-server/index.js.map +1 -0
- package/{mcp-server/dist → dist/mcp-server}/tools/base.tool.d.ts +8 -12
- package/dist/mcp-server/tools/base.tool.d.ts.map +1 -0
- package/{mcp-server/dist → dist/mcp-server}/tools/base.tool.js +3 -5
- package/dist/mcp-server/tools/base.tool.js.map +1 -0
- package/{mcp-server/dist/tools/get-doc-content.tool.d.ts → dist/mcp-server/tools/docs/get-document-content.tool.d.ts} +13 -17
- package/dist/mcp-server/tools/docs/get-document-content.tool.d.ts.map +1 -0
- package/{mcp-server/dist/tools/get-doc-content.tool.js → dist/mcp-server/tools/docs/get-document-content.tool.js} +20 -22
- package/dist/mcp-server/tools/docs/get-document-content.tool.js.map +1 -0
- package/{mcp-server/dist/tools/get-doc-metadata.tool.d.ts → dist/mcp-server/tools/docs/get-document-metadata.tool.d.ts} +21 -25
- package/dist/mcp-server/tools/docs/get-document-metadata.tool.d.ts.map +1 -0
- package/{mcp-server/dist/tools/get-doc-metadata.tool.js → dist/mcp-server/tools/docs/get-document-metadata.tool.js} +35 -27
- package/dist/mcp-server/tools/docs/get-document-metadata.tool.js.map +1 -0
- package/dist/mcp-server/tools/docs/get-package-overview.tool.d.ts +50 -0
- package/dist/mcp-server/tools/docs/get-package-overview.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/docs/get-package-overview.tool.js +221 -0
- package/dist/mcp-server/tools/docs/get-package-overview.tool.js.map +1 -0
- package/dist/mcp-server/tools/docs/index.d.ts +7 -0
- package/dist/mcp-server/tools/docs/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/docs/index.js +23 -0
- package/dist/mcp-server/tools/docs/index.js.map +1 -0
- package/{mcp-server/dist/tools → dist/mcp-server/tools/docs}/list-categories.tool.d.ts +3 -3
- package/dist/mcp-server/tools/docs/list-categories.tool.d.ts.map +1 -0
- package/{mcp-server/dist/tools → dist/mcp-server/tools/docs}/list-categories.tool.js +10 -9
- package/dist/mcp-server/tools/docs/list-categories.tool.js.map +1 -0
- package/{mcp-server/dist/tools/list-docs.tool.d.ts → dist/mcp-server/tools/docs/list-documents.tool.d.ts} +5 -5
- package/dist/mcp-server/tools/docs/list-documents.tool.d.ts.map +1 -0
- package/{mcp-server/dist/tools/list-docs.tool.js → dist/mcp-server/tools/docs/list-documents.tool.js} +15 -14
- package/dist/mcp-server/tools/docs/list-documents.tool.js.map +1 -0
- package/{mcp-server/dist/tools/search-docs.tool.d.ts → dist/mcp-server/tools/docs/search-documents.tool.d.ts} +23 -19
- package/dist/mcp-server/tools/docs/search-documents.tool.d.ts.map +1 -0
- package/{mcp-server/dist/tools/search-docs.tool.js → dist/mcp-server/tools/docs/search-documents.tool.js} +29 -25
- package/dist/mcp-server/tools/docs/search-documents.tool.js.map +1 -0
- package/dist/mcp-server/tools/github/index.d.ts +5 -0
- package/dist/mcp-server/tools/github/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/github/index.js +21 -0
- package/dist/mcp-server/tools/github/index.js.map +1 -0
- package/dist/mcp-server/tools/github/list-project-files.tool.d.ts +28 -0
- package/dist/mcp-server/tools/github/list-project-files.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/github/list-project-files.tool.js +98 -0
- package/dist/mcp-server/tools/github/list-project-files.tool.js.map +1 -0
- package/dist/mcp-server/tools/github/search-code.tool.d.ts +42 -0
- package/dist/mcp-server/tools/github/search-code.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/github/search-code.tool.js +194 -0
- package/dist/mcp-server/tools/github/search-code.tool.js.map +1 -0
- package/dist/mcp-server/tools/github/verify-dependencies.tool.d.ts +55 -0
- package/dist/mcp-server/tools/github/verify-dependencies.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/github/verify-dependencies.tool.js +167 -0
- package/dist/mcp-server/tools/github/verify-dependencies.tool.js.map +1 -0
- package/dist/mcp-server/tools/github/view-source-file.tool.d.ts +26 -0
- package/dist/mcp-server/tools/github/view-source-file.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/github/view-source-file.tool.js +91 -0
- package/dist/mcp-server/tools/github/view-source-file.tool.js.map +1 -0
- package/dist/mcp-server/tools/index.d.ts +4 -0
- package/dist/mcp-server/tools/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/index.js +22 -0
- package/dist/mcp-server/tools/index.js.map +1 -0
- package/package.json +46 -23
- package/wiki/changelogs/2025-12-16-initial-architecture.md +145 -0
- package/wiki/changelogs/2025-12-16-model-repo-datasource-refactor.md +300 -0
- package/wiki/changelogs/2025-12-17-refactor.md +90 -0
- package/wiki/changelogs/2025-12-18-performance-optimizations.md +130 -0
- package/wiki/changelogs/2025-12-18-repository-validation-security.md +249 -0
- package/wiki/changelogs/index.md +33 -0
- package/wiki/changelogs/planned-transaction-support.md +216 -0
- package/wiki/changelogs/template.md +123 -0
- package/wiki/get-started/5-minute-quickstart.md +1 -1
- package/wiki/get-started/best-practices/api-usage-examples.md +54 -8
- package/wiki/get-started/best-practices/architectural-patterns.md +43 -2
- package/wiki/get-started/best-practices/code-style-standards.md +41 -0
- package/wiki/get-started/best-practices/common-pitfalls.md +5 -3
- package/wiki/get-started/best-practices/contribution-workflow.md +40 -6
- package/wiki/get-started/best-practices/data-modeling.md +177 -0
- package/wiki/get-started/best-practices/security-guidelines.md +3 -1
- package/wiki/get-started/building-a-crud-api.md +63 -78
- package/wiki/get-started/core-concepts/components.md +4 -2
- package/wiki/get-started/core-concepts/controllers.md +14 -14
- package/wiki/get-started/core-concepts/dependency-injection.md +13 -1
- package/wiki/get-started/core-concepts/persistent.md +383 -431
- package/wiki/get-started/core-concepts/services.md +21 -27
- package/wiki/get-started/mcp-docs-server.md +130 -32
- package/wiki/get-started/philosophy.md +198 -25
- package/wiki/get-started/quickstart.md +1 -1
- package/wiki/public/logo.svg +1 -0
- package/wiki/references/base/application.md +5 -5
- package/wiki/references/base/components.md +1 -1
- package/wiki/references/base/controllers.md +43 -17
- package/wiki/references/base/datasources.md +195 -33
- package/wiki/references/base/dependency-injection.md +8 -7
- package/wiki/references/base/models.md +713 -25
- package/wiki/references/base/repositories.md +475 -22
- package/wiki/references/base/services.md +2 -2
- package/wiki/references/components/authentication.md +228 -10
- package/wiki/references/components/health-check.md +1 -1
- package/wiki/references/components/index.md +4 -2
- package/wiki/references/components/static-asset.md +1289 -0
- package/wiki/references/components/swagger.md +1 -1
- package/wiki/references/helpers/error.md +2 -2
- package/wiki/references/helpers/inversion.md +29 -14
- package/wiki/references/helpers/storage.md +538 -11
- package/wiki/references/src-details/core.md +21 -6
- package/wiki/references/src-details/docs.md +19 -9
- package/wiki/references/src-details/inversion.md +4 -4
- package/wiki/references/src-details/mcp-server.md +185 -234
- package/wiki/references/utilities/index.md +1 -1
- package/wiki/references/utilities/request.md +162 -3
- package/mcp-server/dist/common/config.d.ts +0 -27
- package/mcp-server/dist/common/config.d.ts.map +0 -1
- package/mcp-server/dist/common/config.js +0 -27
- package/mcp-server/dist/common/config.js.map +0 -1
- package/mcp-server/dist/common/index.d.ts +0 -3
- package/mcp-server/dist/common/index.d.ts.map +0 -1
- package/mcp-server/dist/common/index.js.map +0 -1
- package/mcp-server/dist/common/paths.d.ts.map +0 -1
- package/mcp-server/dist/common/paths.js.map +0 -1
- package/mcp-server/dist/helpers/docs.helper.d.ts.map +0 -1
- package/mcp-server/dist/helpers/docs.helper.js.map +0 -1
- package/mcp-server/dist/helpers/index.d.ts +0 -3
- package/mcp-server/dist/helpers/index.d.ts.map +0 -1
- package/mcp-server/dist/helpers/index.js.map +0 -1
- package/mcp-server/dist/helpers/logger.helper.d.ts.map +0 -1
- package/mcp-server/dist/helpers/logger.helper.js.map +0 -1
- package/mcp-server/dist/index.js +0 -62
- package/mcp-server/dist/index.js.map +0 -1
- package/mcp-server/dist/tools/base.tool.d.ts.map +0 -1
- package/mcp-server/dist/tools/base.tool.js.map +0 -1
- package/mcp-server/dist/tools/get-doc-content.tool.d.ts.map +0 -1
- package/mcp-server/dist/tools/get-doc-content.tool.js.map +0 -1
- package/mcp-server/dist/tools/get-doc-metadata.tool.d.ts.map +0 -1
- package/mcp-server/dist/tools/get-doc-metadata.tool.js.map +0 -1
- package/mcp-server/dist/tools/index.d.ts +0 -8
- package/mcp-server/dist/tools/index.d.ts.map +0 -1
- package/mcp-server/dist/tools/index.js +0 -18
- package/mcp-server/dist/tools/index.js.map +0 -1
- package/mcp-server/dist/tools/list-categories.tool.d.ts.map +0 -1
- package/mcp-server/dist/tools/list-categories.tool.js.map +0 -1
- package/mcp-server/dist/tools/list-docs.tool.d.ts.map +0 -1
- package/mcp-server/dist/tools/list-docs.tool.js.map +0 -1
- package/mcp-server/dist/tools/search-docs.tool.d.ts.map +0 -1
- package/mcp-server/dist/tools/search-docs.tool.js.map +0 -1
- /package/{mcp-server/dist → dist/mcp-server}/common/index.js +0 -0
- /package/{mcp-server/dist → dist/mcp-server}/common/paths.d.ts +0 -0
- /package/{mcp-server/dist → dist/mcp-server}/helpers/logger.helper.d.ts +0 -0
- /package/{mcp-server/dist → dist/mcp-server}/helpers/logger.helper.js +0 -0
- /package/{mcp-server/dist → dist/mcp-server}/index.d.ts +0 -0
|
@@ -2,28 +2,107 @@
|
|
|
2
2
|
|
|
3
3
|
Ignis combines the structured, enterprise-grade development experience of **LoopBack 4** with the speed and simplicity of **Hono**.
|
|
4
4
|
|
|
5
|
-
## The
|
|
5
|
+
## The Landscape
|
|
6
6
|
|
|
7
|
-
When building REST APIs with Node.js/Bun, developers
|
|
7
|
+
When building REST APIs with Node.js/Bun, developers choose from three categories of frameworks, each with genuine strengths:
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|--------|-------------------|----------------------|-----------|
|
|
11
|
-
| **Examples** | Express, Hono, Fastify | NestJS, LoopBack | **Ignis** |
|
|
12
|
-
| **Performance** | ⚡ Very fast | 🐌 Slower | ⚡ Very fast (Hono) |
|
|
13
|
-
| **Architecture** | ❌ No structure | ✅ Structured | ✅ Structured |
|
|
14
|
-
| **Learning Curve** | ✅ Easy | ❌ Steep | ✅ Gradual |
|
|
15
|
-
| **Dependency Injection** | ❌ Manual | ✅ Built-in | ✅ Built-in |
|
|
16
|
-
| **Boilerplate** | ✅ Minimal | ❌ Heavy | ✅ Moderate |
|
|
17
|
-
| **Best For** | Prototypes, tiny APIs | Large enterprise apps | Growing APIs, teams |
|
|
9
|
+
### Framework Categories
|
|
18
10
|
|
|
19
|
-
|
|
11
|
+
| Category | Examples | Philosophy |
|
|
12
|
+
|----------|----------|------------|
|
|
13
|
+
| **Minimal** | Express, Hono, Fastify, Koa | Freedom, speed, flexibility |
|
|
14
|
+
| **Enterprise** | NestJS, LoopBack 4, AdonisJS | Structure, patterns, conventions |
|
|
15
|
+
| **Balanced** | Ignis, Ts.ED | Structure with lighter footprint |
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
## Honest Comparison
|
|
22
18
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
### Performance & Runtime
|
|
20
|
+
|
|
21
|
+
| Framework | Requests/sec | Startup Time | Memory | Multi-Runtime |
|
|
22
|
+
|-----------|-------------|--------------|--------|---------------|
|
|
23
|
+
| **Hono** | ~150k | ~10ms | ~20MB | ✅ Bun, Node, Deno, CF Workers |
|
|
24
|
+
| **Fastify** | ~80k | ~50ms | ~40MB | Node only |
|
|
25
|
+
| **Express** | ~15k | ~100ms | ~50MB | Node only |
|
|
26
|
+
| **NestJS** | ~25k | ~500ms | ~100MB | Node (Bun experimental) |
|
|
27
|
+
| **LoopBack 4** | ~20k | ~800ms | ~120MB | Node only |
|
|
28
|
+
| **Ignis** | ~140k | ~30ms | ~30MB | ✅ Bun, Node |
|
|
29
|
+
|
|
30
|
+
*Benchmarks are approximate and vary by use case.*
|
|
31
|
+
|
|
32
|
+
### Developer Experience
|
|
33
|
+
|
|
34
|
+
| Aspect | Minimal (Hono/Express) | Enterprise (NestJS/LoopBack) | Ignis |
|
|
35
|
+
|--------|------------------------|------------------------------|-------|
|
|
36
|
+
| **Setup Time** | 5 minutes | 30+ minutes | 10 minutes |
|
|
37
|
+
| **Learning Curve** | Low | High | Medium |
|
|
38
|
+
| **Boilerplate** | Minimal | Heavy | Moderate |
|
|
39
|
+
| **Type Safety** | Manual | Excellent | Excellent |
|
|
40
|
+
| **IDE Support** | Basic | Excellent | Good |
|
|
41
|
+
| **Documentation** | Good | Excellent | Growing |
|
|
42
|
+
|
|
43
|
+
### Architecture & Patterns
|
|
44
|
+
|
|
45
|
+
| Pattern | Minimal | Enterprise | Ignis |
|
|
46
|
+
|---------|---------|------------|-------|
|
|
47
|
+
| **Dependency Injection** | ❌ Manual/3rd party | ✅ Built-in (complex) | ✅ Built-in (simple) |
|
|
48
|
+
| **Layered Architecture** | ❌ DIY | ✅ Enforced | ✅ Guided |
|
|
49
|
+
| **Repository Pattern** | ❌ DIY | ✅ Built-in | ✅ Built-in |
|
|
50
|
+
| **Validation** | ❌ 3rd party | ✅ Built-in | ✅ Built-in (Zod) |
|
|
51
|
+
| **OpenAPI/Swagger** | ❌ 3rd party | ✅ Built-in | ✅ Built-in |
|
|
52
|
+
| **Authentication** | ❌ DIY | ✅ Modules available | ✅ Built-in component |
|
|
53
|
+
|
|
54
|
+
### Ecosystem & Maturity
|
|
55
|
+
|
|
56
|
+
| Aspect | Minimal (Hono) | Enterprise (NestJS) | Ignis |
|
|
57
|
+
|--------|----------------|---------------------|-------|
|
|
58
|
+
| **Community Size** | Growing fast | Very large | Small |
|
|
59
|
+
| **npm Downloads** | ~500k/week | ~3M/week | New |
|
|
60
|
+
| **Stack Overflow** | Limited | Extensive | Limited |
|
|
61
|
+
| **Third-party Modules** | Middleware-based | Rich ecosystem | Growing |
|
|
62
|
+
| **Production Battle-tested** | Yes | Yes | Emerging |
|
|
63
|
+
| **Corporate Backing** | Cloudflare | Trilon | Independent |
|
|
64
|
+
|
|
65
|
+
### Flexibility vs Convention
|
|
66
|
+
|
|
67
|
+
| Aspect | Minimal | Enterprise | Ignis |
|
|
68
|
+
|--------|---------|------------|-------|
|
|
69
|
+
| **Project Structure** | Total freedom | Strict conventions | Guided conventions |
|
|
70
|
+
| **ORM Choice** | Any | TypeORM/Prisma preferred | Drizzle (flexible) |
|
|
71
|
+
| **Testing Approach** | Any | Jest recommended | Any |
|
|
72
|
+
| **Middleware System** | Simple | Complex interceptors | Hono middleware |
|
|
73
|
+
| **Customization** | Unlimited | Plugin-based | Component-based |
|
|
74
|
+
|
|
75
|
+
## The Middle Ground: Where Ignis Fits
|
|
76
|
+
|
|
77
|
+
### What Each Approach Excels At
|
|
78
|
+
|
|
79
|
+
**Minimal Frameworks (Hono, Express, Fastify):**
|
|
80
|
+
- ✅ Maximum performance
|
|
81
|
+
- ✅ Complete freedom in architecture
|
|
82
|
+
- ✅ Fastest prototyping
|
|
83
|
+
- ✅ Smallest bundle size
|
|
84
|
+
- ✅ Edge/serverless deployments
|
|
85
|
+
- ⚠️ Architecture decisions left to developer
|
|
86
|
+
- ⚠️ Patterns must be implemented manually
|
|
87
|
+
|
|
88
|
+
**Enterprise Frameworks (NestJS, LoopBack):**
|
|
89
|
+
- ✅ Battle-tested patterns
|
|
90
|
+
- ✅ Comprehensive documentation
|
|
91
|
+
- ✅ Large community & ecosystem
|
|
92
|
+
- ✅ Excellent for large teams
|
|
93
|
+
- ✅ Strong conventions prevent chaos
|
|
94
|
+
- ⚠️ Higher resource consumption
|
|
95
|
+
- ⚠️ Steeper learning curve
|
|
96
|
+
- ⚠️ More boilerplate
|
|
97
|
+
|
|
98
|
+
**Ignis (The Middle Ground):**
|
|
99
|
+
- ✅ Enterprise patterns without the weight
|
|
100
|
+
- ✅ Hono's performance foundation
|
|
101
|
+
- ✅ Gradual complexity adoption
|
|
102
|
+
- ✅ TypeScript-first with Zod validation
|
|
103
|
+
- ⚠️ Smaller community (new framework)
|
|
104
|
+
- ⚠️ Less documentation than mature frameworks
|
|
105
|
+
- ⚠️ Fewer third-party integrations
|
|
27
106
|
|
|
28
107
|
## Inspired By The Best
|
|
29
108
|
|
|
@@ -102,17 +181,111 @@ Ignis = LoopBack patterns + Hono performance:
|
|
|
102
181
|
- Type-safe database operations
|
|
103
182
|
- Automatic validation
|
|
104
183
|
|
|
184
|
+
## Choose the Right Tool
|
|
185
|
+
|
|
186
|
+
### Use Hono/Fastify/Express When:
|
|
187
|
+
|
|
188
|
+
| Scenario | Why It's Better |
|
|
189
|
+
|----------|-----------------|
|
|
190
|
+
| Building a simple webhook handler | No structure overhead needed |
|
|
191
|
+
| Edge/serverless functions | Minimal cold start, tiny bundle |
|
|
192
|
+
| Rapid prototyping | Get something running in minutes |
|
|
193
|
+
| Microservices with 1-5 endpoints | Structure adds unnecessary complexity |
|
|
194
|
+
| You want maximum control | No conventions to follow |
|
|
195
|
+
| Learning web development | Simpler mental model |
|
|
196
|
+
|
|
197
|
+
### Use NestJS/LoopBack When:
|
|
198
|
+
|
|
199
|
+
| Scenario | Why It's Better |
|
|
200
|
+
|----------|-----------------|
|
|
201
|
+
| Large team (10+ developers) | Strong conventions prevent chaos |
|
|
202
|
+
| Enterprise with strict standards | Mature, battle-tested, auditable |
|
|
203
|
+
| Need extensive ecosystem | Many official and community modules |
|
|
204
|
+
| Complex microservices architecture | Built-in support for messaging, CQRS |
|
|
205
|
+
| Hiring developers easily | Large talent pool familiar with it |
|
|
206
|
+
| Long-term support is critical | Corporate backing, LTS versions |
|
|
207
|
+
|
|
208
|
+
### Use Ignis When:
|
|
209
|
+
|
|
210
|
+
| Scenario | Why It's Better |
|
|
211
|
+
|----------|-----------------|
|
|
212
|
+
| Medium-sized API (10-100 endpoints) | Right balance of structure and speed |
|
|
213
|
+
| Small team wanting patterns | DI without enterprise complexity |
|
|
214
|
+
| Performance is critical | Hono's speed with structure |
|
|
215
|
+
| Coming from LoopBack/NestJS | Familiar patterns, lighter weight |
|
|
216
|
+
| Bun-first development | Native Bun support |
|
|
217
|
+
| Growing project | Start simple, add complexity gradually |
|
|
218
|
+
|
|
105
219
|
## The Trade-off
|
|
106
220
|
|
|
107
|
-
|
|
108
|
-
|----------|-------------|
|
|
109
|
-
| Clear architecture | ~100 lines setup boilerplate |
|
|
110
|
-
| Built-in DI, validation, docs | Learning curve for patterns |
|
|
111
|
-
| Faster for medium/large projects | Slightly more abstraction than Hono |
|
|
112
|
-
| Easier testing | Initial time investment |
|
|
113
|
-
| Team scalability | Convention over total freedom |
|
|
221
|
+
Every choice has trade-offs. Here's an honest look:
|
|
114
222
|
|
|
115
|
-
|
|
223
|
+
### What You Gain with Ignis
|
|
224
|
+
|
|
225
|
+
| Benefit | Compared To |
|
|
226
|
+
|---------|-------------|
|
|
227
|
+
| ~5x faster than NestJS | Enterprise frameworks |
|
|
228
|
+
| Built-in DI, validation, OpenAPI | Minimal frameworks |
|
|
229
|
+
| Structured codebase | DIY architecture |
|
|
230
|
+
| Easier testing with DI | Manual mocking |
|
|
231
|
+
| Team-friendly patterns | Individual coding styles |
|
|
232
|
+
|
|
233
|
+
### What You Give Up with Ignis
|
|
234
|
+
|
|
235
|
+
| Trade-off | Compared To |
|
|
236
|
+
|-----------|-------------|
|
|
237
|
+
| ~10% slower than raw Hono | Minimal frameworks |
|
|
238
|
+
| Smaller community | NestJS/Express |
|
|
239
|
+
| Less documentation | Mature frameworks |
|
|
240
|
+
| Learning curve for patterns | No-structure approach |
|
|
241
|
+
| Convention requirements | Total freedom |
|
|
242
|
+
|
|
243
|
+
### Honest Assessment
|
|
244
|
+
|
|
245
|
+
| Aspect | Ignis Reality |
|
|
246
|
+
|--------|---------------|
|
|
247
|
+
| **Maturity** | New framework, evolving API |
|
|
248
|
+
| **Community** | Small but growing |
|
|
249
|
+
| **Documentation** | Good but not comprehensive |
|
|
250
|
+
| **Production Use** | Early adopters only |
|
|
251
|
+
| **Breaking Changes** | Possible before v1.0 |
|
|
252
|
+
| **Support** | Community-driven |
|
|
253
|
+
|
|
254
|
+
**Bottom line:** Ignis is ideal for developers who want enterprise patterns without enterprise overhead. If you need battle-tested stability and extensive community support, consider NestJS. If you need maximum simplicity, stick with Hono.
|
|
255
|
+
|
|
256
|
+
## Migration Paths
|
|
257
|
+
|
|
258
|
+
### From Hono to Ignis
|
|
259
|
+
|
|
260
|
+
If your Hono project grows complex:
|
|
261
|
+
|
|
262
|
+
```
|
|
263
|
+
1. Add Ignis as dependency
|
|
264
|
+
2. Wrap existing Hono app with Ignis Application
|
|
265
|
+
3. Gradually introduce DI for new features
|
|
266
|
+
4. Migrate routes to controllers over time
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### From NestJS to Ignis
|
|
270
|
+
|
|
271
|
+
If you want better performance:
|
|
272
|
+
|
|
273
|
+
```
|
|
274
|
+
1. Controllers → Ignis Controllers (similar decorators)
|
|
275
|
+
2. Services → Ignis Services (same pattern)
|
|
276
|
+
3. Repositories → Ignis Repositories (Drizzle instead of TypeORM)
|
|
277
|
+
4. Modules → Ignis Components (simpler structure)
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### From Ignis to NestJS
|
|
281
|
+
|
|
282
|
+
If you outgrow Ignis:
|
|
283
|
+
|
|
284
|
+
```
|
|
285
|
+
1. Patterns are similar - migration is straightforward
|
|
286
|
+
2. Main changes: ORM, module system, interceptors
|
|
287
|
+
3. DI concepts transfer directly
|
|
288
|
+
```
|
|
116
289
|
|
|
117
290
|
## Next Steps
|
|
118
291
|
|
|
@@ -265,7 +265,7 @@ export class HelloController extends BaseController {
|
|
|
265
265
|
})
|
|
266
266
|
sayHello(c: Context) {
|
|
267
267
|
// This looks just like Hono! Because it IS Hono under the hood.
|
|
268
|
-
return c.json({ message: 'Hello, World!' });
|
|
268
|
+
return c.json({ message: 'Hello, World!' }, HTTP.ResultCodes.RS_2.Ok);
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
// You can add more routes here:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 92.27 122.88" style="enable-background:new 0 0 92.27 122.88" xml:space="preserve"><style type="text/css">.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#EC6F59;} .st1{fill-rule:evenodd;clip-rule:evenodd;fill:#FAD15C;}</style><g><path class="st0" d="M18.61,54.89C15.7,28.8,30.94,10.45,59.52,0C42.02,22.71,74.44,47.31,76.23,70.89 c4.19-7.15,6.57-16.69,7.04-29.45c21.43,33.62,3.66,88.57-43.5,80.67c-4.33-0.72-8.5-2.09-12.3-4.13C10.27,108.8,0,88.79,0,69.68 C0,57.5,5.21,46.63,11.95,37.99C12.85,46.45,14.77,52.76,18.61,54.89L18.61,54.89z"/><path class="st1" d="M33.87,92.58c-4.86-12.55-4.19-32.82,9.42-39.93c0.1,23.3,23.05,26.27,18.8,51.14 c3.92-4.44,5.9-11.54,6.25-17.15c6.22,14.24,1.34,25.63-7.53,31.43c-26.97,17.64-50.19-18.12-34.75-37.72 C26.53,84.73,31.89,91.49,33.87,92.58L33.87,92.58z"/></g></svg>
|
|
@@ -37,11 +37,11 @@ Extends `AbstractApplication` with concrete lifecycle implementations and resour
|
|
|
37
37
|
|
|
38
38
|
| Method | DI Binding Key Convention |
|
|
39
39
|
| :--- | :--- |
|
|
40
|
-
| `component(MyComponent)` | `components.MyComponent` |
|
|
41
|
-
| `controller(MyController)` | `controllers.MyController` |
|
|
42
|
-
| `service(MyService)` | `services.MyService` |
|
|
43
|
-
| `repository(MyRepository)`| `repositories.MyRepository` |
|
|
44
|
-
| `dataSource(MyDataSource)`| `datasources.MyDataSource` |
|
|
40
|
+
| `component(MyComponent, opts?)` | `components.MyComponent` (default) or custom key via `opts.binding` |
|
|
41
|
+
| `controller(MyController, opts?)` | `controllers.MyController` (default) or custom key via `opts.binding` |
|
|
42
|
+
| `service(MyService, opts?)` | `services.MyService` (default) or custom key via `opts.binding` |
|
|
43
|
+
| `repository(MyRepository, opts?)`| `repositories.MyRepository` (default) or custom key via `opts.binding` |
|
|
44
|
+
| `dataSource(MyDataSource, opts?)`| `datasources.MyDataSource` (default) or custom key via `opts.binding` |
|
|
45
45
|
|
|
46
46
|
### `initialize()` Method Flow
|
|
47
47
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Deep Dive: Components
|
|
2
2
|
|
|
3
|
-
Technical reference for `BaseComponent
|
|
3
|
+
Technical reference for `BaseComponent`—the foundation for creating reusable, pluggable features in Ignis. Components are powerful containers that can group together multiple providers, services, controllers, repositories, and even entire mini-applications into a single, redistributable module.
|
|
4
4
|
|
|
5
5
|
**File:** `packages/core/src/base/components/base.ts`
|
|
6
6
|
|
|
@@ -65,7 +65,7 @@ export class MyFeatureController extends BaseController {
|
|
|
65
65
|
|
|
66
66
|
@api({ configs: MyRouteConfig })
|
|
67
67
|
getData(c: TRouteContext<typeof MyRouteConfig>) { // Return type is automatically inferred and validated
|
|
68
|
-
return c.json({ success: true });
|
|
68
|
+
return c.json({ success: true }, HTTP.ResultCodes.RS_2.Ok);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
```
|
|
@@ -83,7 +83,7 @@ For convenience, `Ignis` provides decorator shortcuts for each HTTP method: Thes
|
|
|
83
83
|
**Example using `@get` and `@post` with type inference:**
|
|
84
84
|
|
|
85
85
|
```typescript
|
|
86
|
-
import { get, post, z, jsonContent, jsonResponse, Authentication, TRouteContext } from '@venizia/ignis';
|
|
86
|
+
import { get, post, z, jsonContent, jsonResponse, Authentication, TRouteContext, HTTP } from '@venizia/ignis';
|
|
87
87
|
|
|
88
88
|
// Define route configs as const for full type inference
|
|
89
89
|
const USER_ROUTES = {
|
|
@@ -125,20 +125,20 @@ const USER_ROUTES = {
|
|
|
125
125
|
|
|
126
126
|
@get({ configs: USER_ROUTES.listUsers })
|
|
127
127
|
getAllUsers(c: TRouteContext<typeof USER_ROUTES.listUsers>) { // Return type is automatically inferred
|
|
128
|
-
return c.json([{ id: '1', name: 'John Doe' }]);
|
|
128
|
+
return c.json([{ id: '1', name: 'John Doe' }], HTTP.ResultCodes.RS_2.Ok);
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
@get({ configs: USER_ROUTES.getUser })
|
|
132
132
|
getUserById(c: TRouteContext<typeof USER_ROUTES.getUser>) { // Return type is automatically inferred
|
|
133
133
|
const { id } = c.req.valid('param'); // id is typed as string
|
|
134
|
-
return c.json({ id, name: 'John Doe' });
|
|
134
|
+
return c.json({ id, name: 'John Doe' }, HTTP.ResultCodes.RS_2.Ok);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
@post({ configs: USER_ROUTES.createUser })
|
|
138
138
|
createUser(c: TRouteContext<typeof USER_ROUTES.createUser>) { // Return type is automatically inferred
|
|
139
139
|
const { name } = c.req.valid('json'); // name is typed as string
|
|
140
140
|
const newUser = { id: '2', name };
|
|
141
|
-
return c.json(newUser,
|
|
141
|
+
return c.json(newUser, HTTP.ResultCodes.RS_2.Created); // Return type is validated
|
|
142
142
|
}
|
|
143
143
|
```
|
|
144
144
|
|
|
@@ -171,17 +171,21 @@ export class HealthCheckController extends BaseController {
|
|
|
171
171
|
@api({ configs: HEALTH_CHECK_ROUTES['/ping'] })
|
|
172
172
|
ping(c: TRouteContext<typeof HEALTH_CHECK_ROUTES['/ping']>) { // Return type is automatically inferred
|
|
173
173
|
const { message } = c.req.valid('json');
|
|
174
|
-
return c.json({ pong: message });
|
|
174
|
+
return c.json({ pong: message }, HTTP.ResultCodes.RS_2.Ok);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
```
|
|
178
178
|
|
|
179
179
|
### Manual Route Definition Methods
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
For advanced use cases or when you prefer a non-decorator approach, you can define routes manually using `defineRoute` and `bindRoute` methods inside the `binding()` method.
|
|
182
182
|
|
|
183
|
-
:::tip
|
|
184
|
-
|
|
183
|
+
:::tip When to Use Manual Definition
|
|
184
|
+
Manual route definition is useful for:
|
|
185
|
+
- Dynamically generating routes based on configuration
|
|
186
|
+
- Conditional route registration (feature flags)
|
|
187
|
+
- Developers who prefer non-decorator syntax (coming from Express/Fastify)
|
|
188
|
+
- Complex routing logic that benefits from programmatic control
|
|
185
189
|
:::
|
|
186
190
|
|
|
187
191
|
#### `defineRoute`
|
|
@@ -287,19 +291,21 @@ The `ControllerFactory` provides a static method `defineCrudController` to quick
|
|
|
287
291
|
|
|
288
292
|
### `static defineCrudController<EntitySchema>(opts: ICrudControllerOptions<EntitySchema>)`
|
|
289
293
|
|
|
290
|
-
This factory method returns a `BaseController` class that is already set up with the following standard CRUD endpoints
|
|
294
|
+
This factory method returns a `BaseController` class that is already set up with the following standard CRUD endpoints.
|
|
291
295
|
|
|
292
|
-
|
|
296
|
+
**Note:** The returned class is dynamically named using `controller.name` from the options. This ensures that when registered with `app.controller()`, the class has a proper name for binding keys and debugging (e.g., `ConfigurationController` instead of an anonymous class).
|
|
297
|
+
|
|
298
|
+
| Route Name | Method | Path | Description |
|
|
293
299
|
| :--- | :--- | :--- | :--- |
|
|
294
300
|
| `count` | `GET` | `/count` | Get the number of records matching a filter. |
|
|
295
301
|
| `find` | `GET` | `/` | Retrieve all records matching a filter. |
|
|
296
302
|
| `findById` | `GET` | `/:id` | Retrieve a single record by its ID. |
|
|
297
303
|
| `findOne` | `GET` | `/find-one` | Retrieve a single record matching a filter. |
|
|
298
304
|
| `create` | `POST` | `/` | Create a new record. |
|
|
299
|
-
| `updateById` | `PATCH` | `/:id` | Update a record by its ID. |
|
|
300
|
-
| `
|
|
301
|
-
| `deleteById` | `DELETE` | `/:id` | Delete a record by its ID. |
|
|
302
|
-
| `
|
|
305
|
+
| `updateById` | `PATCH` | `/:id` | Update a single record by its ID. |
|
|
306
|
+
| `updateBy` | `PATCH` | `/` | Update multiple records matching a `where` filter. |
|
|
307
|
+
| `deleteById` | `DELETE` | `/:id` | Delete a single record by its ID. |
|
|
308
|
+
| `deleteBy` | `DELETE` | `/` | Delete multiple records matching a `where` filter. |
|
|
303
309
|
|
|
304
310
|
### `ICrudControllerOptions<EntitySchema>`
|
|
305
311
|
|
|
@@ -309,10 +315,30 @@ This factory method returns a `BaseController` class that is already set up with
|
|
|
309
315
|
| `repository.name` | `string` | The binding key name of the repository associated with this entity (e.g., `'ConfigurationRepository'`). |
|
|
310
316
|
| `controller.name` | `string` | A unique name for the generated controller (e.g., `'ConfigurationController'`). |
|
|
311
317
|
| `controller.basePath`| `string` | The base path for all routes in this CRUD controller (e.g., `'/configurations'`). |
|
|
318
|
+
| `controller.readonly` | `boolean` | If `true`, only read operations (find, findOne, findById, count) are generated. Write operations are excluded. Defaults to `false`. |
|
|
312
319
|
| `controller.isStrict` | `boolean` | If `true`, query parameters like `where` will be strictly validated. Defaults to `true`. |
|
|
313
320
|
| `controller.defaultLimit`| `number` | The default limit for `find` operations. Defaults to `10`. |
|
|
314
|
-
| `schema` | `object` | An optional object to override the default Zod schemas for specific CRUD endpoints
|
|
315
|
-
| `doDeleteWithReturn` | `boolean` | If `true`, the `deleteById` and `
|
|
321
|
+
| `schema` | `object` | An optional object to override the default Zod schemas for specific CRUD endpoints. See schema options below. |
|
|
322
|
+
| `doDeleteWithReturn` | `boolean` | If `true`, the `deleteById` and `deleteBy` endpoints will return the deleted record(s) in the response body. Defaults to `false`. |
|
|
323
|
+
|
|
324
|
+
### Schema Override Options
|
|
325
|
+
|
|
326
|
+
The `schema` option allows fine-grained control over request/response validation and OpenAPI documentation:
|
|
327
|
+
|
|
328
|
+
| Schema Option | Description |
|
|
329
|
+
| :--- | :--- |
|
|
330
|
+
| `count` | Override response schema for count endpoint |
|
|
331
|
+
| `find` | Override response schema for find endpoint |
|
|
332
|
+
| `findOne` | Override response schema for findOne endpoint |
|
|
333
|
+
| `findById` | Override response schema for findById endpoint |
|
|
334
|
+
| `create` | Override response schema for create endpoint |
|
|
335
|
+
| `createRequestBody` | Override request body schema for create endpoint |
|
|
336
|
+
| `updateById` | Override response schema for updateById endpoint |
|
|
337
|
+
| `updateByIdRequestBody` | Override request body schema for updateById endpoint |
|
|
338
|
+
| `updateBy` | Override response schema for updateBy (bulk update) endpoint |
|
|
339
|
+
| `updateByRequestBody` | Override request body schema for updateBy endpoint |
|
|
340
|
+
| `deleteById` | Override response schema for deleteById endpoint |
|
|
341
|
+
| `deleteBy` | Override response schema for deleteBy (bulk delete) endpoint |
|
|
316
342
|
|
|
317
343
|
### Example
|
|
318
344
|
|