@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.
- package/mcp-server/dist/common/config.d.ts +27 -0
- package/mcp-server/dist/common/config.d.ts.map +1 -0
- package/mcp-server/dist/common/config.js +27 -0
- package/mcp-server/dist/common/config.js.map +1 -0
- package/mcp-server/dist/common/index.d.ts +3 -0
- package/mcp-server/dist/common/index.d.ts.map +1 -0
- package/mcp-server/dist/common/index.js +19 -0
- package/mcp-server/dist/common/index.js.map +1 -0
- package/mcp-server/dist/common/paths.d.ts +13 -0
- package/mcp-server/dist/common/paths.d.ts.map +1 -0
- package/mcp-server/dist/common/paths.js +23 -0
- package/mcp-server/dist/common/paths.js.map +1 -0
- package/mcp-server/dist/helpers/docs.helper.d.ts +81 -0
- package/mcp-server/dist/helpers/docs.helper.d.ts.map +1 -0
- package/mcp-server/dist/helpers/docs.helper.js +171 -0
- package/mcp-server/dist/helpers/docs.helper.js.map +1 -0
- package/mcp-server/dist/helpers/index.d.ts +3 -0
- package/mcp-server/dist/helpers/index.d.ts.map +1 -0
- package/mcp-server/dist/helpers/index.js +19 -0
- package/mcp-server/dist/helpers/index.js.map +1 -0
- package/mcp-server/dist/helpers/logger.helper.d.ts +7 -0
- package/mcp-server/dist/helpers/logger.helper.d.ts.map +1 -0
- package/mcp-server/dist/helpers/logger.helper.js +22 -0
- package/mcp-server/dist/helpers/logger.helper.js.map +1 -0
- package/mcp-server/dist/index.d.ts +3 -0
- package/mcp-server/dist/index.d.ts.map +1 -0
- package/mcp-server/dist/index.js +62 -0
- package/mcp-server/dist/index.js.map +1 -0
- package/mcp-server/dist/tools/base.tool.d.ts +98 -0
- package/mcp-server/dist/tools/base.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/base.tool.js +47 -0
- package/mcp-server/dist/tools/base.tool.js.map +1 -0
- package/mcp-server/dist/tools/get-doc-content.tool.d.ts +30 -0
- package/mcp-server/dist/tools/get-doc-content.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/get-doc-content.tool.js +127 -0
- package/mcp-server/dist/tools/get-doc-content.tool.js.map +1 -0
- package/mcp-server/dist/tools/get-doc-metadata.tool.d.ts +40 -0
- package/mcp-server/dist/tools/get-doc-metadata.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/get-doc-metadata.tool.js +121 -0
- package/mcp-server/dist/tools/get-doc-metadata.tool.js.map +1 -0
- package/mcp-server/dist/tools/index.d.ts +8 -0
- package/mcp-server/dist/tools/index.d.ts.map +1 -0
- package/mcp-server/dist/tools/index.js +18 -0
- package/mcp-server/dist/tools/index.js.map +1 -0
- package/mcp-server/dist/tools/list-categories.tool.d.ts +20 -0
- package/mcp-server/dist/tools/list-categories.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/list-categories.tool.js +105 -0
- package/mcp-server/dist/tools/list-categories.tool.js.map +1 -0
- package/mcp-server/dist/tools/list-docs.tool.d.ts +32 -0
- package/mcp-server/dist/tools/list-docs.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/list-docs.tool.js +121 -0
- package/mcp-server/dist/tools/list-docs.tool.js.map +1 -0
- package/mcp-server/dist/tools/search-docs.tool.d.ts +32 -0
- package/mcp-server/dist/tools/search-docs.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/search-docs.tool.js +120 -0
- package/mcp-server/dist/tools/search-docs.tool.js.map +1 -0
- package/package.json +102 -0
- package/wiki/get-started/5-minute-quickstart.md +266 -0
- package/wiki/get-started/best-practices/api-usage-examples.md +222 -0
- package/wiki/get-started/best-practices/architectural-patterns.md +129 -0
- package/wiki/get-started/best-practices/code-style-standards.md +122 -0
- package/wiki/get-started/best-practices/common-pitfalls.md +136 -0
- package/wiki/get-started/best-practices/contribution-workflow.md +145 -0
- package/wiki/get-started/best-practices/deployment-strategies.md +121 -0
- package/wiki/get-started/best-practices/performance-optimization.md +88 -0
- package/wiki/get-started/best-practices/security-guidelines.md +97 -0
- package/wiki/get-started/best-practices/troubleshooting-tips.md +100 -0
- package/wiki/get-started/building-a-crud-api.md +717 -0
- package/wiki/get-started/core-concepts/application.md +168 -0
- package/wiki/get-started/core-concepts/components.md +96 -0
- package/wiki/get-started/core-concepts/controllers.md +441 -0
- package/wiki/get-started/core-concepts/dependency-injection.md +160 -0
- package/wiki/get-started/core-concepts/persistent.md +591 -0
- package/wiki/get-started/core-concepts/services.md +88 -0
- package/wiki/get-started/index.md +65 -0
- package/wiki/get-started/mcp-docs-server.md +840 -0
- package/wiki/get-started/philosophy.md +123 -0
- package/wiki/get-started/prerequisites.md +113 -0
- package/wiki/get-started/quickstart.md +382 -0
- package/wiki/index.md +48 -0
- package/wiki/references/base/application.md +67 -0
- package/wiki/references/base/components.md +80 -0
- package/wiki/references/base/controllers.md +361 -0
- package/wiki/references/base/datasources.md +105 -0
- package/wiki/references/base/dependency-injection.md +83 -0
- package/wiki/references/base/models.md +104 -0
- package/wiki/references/base/repositories.md +118 -0
- package/wiki/references/base/services.md +97 -0
- package/wiki/references/components/authentication.md +224 -0
- package/wiki/references/components/health-check.md +190 -0
- package/wiki/references/components/index.md +61 -0
- package/wiki/references/components/request-tracker.md +35 -0
- package/wiki/references/components/socket-io.md +127 -0
- package/wiki/references/components/swagger.md +175 -0
- package/wiki/references/helpers/cron.md +94 -0
- package/wiki/references/helpers/crypto.md +117 -0
- package/wiki/references/helpers/env.md +67 -0
- package/wiki/references/helpers/error.md +80 -0
- package/wiki/references/helpers/index.md +21 -0
- package/wiki/references/helpers/inversion.md +141 -0
- package/wiki/references/helpers/logger.md +98 -0
- package/wiki/references/helpers/network.md +143 -0
- package/wiki/references/helpers/queue.md +131 -0
- package/wiki/references/helpers/redis.md +121 -0
- package/wiki/references/helpers/socket-io.md +103 -0
- package/wiki/references/helpers/storage.md +130 -0
- package/wiki/references/helpers/testing.md +115 -0
- package/wiki/references/helpers/worker-thread.md +162 -0
- package/wiki/references/src-details/core.md +249 -0
- package/wiki/references/src-details/dev-configs.md +302 -0
- package/wiki/references/src-details/docs.md +61 -0
- package/wiki/references/src-details/helpers.md +211 -0
- package/wiki/references/src-details/inversion.md +345 -0
- package/wiki/references/src-details/mcp-server.md +726 -0
- package/wiki/references/utilities/crypto.md +39 -0
- package/wiki/references/utilities/date.md +72 -0
- package/wiki/references/utilities/index.md +12 -0
- package/wiki/references/utilities/module.md +40 -0
- package/wiki/references/utilities/parse.md +68 -0
- package/wiki/references/utilities/performance.md +64 -0
- package/wiki/references/utilities/promise.md +83 -0
- package/wiki/references/utilities/request.md +66 -0
- package/wiki/references/utilities/schema.md +88 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListDocsTool = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const helpers_1 = require("../helpers");
|
|
6
|
+
const base_tool_1 = require("./base.tool");
|
|
7
|
+
// ----------------------------------------------------------------------------
|
|
8
|
+
// DESCRIPTIONS
|
|
9
|
+
// ----------------------------------------------------------------------------
|
|
10
|
+
const TOOL_DESCRIPTION = `
|
|
11
|
+
Lists all available Ignis Framework documentation files with their identifiers, titles, and categories.
|
|
12
|
+
|
|
13
|
+
PURPOSE:
|
|
14
|
+
Use this tool to discover what documentation is available. It provides a complete catalog
|
|
15
|
+
of all documents, optionally filtered by category. Essential for understanding the documentation
|
|
16
|
+
structure and finding specific pages.
|
|
17
|
+
|
|
18
|
+
WHEN TO USE:
|
|
19
|
+
- To explore what documentation exists
|
|
20
|
+
- To find document IDs for use with getDocContent
|
|
21
|
+
- To browse documents within a specific category
|
|
22
|
+
- When searchDocs doesn't find what you're looking for
|
|
23
|
+
- To understand the overall documentation structure
|
|
24
|
+
- To provide users with a list of available resources
|
|
25
|
+
|
|
26
|
+
WHEN NOT TO USE:
|
|
27
|
+
- When you know what you're looking for (use searchDocs instead)
|
|
28
|
+
- When you need document content (use getDocContent after getting IDs)
|
|
29
|
+
|
|
30
|
+
CATEGORY FILTERING:
|
|
31
|
+
- Omit 'category' parameter to get ALL documents
|
|
32
|
+
- Provide exact category name to filter (case-sensitive)
|
|
33
|
+
- Use listCategories first to see available category names
|
|
34
|
+
|
|
35
|
+
COMMON CATEGORIES IN IGNIS DOCS:
|
|
36
|
+
- "Getting Started" - Introductory guides, quickstart, philosophy
|
|
37
|
+
- "Core Concepts" - DI, lifecycle, configuration fundamentals
|
|
38
|
+
- "Best Practices" - Recommended patterns and approaches
|
|
39
|
+
- "References" - API documentation, component details
|
|
40
|
+
- "Helpers" - Utility libraries documentation
|
|
41
|
+
- "Utilities" - Utility function references
|
|
42
|
+
|
|
43
|
+
WORKFLOW EXAMPLES:
|
|
44
|
+
1. Browse all docs:
|
|
45
|
+
listDocs() → Review titles → getDocContent(id)
|
|
46
|
+
|
|
47
|
+
2. Explore a category:
|
|
48
|
+
listCategories() → Pick category → listDocs(category) → getDocContent(id)
|
|
49
|
+
|
|
50
|
+
3. Find specific documentation:
|
|
51
|
+
searchDocs(query) → If not found → listDocs() to browse manually
|
|
52
|
+
`;
|
|
53
|
+
const CATEGORY_DESCRIPTION = `
|
|
54
|
+
Optional category filter to narrow results to a specific documentation section.
|
|
55
|
+
|
|
56
|
+
BEHAVIOR:
|
|
57
|
+
- If omitted: Returns ALL documentation files across all categories
|
|
58
|
+
- If provided: Returns only documents matching the exact category name
|
|
59
|
+
|
|
60
|
+
MATCHING:
|
|
61
|
+
- Case-sensitive exact match required
|
|
62
|
+
- Must match the category string exactly as stored in document frontmatter
|
|
63
|
+
|
|
64
|
+
HOW TO GET VALID CATEGORIES:
|
|
65
|
+
Use the listCategories tool to retrieve all available category names.
|
|
66
|
+
|
|
67
|
+
EXAMPLES:
|
|
68
|
+
- "Getting Started" - Introductory documentation
|
|
69
|
+
- "Core Concepts" - Fundamental framework concepts
|
|
70
|
+
- "Best Practices" - Recommended patterns
|
|
71
|
+
- "References" - API and component documentation
|
|
72
|
+
|
|
73
|
+
TIP: If unsure of exact category name, call listCategories first or omit this parameter.
|
|
74
|
+
`;
|
|
75
|
+
// ----------------------------------------------------------------------------
|
|
76
|
+
// SCHEMAS
|
|
77
|
+
// ----------------------------------------------------------------------------
|
|
78
|
+
const DocEntrySchema = zod_1.z.object({
|
|
79
|
+
id: zod_1.z
|
|
80
|
+
.string()
|
|
81
|
+
.describe("Document ID (relative file path). Use with getDocContent or getDocMetadata."),
|
|
82
|
+
title: zod_1.z.string().describe("Document title from frontmatter or filename."),
|
|
83
|
+
category: zod_1.z.string().describe("Document category for organizational grouping."),
|
|
84
|
+
});
|
|
85
|
+
const InputSchema = zod_1.z.object({
|
|
86
|
+
category: zod_1.z.string().optional().describe(CATEGORY_DESCRIPTION),
|
|
87
|
+
});
|
|
88
|
+
const OutputSchema = zod_1.z.object({
|
|
89
|
+
count: zod_1.z.number().int().describe("Total documents returned. Reflects filter if applied."),
|
|
90
|
+
docs: zod_1.z.array(DocEntrySchema).describe("Document entries with id, title, and category."),
|
|
91
|
+
});
|
|
92
|
+
// ----------------------------------------------------------------------------
|
|
93
|
+
// TOOL CLASS
|
|
94
|
+
// ----------------------------------------------------------------------------
|
|
95
|
+
class ListDocsTool extends base_tool_1.BaseTool {
|
|
96
|
+
constructor() {
|
|
97
|
+
super(...arguments);
|
|
98
|
+
this.id = "listDocs";
|
|
99
|
+
this.description = TOOL_DESCRIPTION;
|
|
100
|
+
this.inputSchema = InputSchema;
|
|
101
|
+
this.outputSchema = OutputSchema;
|
|
102
|
+
}
|
|
103
|
+
async execute(input) {
|
|
104
|
+
const docs = await helpers_1.DocsHelper.listDocs({ category: input.category });
|
|
105
|
+
return {
|
|
106
|
+
count: docs.length,
|
|
107
|
+
docs,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
getTool() {
|
|
111
|
+
return (0, base_tool_1.createTool)({
|
|
112
|
+
id: this.id,
|
|
113
|
+
description: this.description,
|
|
114
|
+
inputSchema: InputSchema,
|
|
115
|
+
outputSchema: OutputSchema,
|
|
116
|
+
execute: async ({ context }) => this.execute(context),
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.ListDocsTool = ListDocsTool;
|
|
121
|
+
//# sourceMappingURL=list-docs.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-docs.tool.js","sourceRoot":"","sources":["../../tools/list-docs.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,wCAAwC;AACxC,2CAAqE;AAErE,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CxB,CAAC;AAEF,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;CAqB5B,CAAC;AAEF,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,MAAM,cAAc,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9B,EAAE,EAAE,OAAC;SACF,MAAM,EAAE;SACR,QAAQ,CAAC,6EAA6E,CAAC;IAC1F,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IAC1E,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;CAChF,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;CAC/D,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;IACzF,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,gDAAgD,CAAC;CACzF,CAAC,CAAC;AAEH,+EAA+E;AAC/E,aAAa;AACb,+EAA+E;AAE/E,MAAa,YAAa,SAAQ,oBAAiD;IAAnF;;QACW,OAAE,GAAG,UAAU,CAAC;QAChB,gBAAW,GAAG,gBAAgB,CAAC;QAC/B,gBAAW,GAAG,WAAW,CAAC;QAC1B,iBAAY,GAAG,YAAY,CAAC;IAoBvC,CAAC;IAlBC,KAAK,CAAC,OAAO,CAAC,KAAkC;QAC9C,MAAM,IAAI,GAAG,MAAM,oBAAU,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QAErE,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,IAAI;SACL,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,IAAA,sBAAU,EAAC;YAChB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,WAAW;YACxB,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;CACF;AAxBD,oCAwBC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BaseTool, type TMastraTool } from "./base.tool";
|
|
3
|
+
declare const InputSchema: z.ZodObject<{
|
|
4
|
+
query: z.ZodString;
|
|
5
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
declare const OutputSchema: z.ZodArray<z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
title: z.ZodString;
|
|
10
|
+
category: z.ZodString;
|
|
11
|
+
snippet: z.ZodString;
|
|
12
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
export declare class SearchDocsTool extends BaseTool<typeof InputSchema, typeof OutputSchema> {
|
|
15
|
+
readonly id = "searchDocs";
|
|
16
|
+
readonly description = "\nPerforms intelligent fuzzy search across the entire Ignis Framework documentation corpus.\n\nPURPOSE:\nUse this tool to find documentation pages relevant to a user's question or topic.\nIt searches both document titles (weighted higher) and content body using the Fuse.js fuzzy matching algorithm.\n\nWHEN TO USE:\n- User asks \"how do I...\" or \"what is...\" questions about Ignis\n- You need to find documentation about a specific feature, concept, or API\n- You want to discover related documentation before diving into specifics\n- User mentions keywords that might appear in documentation\n\nSEARCH BEHAVIOR:\n- Fuzzy matching tolerates typos and partial matches\n- Title matches are weighted 70%, content matches 30%\n- Results sorted by relevance score (lower = better match)\n- Returns snippet previews for quick assessment\n\nWORKFLOW RECOMMENDATION:\n1. Start with searchDocs to find relevant pages\n2. Review returned snippets to identify best matches\n3. Use getDocContent with specific IDs to retrieve full content\n4. Use getDocMetadata if you need document statistics\n\nOUTPUT STRUCTURE:\nReturns array of {id, title, category, snippet, score} objects.\nUse the 'id' field with getDocContent to fetch full document content.\n";
|
|
17
|
+
readonly inputSchema: z.ZodObject<{
|
|
18
|
+
query: z.ZodString;
|
|
19
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
readonly outputSchema: z.ZodArray<z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
title: z.ZodString;
|
|
24
|
+
category: z.ZodString;
|
|
25
|
+
snippet: z.ZodString;
|
|
26
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
execute(input: z.infer<typeof InputSchema>): Promise<z.infer<typeof OutputSchema>>;
|
|
29
|
+
getTool(): TMastraTool;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=search-docs.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-docs.tool.d.ts","sourceRoot":"","sources":["../../tools/search-docs.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,QAAQ,EAAc,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAiFrE,QAAA,MAAM,WAAW;;;iBASf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;kBAE2D,CAAC;AAM9E,qBAAa,cAAe,SAAQ,QAAQ,CAAC,OAAO,WAAW,EAAE,OAAO,YAAY,CAAC;IACnF,QAAQ,CAAC,EAAE,gBAAgB;IAC3B,QAAQ,CAAC,WAAW,kuCAAoB;IACxC,QAAQ,CAAC,WAAW;;;sBAAe;IACnC,QAAQ,CAAC,YAAY;;;;;;uBAAgB;IAE/B,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;IAOxF,OAAO,IAAI,WAAW;CASvB"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SearchDocsTool = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
const helpers_1 = require("../helpers");
|
|
7
|
+
const base_tool_1 = require("./base.tool");
|
|
8
|
+
// ----------------------------------------------------------------------------
|
|
9
|
+
// DESCRIPTIONS
|
|
10
|
+
// ----------------------------------------------------------------------------
|
|
11
|
+
const TOOL_DESCRIPTION = `
|
|
12
|
+
Performs intelligent fuzzy search across the entire Ignis Framework documentation corpus.
|
|
13
|
+
|
|
14
|
+
PURPOSE:
|
|
15
|
+
Use this tool to find documentation pages relevant to a user's question or topic.
|
|
16
|
+
It searches both document titles (weighted higher) and content body using the Fuse.js fuzzy matching algorithm.
|
|
17
|
+
|
|
18
|
+
WHEN TO USE:
|
|
19
|
+
- User asks "how do I..." or "what is..." questions about Ignis
|
|
20
|
+
- You need to find documentation about a specific feature, concept, or API
|
|
21
|
+
- You want to discover related documentation before diving into specifics
|
|
22
|
+
- User mentions keywords that might appear in documentation
|
|
23
|
+
|
|
24
|
+
SEARCH BEHAVIOR:
|
|
25
|
+
- Fuzzy matching tolerates typos and partial matches
|
|
26
|
+
- Title matches are weighted 70%, content matches 30%
|
|
27
|
+
- Results sorted by relevance score (lower = better match)
|
|
28
|
+
- Returns snippet previews for quick assessment
|
|
29
|
+
|
|
30
|
+
WORKFLOW RECOMMENDATION:
|
|
31
|
+
1. Start with searchDocs to find relevant pages
|
|
32
|
+
2. Review returned snippets to identify best matches
|
|
33
|
+
3. Use getDocContent with specific IDs to retrieve full content
|
|
34
|
+
4. Use getDocMetadata if you need document statistics
|
|
35
|
+
|
|
36
|
+
OUTPUT STRUCTURE:
|
|
37
|
+
Returns array of {id, title, category, snippet, score} objects.
|
|
38
|
+
Use the 'id' field with getDocContent to fetch full document content.
|
|
39
|
+
`;
|
|
40
|
+
const QUERY_DESCRIPTION = `
|
|
41
|
+
Search query string to match against documentation titles and content.
|
|
42
|
+
|
|
43
|
+
REQUIREMENTS:
|
|
44
|
+
- Minimum ${common_1.MCP_CONFIG.search.minQueryLength} characters required
|
|
45
|
+
- Supports natural language queries (e.g., "dependency injection setup")
|
|
46
|
+
- Supports technical terms (e.g., "HttpServer middleware")
|
|
47
|
+
- Case-insensitive matching
|
|
48
|
+
|
|
49
|
+
TIPS FOR EFFECTIVE QUERIES:
|
|
50
|
+
- Use specific technical terms for precise results
|
|
51
|
+
- Try alternative phrasings if initial search yields few results
|
|
52
|
+
- Combine concepts for targeted searches (e.g., "redis cache helper")
|
|
53
|
+
`;
|
|
54
|
+
const LIMIT_DESCRIPTION = `
|
|
55
|
+
Maximum number of results to return.
|
|
56
|
+
|
|
57
|
+
CONSTRAINTS:
|
|
58
|
+
- Minimum: 1
|
|
59
|
+
- Maximum: ${common_1.MCP_CONFIG.search.maxLimit}
|
|
60
|
+
- Default: ${common_1.MCP_CONFIG.search.defaultLimit}
|
|
61
|
+
|
|
62
|
+
RECOMMENDATIONS:
|
|
63
|
+
- Use default (10) for general queries
|
|
64
|
+
- Increase to 20-30 for broad topic exploration
|
|
65
|
+
- Use lower values (3-5) when you need only top matches
|
|
66
|
+
`;
|
|
67
|
+
// ----------------------------------------------------------------------------
|
|
68
|
+
// SCHEMAS
|
|
69
|
+
// ----------------------------------------------------------------------------
|
|
70
|
+
const SearchResultSchema = zod_1.z.object({
|
|
71
|
+
id: zod_1.z
|
|
72
|
+
.string()
|
|
73
|
+
.describe("Unique document identifier (relative file path). Use with getDocContent to retrieve full document."),
|
|
74
|
+
title: zod_1.z.string().describe("Human-readable document title from frontmatter or filename."),
|
|
75
|
+
category: zod_1.z.string().describe('Document category (e.g., "Getting Started", "References").'),
|
|
76
|
+
snippet: zod_1.z.string().describe("Content preview (max 300 chars) for quick assessment."),
|
|
77
|
+
score: zod_1.z.number().optional().describe("Relevance score 0-1 (lower = better match)."),
|
|
78
|
+
});
|
|
79
|
+
const InputSchema = zod_1.z.object({
|
|
80
|
+
query: zod_1.z.string().min(common_1.MCP_CONFIG.search.minQueryLength).describe(QUERY_DESCRIPTION),
|
|
81
|
+
limit: zod_1.z
|
|
82
|
+
.number()
|
|
83
|
+
.int()
|
|
84
|
+
.min(1)
|
|
85
|
+
.max(common_1.MCP_CONFIG.search.maxLimit)
|
|
86
|
+
.default(common_1.MCP_CONFIG.search.defaultLimit)
|
|
87
|
+
.describe(LIMIT_DESCRIPTION),
|
|
88
|
+
});
|
|
89
|
+
const OutputSchema = zod_1.z
|
|
90
|
+
.array(SearchResultSchema)
|
|
91
|
+
.describe("Search results sorted by relevance. Empty array if no matches.");
|
|
92
|
+
// ----------------------------------------------------------------------------
|
|
93
|
+
// TOOL CLASS
|
|
94
|
+
// ----------------------------------------------------------------------------
|
|
95
|
+
class SearchDocsTool extends base_tool_1.BaseTool {
|
|
96
|
+
constructor() {
|
|
97
|
+
super(...arguments);
|
|
98
|
+
this.id = "searchDocs";
|
|
99
|
+
this.description = TOOL_DESCRIPTION;
|
|
100
|
+
this.inputSchema = InputSchema;
|
|
101
|
+
this.outputSchema = OutputSchema;
|
|
102
|
+
}
|
|
103
|
+
async execute(input) {
|
|
104
|
+
return helpers_1.DocsHelper.searchDocs({
|
|
105
|
+
query: input.query,
|
|
106
|
+
limit: input.limit,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
getTool() {
|
|
110
|
+
return (0, base_tool_1.createTool)({
|
|
111
|
+
id: this.id,
|
|
112
|
+
description: this.description,
|
|
113
|
+
inputSchema: InputSchema,
|
|
114
|
+
outputSchema: OutputSchema,
|
|
115
|
+
execute: async ({ context }) => this.execute(context),
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
exports.SearchDocsTool = SearchDocsTool;
|
|
120
|
+
//# sourceMappingURL=search-docs.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-docs.tool.js","sourceRoot":"","sources":["../../tools/search-docs.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,sCAAuC;AACvC,wCAAwC;AACxC,2CAAqE;AAErE,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BxB,CAAC;AAEF,MAAM,iBAAiB,GAAG;;;;YAId,mBAAU,CAAC,MAAM,CAAC,cAAc;;;;;;;;;CAS3C,CAAC;AAEF,MAAM,iBAAiB,GAAG;;;;;aAKb,mBAAU,CAAC,MAAM,CAAC,QAAQ;aAC1B,mBAAU,CAAC,MAAM,CAAC,YAAY;;;;;;CAM1C,CAAC;AAEF,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,MAAM,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,EAAE,EAAE,OAAC;SACF,MAAM,EAAE;SACR,QAAQ,CACP,oGAAoG,CACrG;IACH,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6DAA6D,CAAC;IACzF,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4DAA4D,CAAC;IAC3F,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;IACrF,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;CACrF,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,mBAAU,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IACnF,KAAK,EAAE,OAAC;SACL,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,mBAAU,CAAC,MAAM,CAAC,QAAQ,CAAC;SAC/B,OAAO,CAAC,mBAAU,CAAC,MAAM,CAAC,YAAY,CAAC;SACvC,QAAQ,CAAC,iBAAiB,CAAC;CAC/B,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,OAAC;KACnB,KAAK,CAAC,kBAAkB,CAAC;KACzB,QAAQ,CAAC,gEAAgE,CAAC,CAAC;AAE9E,+EAA+E;AAC/E,aAAa;AACb,+EAA+E;AAE/E,MAAa,cAAe,SAAQ,oBAAiD;IAArF;;QACW,OAAE,GAAG,YAAY,CAAC;QAClB,gBAAW,GAAG,gBAAgB,CAAC;QAC/B,gBAAW,GAAG,WAAW,CAAC;QAC1B,iBAAY,GAAG,YAAY,CAAC;IAkBvC,CAAC;IAhBC,KAAK,CAAC,OAAO,CAAC,KAAkC;QAC9C,OAAO,oBAAU,CAAC,UAAU,CAAC;YAC3B,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,OAAO,IAAA,sBAAU,EAAC;YAChB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,WAAW;YACxB,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;CACF;AAtBD,wCAsBC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@venizia/ignis-docs",
|
|
3
|
+
"version": "0.0.1-1",
|
|
4
|
+
"description": "Documentation and MCP Server for Ignis Framework",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ignis",
|
|
7
|
+
"mcp",
|
|
8
|
+
"model-context-protocol",
|
|
9
|
+
"documentation",
|
|
10
|
+
"ai",
|
|
11
|
+
"framework"
|
|
12
|
+
],
|
|
13
|
+
"main": "./mcp-server/dist/index.js",
|
|
14
|
+
"types": "./mcp-server/dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./mcp-server/dist/index.d.ts",
|
|
18
|
+
"default": "./mcp-server/dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./tools": {
|
|
21
|
+
"types": "./mcp-server/dist/tools/index.d.ts",
|
|
22
|
+
"default": "./mcp-server/dist/tools/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./helpers": {
|
|
25
|
+
"types": "./mcp-server/dist/helpers/index.d.ts",
|
|
26
|
+
"default": "./mcp-server/dist/helpers/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./common": {
|
|
29
|
+
"types": "./mcp-server/dist/common/index.d.ts",
|
|
30
|
+
"default": "./mcp-server/dist/common/index.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"bin": {
|
|
34
|
+
"ignis-docs-mcp": "./mcp-server/dist/index.js"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"mcp-server/dist",
|
|
38
|
+
"wiki"
|
|
39
|
+
],
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"bun": ">=1.3"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"eslint": "eslint --report-unused-disable-directives .",
|
|
48
|
+
"lint": "bun run eslint && bun run prettier:cli",
|
|
49
|
+
"lint:fix": "bun run eslint --fix && bun run prettier:fix",
|
|
50
|
+
"prettier:cli": "prettier \"**/*.{js,ts}\" -l",
|
|
51
|
+
"prettier:fix": "bun run prettier:cli --write",
|
|
52
|
+
"docs:dev": "vitepress dev site",
|
|
53
|
+
"docs:clean": "sh ./scripts/docs-clean.sh",
|
|
54
|
+
"docs:build": "vitepress build site",
|
|
55
|
+
"docs:preview": "vitepress preview site",
|
|
56
|
+
"premcp:build": "bun run mcp:clean",
|
|
57
|
+
"mcp:build": "tsc -p tsconfig.json",
|
|
58
|
+
"mcp:clean": "sh ./scripts/mcp-clean.sh",
|
|
59
|
+
"mcp:start": "bun run mcp-server/index.ts",
|
|
60
|
+
"mcp:dev": "bun --watch mcp-server/index.ts",
|
|
61
|
+
"prepublishOnly": "bun run mcp:build"
|
|
62
|
+
},
|
|
63
|
+
"repository": {
|
|
64
|
+
"type": "git",
|
|
65
|
+
"url": "https://github.com/venizia-ai/ignis.git",
|
|
66
|
+
"directory": "packages/docs"
|
|
67
|
+
},
|
|
68
|
+
"author": {
|
|
69
|
+
"name": "VENIZIA AI Developer",
|
|
70
|
+
"email": "developer@venizia.ai",
|
|
71
|
+
"url": "https://venizia.ai"
|
|
72
|
+
},
|
|
73
|
+
"bugs": {
|
|
74
|
+
"url": "https://github.com/VENIZIA-AI/ignis/issues"
|
|
75
|
+
},
|
|
76
|
+
"homepage": "https://github.com/VENIZIA-AI/ignis/wiki",
|
|
77
|
+
"license": "MIT",
|
|
78
|
+
"dependencies": {
|
|
79
|
+
"@mastra/core": "^0.24.6",
|
|
80
|
+
"@mastra/mcp": "^0.14.4",
|
|
81
|
+
"dayjs": "^1.11.19",
|
|
82
|
+
"debug": "^4.4.3",
|
|
83
|
+
"fast-glob": "^3.3.3",
|
|
84
|
+
"fuse.js": "^7.1.0",
|
|
85
|
+
"gray-matter": "^4.0.3",
|
|
86
|
+
"zod": "^4.1.13"
|
|
87
|
+
},
|
|
88
|
+
"devDependencies": {
|
|
89
|
+
"@braintree/sanitize-url": "^7.1.1",
|
|
90
|
+
"@types/bun": "^1.3.4",
|
|
91
|
+
"@types/glob": "^8.1.0",
|
|
92
|
+
"@venizia/dev-configs": "latest",
|
|
93
|
+
"eslint": "^9.36.0",
|
|
94
|
+
"glob": "^10.4.2",
|
|
95
|
+
"prettier": "^3.6.2",
|
|
96
|
+
"tsx": "^4.16.2",
|
|
97
|
+
"typescript": "^5.5.4",
|
|
98
|
+
"vitepress": "^1.6.4",
|
|
99
|
+
"vitepress-plugin-mermaid": "^2.0.17",
|
|
100
|
+
"vue": "^3.5.25"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# 5-Minute Quickstart
|
|
2
|
+
|
|
3
|
+
Build your first Ignis API endpoint in 5 minutes. No database, no complex setup - just a working "Hello World" API.
|
|
4
|
+
|
|
5
|
+
> **Prerequisites:** [Bun installed](./prerequisites.md#installation-quick-links) and basic TypeScript knowledge.
|
|
6
|
+
|
|
7
|
+
## Step 1: Create Project (30 seconds)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
mkdir my-app && cd my-app
|
|
11
|
+
bun init -y
|
|
12
|
+
bun add hono @hono/zod-openapi @scalar/hono-api-reference @venizia/ignis
|
|
13
|
+
bun add -d typescript @types/bun @venizia/dev-configs
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Step 2: Configure Development Tools (30 seconds)
|
|
17
|
+
|
|
18
|
+
Create `tsconfig.json`:
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"$schema": "http://json.schemastore.org/tsconfig",
|
|
23
|
+
"extends": "@venizia/dev-configs/tsconfig.common.json",
|
|
24
|
+
"compilerOptions": {
|
|
25
|
+
"outDir": "dist",
|
|
26
|
+
"rootDir": "src",
|
|
27
|
+
"baseUrl": "src",
|
|
28
|
+
"paths": {
|
|
29
|
+
"@/*": ["./*"]
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"include": ["src"],
|
|
33
|
+
"exclude": ["node_modules", "dist"]
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Create `eslint.config.mjs`:
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
import { eslintConfigs } from "@venizia/dev-configs";
|
|
41
|
+
|
|
42
|
+
export default eslintConfigs;
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Create `.prettierrc.mjs`:
|
|
46
|
+
|
|
47
|
+
```javascript
|
|
48
|
+
import { prettierConfigs } from "@venizia/dev-configs";
|
|
49
|
+
|
|
50
|
+
export default prettierConfigs;
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Create `.prettierignore`:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
dist
|
|
57
|
+
node_modules
|
|
58
|
+
*.log
|
|
59
|
+
.*-audit.json
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Step 3: Write Your API (2 minutes)
|
|
63
|
+
|
|
64
|
+
Create `index.ts`:
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
import { z } from "@hono/zod-openapi";
|
|
68
|
+
import {
|
|
69
|
+
BaseApplication,
|
|
70
|
+
BaseController,
|
|
71
|
+
controller,
|
|
72
|
+
get,
|
|
73
|
+
HTTP,
|
|
74
|
+
IApplicationInfo,
|
|
75
|
+
jsonContent,
|
|
76
|
+
} from "@venizia/ignis";
|
|
77
|
+
import { Context } from "hono";
|
|
78
|
+
import appInfo from "./../package.json";
|
|
79
|
+
|
|
80
|
+
// 1. Define a controller
|
|
81
|
+
@controller({ path: "/hello" })
|
|
82
|
+
class HelloController extends BaseController {
|
|
83
|
+
constructor() {
|
|
84
|
+
super({ scope: "HelloController", path: "/hello" });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// NOTE: This is a function that must be overridden.
|
|
88
|
+
override binding() {
|
|
89
|
+
// Bind dependencies here (if needed)
|
|
90
|
+
// Extra binding routes with functional way, use `bindRoute` or `defineRoute`
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@get({
|
|
94
|
+
configs: {
|
|
95
|
+
path: "/",
|
|
96
|
+
method: HTTP.Methods.GET,
|
|
97
|
+
responses: {
|
|
98
|
+
[HTTP.ResultCodes.RS_2.Ok]: jsonContent({
|
|
99
|
+
description: "Says hello",
|
|
100
|
+
schema: z.object({ message: z.string() }),
|
|
101
|
+
}),
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
})
|
|
105
|
+
sayHello(c: Context) {
|
|
106
|
+
return c.json({ message: "Hello from Ignis!" }, HTTP.ResultCodes.RS_2.Ok);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// 2. Create the application
|
|
111
|
+
class App extends BaseApplication {
|
|
112
|
+
getAppInfo(): IApplicationInfo {
|
|
113
|
+
return appInfo;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
staticConfigure() {
|
|
117
|
+
// Static configuration before dependency injection
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
preConfigure() {
|
|
121
|
+
this.controller(HelloController);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
postConfigure() {
|
|
125
|
+
// Configuration after all bindings are complete
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
setupMiddlewares() {
|
|
129
|
+
// Custom middleware setup (optional)
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// 3. Start the server
|
|
134
|
+
const app = new App({
|
|
135
|
+
scope: "App",
|
|
136
|
+
config: {
|
|
137
|
+
host: "0.0.0.0",
|
|
138
|
+
port: 3000,
|
|
139
|
+
path: { base: "/api", isStrict: false },
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
app.start();
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Update `package.json` to add build scripts:
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"name": "5-mins-qs",
|
|
151
|
+
"version": "1.0.0",
|
|
152
|
+
"description": "5-minute quickstart example",
|
|
153
|
+
"private": true,
|
|
154
|
+
"scripts": {
|
|
155
|
+
"start": "bun run src/index.ts",
|
|
156
|
+
"lint": "eslint --report-unused-disable-directives . && prettier \"**/*.{js,ts}\" -l",
|
|
157
|
+
"lint:fix": "eslint --report-unused-disable-directives . --fix && prettier \"**/*.{js,ts}\" --write",
|
|
158
|
+
"build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json",
|
|
159
|
+
"clean": "sh ./scripts/clean.sh",
|
|
160
|
+
"rebuild": "bun run clean && bun run build",
|
|
161
|
+
"server:dev": "NODE_ENV=development bun run src/index.ts",
|
|
162
|
+
"server:prod": "NODE_ENV=production bun run dist/index.js"
|
|
163
|
+
},
|
|
164
|
+
"dependencies": {
|
|
165
|
+
"hono": "^4.4.12",
|
|
166
|
+
"@hono/zod-openapi": "latest",
|
|
167
|
+
"@scalar/hono-api-reference": "latest",
|
|
168
|
+
"@venizia/ignis": "latest"
|
|
169
|
+
},
|
|
170
|
+
"devDependencies": {
|
|
171
|
+
"typescript": "^5.5.3",
|
|
172
|
+
"@types/bun": "latest",
|
|
173
|
+
"@venizia/dev-configs": "latest",
|
|
174
|
+
"eslint": "^9.36.0",
|
|
175
|
+
"prettier": "^3.6.2",
|
|
176
|
+
"tsc-alias": "^1.8.10",
|
|
177
|
+
"tsconfig-paths": "^4.2.0"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Create `scripts/clean.sh`:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
#!/bin/bash
|
|
186
|
+
|
|
187
|
+
# Remove build artifacts
|
|
188
|
+
rm -rf dist/
|
|
189
|
+
rm -rf node_modules/.cache/
|
|
190
|
+
|
|
191
|
+
# Remove log files
|
|
192
|
+
rm -f *.log
|
|
193
|
+
rm -f .*.log
|
|
194
|
+
rm -f .*-audit.json
|
|
195
|
+
|
|
196
|
+
echo "Cleaned build artifacts and logs"
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Step 4: Run It (30 seconds)
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
bun run index.ts
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Visit `http://localhost:3000/api/hello` in your browser!
|
|
206
|
+
|
|
207
|
+
**Response:**
|
|
208
|
+
|
|
209
|
+
```json
|
|
210
|
+
{ "message": "Hello from Ignis!" }
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## What Just Happened?
|
|
214
|
+
|
|
215
|
+
1. **`@controller`** - Registered a controller at `/api/hello`
|
|
216
|
+
2. **`@get`** - Created a GET endpoint
|
|
217
|
+
3. **Zod schema** - Auto-validates response and generates OpenAPI docs
|
|
218
|
+
4. **`app.start()`** - Started HTTP server on port 3000
|
|
219
|
+
|
|
220
|
+
## View API Docs
|
|
221
|
+
|
|
222
|
+
Open `http://localhost:3000/doc/explorer` to see interactive Swagger UI documentation!
|
|
223
|
+
|
|
224
|
+
## Next Steps
|
|
225
|
+
|
|
226
|
+
✅ **You have a working API!**
|
|
227
|
+
|
|
228
|
+
**Want more?**
|
|
229
|
+
|
|
230
|
+
- **Add a database?** → [Building a CRUD API](./building-a-crud-api.md)
|
|
231
|
+
- **Production setup?** → [Complete Setup Guide](./quickstart.md) (ESLint, Prettier, etc.)
|
|
232
|
+
- **Understand the architecture?** → [Core Concepts](./core-concepts/application.md)
|
|
233
|
+
|
|
234
|
+
**Quick additions:**
|
|
235
|
+
|
|
236
|
+
**Add a POST endpoint:**
|
|
237
|
+
|
|
238
|
+
```typescript
|
|
239
|
+
@post({
|
|
240
|
+
configs: {
|
|
241
|
+
path: '/greet',
|
|
242
|
+
request: {
|
|
243
|
+
body: jsonContent({
|
|
244
|
+
schema: z.object({ name: z.string() }),
|
|
245
|
+
}),
|
|
246
|
+
},
|
|
247
|
+
responses: {
|
|
248
|
+
[HTTP.ResultCodes.RS_2.Ok]: jsonContent({
|
|
249
|
+
schema: z.object({ greeting: z.string() }),
|
|
250
|
+
}),
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
})
|
|
254
|
+
async greet(c: Context) {
|
|
255
|
+
const { name } = await c.req.json();
|
|
256
|
+
return c.json({ greeting: `Hello, ${name}!` });
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Test it:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
curl -X POST http://localhost:3000/api/hello/greet \
|
|
264
|
+
-H "Content-Type: application/json" \
|
|
265
|
+
-d '{"name":"World"}'
|
|
266
|
+
```
|