te.js 2.0.3 → 2.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 (68) hide show
  1. package/README.md +197 -187
  2. package/auto-docs/analysis/handler-analyzer.js +58 -58
  3. package/auto-docs/analysis/source-resolver.js +101 -101
  4. package/auto-docs/constants.js +37 -37
  5. package/auto-docs/docs-llm/index.js +7 -0
  6. package/auto-docs/{llm → docs-llm}/prompts.js +222 -222
  7. package/auto-docs/{llm → docs-llm}/provider.js +132 -187
  8. package/auto-docs/index.js +146 -146
  9. package/auto-docs/openapi/endpoint-processor.js +277 -277
  10. package/auto-docs/openapi/generator.js +107 -107
  11. package/auto-docs/openapi/level3.js +131 -131
  12. package/auto-docs/openapi/spec-builders.js +244 -244
  13. package/auto-docs/ui/docs-ui.js +186 -186
  14. package/auto-docs/utils/logger.js +17 -17
  15. package/auto-docs/utils/strip-usage.js +10 -10
  16. package/cli/docs-command.js +315 -315
  17. package/cli/fly-command.js +71 -71
  18. package/cli/index.js +56 -56
  19. package/database/index.js +165 -165
  20. package/database/mongodb.js +146 -146
  21. package/database/redis.js +201 -201
  22. package/docs/README.md +36 -36
  23. package/docs/ammo.md +362 -362
  24. package/docs/api-reference.md +490 -489
  25. package/docs/auto-docs.md +216 -215
  26. package/docs/cli.md +152 -152
  27. package/docs/configuration.md +275 -233
  28. package/docs/database.md +390 -391
  29. package/docs/error-handling.md +438 -417
  30. package/docs/file-uploads.md +333 -334
  31. package/docs/getting-started.md +214 -215
  32. package/docs/middleware.md +355 -356
  33. package/docs/rate-limiting.md +393 -394
  34. package/docs/routing.md +302 -302
  35. package/package.json +62 -62
  36. package/rate-limit/algorithms/fixed-window.js +141 -141
  37. package/rate-limit/algorithms/sliding-window.js +147 -147
  38. package/rate-limit/algorithms/token-bucket.js +115 -115
  39. package/rate-limit/base.js +165 -165
  40. package/rate-limit/index.js +147 -147
  41. package/rate-limit/storage/base.js +104 -104
  42. package/rate-limit/storage/memory.js +101 -101
  43. package/rate-limit/storage/redis.js +88 -88
  44. package/server/ammo/body-parser.js +220 -220
  45. package/server/ammo/dispatch-helper.js +103 -103
  46. package/server/ammo/enhancer.js +57 -57
  47. package/server/ammo.js +454 -356
  48. package/server/endpoint.js +97 -74
  49. package/server/error.js +9 -9
  50. package/server/errors/code-context.js +125 -0
  51. package/server/errors/llm-error-service.js +140 -0
  52. package/server/files/helper.js +33 -33
  53. package/server/files/uploader.js +143 -143
  54. package/server/handler.js +158 -113
  55. package/server/target.js +185 -175
  56. package/server/targets/middleware-validator.js +22 -22
  57. package/server/targets/path-validator.js +21 -21
  58. package/server/targets/registry.js +160 -160
  59. package/server/targets/shoot-validator.js +21 -21
  60. package/te.js +428 -363
  61. package/utils/auto-register.js +17 -17
  62. package/utils/configuration.js +64 -64
  63. package/utils/errors-llm-config.js +84 -0
  64. package/utils/request-logger.js +43 -43
  65. package/utils/status-codes.js +82 -82
  66. package/utils/tejas-entrypoint-html.js +18 -18
  67. package/auto-docs/llm/index.js +0 -6
  68. package/auto-docs/llm/parse.js +0 -88
@@ -1,233 +1,275 @@
1
- # Configuration
2
-
3
- Tejas provides a flexible configuration system that merges settings from multiple sources.
4
-
5
- ## Configuration Sources
6
-
7
- Settings are loaded from three sources. Later sources override earlier ones:
8
-
9
- 1. **`tejas.config.json`** — file in your project root (lowest priority)
10
- 2. **Environment variables** — from `.env` or system environment
11
- 3. **Constructor options** — passed to `new Tejas({...})` (highest priority)
12
-
13
- All configuration keys are normalized: nested objects are flattened with underscores and uppercased. For example, `log.http_requests` becomes the environment variable `LOG_HTTP_REQUESTS`.
14
-
15
- ## Quick Start
16
-
17
- The simplest way to configure Tejas is with a `tejas.config.json` file:
18
-
19
- ```json
20
- {
21
- "port": 3000,
22
- "dir": {
23
- "targets": "targets"
24
- },
25
- "log": {
26
- "http_requests": true,
27
- "exceptions": true
28
- }
29
- }
30
- ```
31
-
32
- Or pass options directly to the constructor:
33
-
34
- ```javascript
35
- import Tejas from 'te.js';
36
-
37
- const app = new Tejas({
38
- port: 3000,
39
- log: { http_requests: true }
40
- });
41
-
42
- app.takeoff();
43
- ```
44
-
45
- ## Complete Configuration Reference
46
-
47
- ### Core
48
-
49
- | Config Key | Env Variable | Type | Default | Description |
50
- |------------|-------------|------|---------|-------------|
51
- | `entry` | `ENTRY` | string | *(auto-resolved)* | Entry file for `tejas fly`. Falls back to `package.json` `main`, then `index.js` / `app.js` / `server.js` |
52
- | `port` | `PORT` | number | `1403` | Server port |
53
- | `dir.targets` | `DIR_TARGETS` | string | `"targets"` | Directory containing `.target.js` files for auto-discovery |
54
-
55
- ### Logging
56
-
57
- | Config Key | Env Variable | Type | Default | Description |
58
- |------------|-------------|------|---------|-------------|
59
- | `log.http_requests` | `LOG_HTTP_REQUESTS` | boolean | `false` | Log incoming HTTP requests (method, path, status, time) |
60
- | `log.exceptions` | `LOG_EXCEPTIONS` | boolean | `false` | Log unhandled exceptions and errors |
61
-
62
- ### Request Body
63
-
64
- | Config Key | Env Variable | Type | Default | Description |
65
- |------------|-------------|------|---------|-------------|
66
- | `body.max_size` | `BODY_MAX_SIZE` | number | `10485760` (10 MB) | Maximum request body size in bytes. Requests exceeding this receive a 413 error |
67
- | `body.timeout` | `BODY_TIMEOUT` | number | `30000` (30 s) | Body parsing timeout in milliseconds. Requests exceeding this receive a 408 error |
68
-
69
- ### Auto-Documentation
70
-
71
- These options configure the `tejas generate:docs` CLI command and the auto-documentation system. See [Auto-Documentation](./auto-docs.md) for full details.
72
-
73
- | Config Key | Env Variable | Type | Default | Description |
74
- |------------|-------------|------|---------|-------------|
75
- | `docs.dirTargets` | `DOCS_DIR_TARGETS` | string | `"targets"` | Target directory for doc generation (can differ from `dir.targets`) |
76
- | `docs.output` | — | string | `"./openapi.json"` | Output path for the generated OpenAPI spec |
77
- | `docs.title` | | string | `"API"` | API title in the OpenAPI `info` block |
78
- | `docs.version` | — | string | `"1.0.0"` | API version in the OpenAPI `info` block |
79
- | `docs.description` | | string | `""` | API description |
80
- | `docs.level` | — | number | `1` | LLM enhancement level (1–3). Higher = better docs, more tokens |
81
- | `docs.llm.baseURL` | `LLM_BASE_URL` | string | `"https://api.openai.com/v1"` | LLM provider endpoint |
82
- | `docs.llm.apiKey` | `LLM_API_KEY` | string | | LLM provider API key |
83
- | `docs.llm.model` | `LLM_MODEL` | string | `"gpt-4o-mini"` | LLM model name |
84
- | `docs.overviewPath` | — | string | `"./API_OVERVIEW.md"` | Path for the generated overview page (level 3 only) |
85
- | `docs.productionBranch` | `DOCS_PRODUCTION_BRANCH` | string | `"main"` | Git branch that triggers `docs:on-push` |
86
-
87
- ## Configuration File
88
-
89
- Create a `tejas.config.json` in your project root:
90
-
91
- ```json
92
- {
93
- "entry": "app.js",
94
- "port": 3000,
95
- "dir": {
96
- "targets": "targets"
97
- },
98
- "log": {
99
- "http_requests": true,
100
- "exceptions": true
101
- },
102
- "body": {
103
- "max_size": 5242880,
104
- "timeout": 15000
105
- },
106
- "docs": {
107
- "output": "./openapi.json",
108
- "title": "My API",
109
- "version": "1.0.0",
110
- "level": 2,
111
- "productionBranch": "main"
112
- }
113
- }
114
- ```
115
-
116
- ## Environment Variables
117
-
118
- Create a `.env` file in your project root. Tejas uses [tej-env](https://www.npmjs.com/package/tej-env) to load it automatically:
119
-
120
- ```bash
121
- # Server
122
- PORT=3000
123
-
124
- # Logging
125
- LOG_HTTP_REQUESTS=true
126
- LOG_EXCEPTIONS=true
127
-
128
- # Body limits
129
- BODY_MAX_SIZE=5242880
130
- BODY_TIMEOUT=15000
131
-
132
- # Target directory
133
- DIR_TARGETS=targets
134
-
135
- # LLM (for tejas generate:docs)
136
- LLM_BASE_URL=https://api.openai.com/v1
137
- LLM_API_KEY=sk-...
138
- LLM_MODEL=gpt-4o-mini
139
- ```
140
-
141
- ## Constructor Options
142
-
143
- Pass an object to `new Tejas()` using the same nested structure as `tejas.config.json`:
144
-
145
- ```javascript
146
- import Tejas from 'te.js';
147
-
148
- const app = new Tejas({
149
- port: 3000,
150
- log: {
151
- http_requests: true,
152
- exceptions: true
153
- },
154
- body: {
155
- max_size: 10 * 1024 * 1024,
156
- timeout: 30000
157
- }
158
- });
159
- ```
160
-
161
- Constructor options have the highest priority and override both the config file and environment variables.
162
-
163
- ## How Merging Works
164
-
165
- All configuration is flattened into a single-level object with uppercased keys:
166
-
167
- ```javascript
168
- // tejas.config.json
169
- { "log": { "http_requests": true } }
170
-
171
- // Becomes accessible as:
172
- env('LOG_HTTP_REQUESTS') // true
173
- ```
174
-
175
- The merge order is: config file values, then env vars override those, then constructor options override everything.
176
-
177
- ## Accessing Configuration at Runtime
178
-
179
- Use the `env()` function from `tej-env` to read any configuration value:
180
-
181
- ```javascript
182
- import { env } from 'tej-env';
183
-
184
- target.register('/info', (ammo) => {
185
- ammo.fire({
186
- port: env('PORT'),
187
- maxBodySize: env('BODY_MAX_SIZE')
188
- });
189
- });
190
- ```
191
-
192
- ## Auto-Registration
193
-
194
- Tejas automatically discovers and imports all files ending in `.target.js` from the configured `dir.targets` directory (recursively, including subdirectories):
195
-
196
- ```
197
- targets/
198
- ├── user.target.js --> Auto-loaded
199
- ├── auth.target.js --> Auto-loaded
200
- ├── utils.js --> Ignored (wrong suffix)
201
- └── api/
202
- └── v1.target.js --> Auto-loaded
203
- ```
204
-
205
- To change the targets directory:
206
-
207
- ```json
208
- {
209
- "dir": {
210
- "targets": "src/routes"
211
- }
212
- }
213
- ```
214
-
215
- ## Database Configuration
216
-
217
- Database connections are configured via `takeoff()` options, not through the config file:
218
-
219
- ```javascript
220
- app.takeoff({
221
- withRedis: { url: 'redis://localhost:6379' },
222
- withMongo: { uri: 'mongodb://localhost:27017/myapp' }
223
- });
224
- ```
225
-
226
- See [Database Integration](./database.md) for details.
227
-
228
- ## Next Steps
229
-
230
- - [Getting Started](./getting-started.md) — Build your first Tejas application
231
- - [Routing](./routing.md) — Define routes and endpoints
232
- - [Auto-Documentation](./auto-docs.md) — Generate OpenAPI docs from your code
233
- - [CLI Reference](./cli.md) — `tejas fly` and doc generation commands
1
+ # Configuration
2
+
3
+ Tejas provides a flexible configuration system that merges settings from multiple sources.
4
+
5
+ ## Configuration Sources
6
+
7
+ Settings are loaded from three sources. Later sources override earlier ones:
8
+
9
+ 1. **`tejas.config.json`** — file in your project root (lowest priority)
10
+ 2. **Environment variables** — from `.env` or system environment
11
+ 3. **Constructor options** — passed to `new Tejas({...})` (highest priority)
12
+
13
+ All configuration keys are normalized: nested objects are flattened with underscores and uppercased. For example, `log.http_requests` becomes the environment variable `LOG_HTTP_REQUESTS`.
14
+
15
+ ## Quick Start
16
+
17
+ The simplest way to configure Tejas is with a `tejas.config.json` file:
18
+
19
+ ```json
20
+ {
21
+ "port": 3000,
22
+ "dir": {
23
+ "targets": "targets"
24
+ },
25
+ "log": {
26
+ "http_requests": true,
27
+ "exceptions": true
28
+ }
29
+ }
30
+ ```
31
+
32
+ Or pass options directly to the constructor:
33
+
34
+ ```javascript
35
+ import Tejas from 'te.js';
36
+
37
+ const app = new Tejas({
38
+ port: 3000,
39
+ log: { http_requests: true }
40
+ });
41
+
42
+ app.takeoff();
43
+ ```
44
+
45
+ ## Complete Configuration Reference
46
+
47
+ ### Core
48
+
49
+ | Config Key | Env Variable | Type | Default | Description |
50
+ |------------|-------------|------|---------|-------------|
51
+ | `entry` | `ENTRY` | string | *(auto-resolved)* | Entry file for `tejas fly`. Falls back to `package.json` `main`, then `index.js` / `app.js` / `server.js` |
52
+ | `port` | `PORT` | number | `1403` | Server port |
53
+ | `dir.targets` | `DIR_TARGETS` | string | `"targets"` | Directory containing `.target.js` files for auto-discovery |
54
+
55
+ ### Logging
56
+
57
+ | Config Key | Env Variable | Type | Default | Description |
58
+ |------------|-------------|------|---------|-------------|
59
+ | `log.http_requests` | `LOG_HTTP_REQUESTS` | boolean | `false` | Log incoming HTTP requests (method, path, status, time) |
60
+ | `log.exceptions` | `LOG_EXCEPTIONS` | boolean | `false` | Log unhandled exceptions and errors |
61
+
62
+ ### Request Body
63
+
64
+ | Config Key | Env Variable | Type | Default | Description |
65
+ |------------|-------------|------|---------|-------------|
66
+ | `body.max_size` | `BODY_MAX_SIZE` | number | `10485760` (10 MB) | Maximum request body size in bytes. Requests exceeding this receive a 413 error |
67
+ | `body.timeout` | `BODY_TIMEOUT` | number | `30000` (30 s) | Body parsing timeout in milliseconds. Requests exceeding this receive a 408 error |
68
+
69
+ ### LLM configuration (feature as parent, LLM inside each feature)
70
+
71
+ Tejas uses a **feature-as-parent** pattern: each feature that needs an LLM has its own `*.llm` block (`docs.llm` for auto-documentation, `errors.llm` for LLM-inferred errors). **Inheritance from `LLM_*`:** unset feature-specific values fall back to `LLM_BASE_URL`, `LLM_API_KEY`, and `LLM_MODEL`. One set of `LLM_*` env vars can serve both features when you don't override with `DOCS_LLM_*` or `ERRORS_LLM_*`. You can also use different LLMs per feature (e.g. a lighter model for errors, a stronger one for docs).
72
+
73
+ ### Auto-Documentation
74
+
75
+ These options configure the `tejas generate:docs` CLI command and the auto-documentation system. The **`docs.llm`** block is the LLM configuration for this feature. See [Auto-Documentation](./auto-docs.md) for full details.
76
+
77
+ | Config Key | Env Variable | Type | Default | Description |
78
+ |------------|-------------|------|---------|-------------|
79
+ | `docs.dirTargets` | `DOCS_DIR_TARGETS` | string | `"targets"` | Target directory for doc generation (can differ from `dir.targets`) |
80
+ | `docs.output` | — | string | `"./openapi.json"` | Output path for the generated OpenAPI spec |
81
+ | `docs.title` | | string | `"API"` | API title in the OpenAPI `info` block |
82
+ | `docs.version` | | string | `"1.0.0"` | API version in the OpenAPI `info` block |
83
+ | `docs.description` | | string | `""` | API description |
84
+ | `docs.level` | — | number | `1` | LLM enhancement level (1–3). Higher = better docs, more tokens |
85
+ | `docs.llm.baseURL` | `DOCS_LLM_BASE_URL` or `LLM_BASE_URL` | string | `"https://api.openai.com/v1"` | LLM provider endpoint for auto-docs |
86
+ | `docs.llm.apiKey` | `DOCS_LLM_API_KEY` or `LLM_API_KEY` | string | — | LLM provider API key for auto-docs |
87
+ | `docs.llm.model` | `DOCS_LLM_MODEL` or `LLM_MODEL` | string | `"gpt-4o-mini"` | LLM model for auto-docs |
88
+ | `docs.overviewPath` | — | string | `"./API_OVERVIEW.md"` | Path for the generated overview page (level 3 only) |
89
+ | `docs.productionBranch` | `DOCS_PRODUCTION_BRANCH` | string | `"main"` | Git branch that triggers `docs:on-push` |
90
+
91
+ ### Error handling (LLM-inferred errors)
92
+
93
+ When [LLM-inferred error codes and messages](./error-handling.md#llm-inferred-errors) are enabled, the **`errors.llm`** block configures the LLM used for inferring status code and message when you call `ammo.throw()` without explicit code or message. Unset values fall back to `LLM_BASE_URL`, `LLM_API_KEY`, `LLM_MODEL`. You can also enable (and optionally set connection options) by calling **`app.withLLMErrors(config?)`** before `takeoff()` — e.g. `app.withLLMErrors()` to use env/config for baseURL, apiKey, model, or `app.withLLMErrors({ baseURL, apiKey, model, messageType })` to override in code.
94
+
95
+ | Config Key | Env Variable | Type | Default | Description |
96
+ |------------|-------------|------|---------|-------------|
97
+ | `errors.llm.enabled` | `ERRORS_LLM_ENABLED` or `LLM_*` (for connection) | boolean | `false` | Enable LLM-inferred error code and message for `ammo.throw()` |
98
+ | `errors.llm.baseURL` | `ERRORS_LLM_BASE_URL` or `LLM_BASE_URL` | string | `"https://api.openai.com/v1"` | LLM provider endpoint for error inference |
99
+ | `errors.llm.apiKey` | `ERRORS_LLM_API_KEY` or `LLM_API_KEY` | string | — | LLM provider API key for error inference |
100
+ | `errors.llm.model` | `ERRORS_LLM_MODEL` or `LLM_MODEL` | string | `"gpt-4o-mini"` | LLM model for error inference |
101
+ | `errors.llm.messageType` | `ERRORS_LLM_MESSAGE_TYPE` or `LLM_MESSAGE_TYPE` | `"endUser"` \| `"developer"` | `"endUser"` | Default tone for LLM-generated message: `endUser` (safe for clients) or `developer` (technical detail). Overridable per `ammo.throw()` call. |
102
+
103
+ When enabled, the same behaviour applies whether you call `ammo.throw()` or the framework calls it when it catches an error — one mechanism, no separate config.
104
+
105
+ ## Configuration File
106
+
107
+ Create a `tejas.config.json` in your project root:
108
+
109
+ ```json
110
+ {
111
+ "entry": "app.js",
112
+ "port": 3000,
113
+ "dir": {
114
+ "targets": "targets"
115
+ },
116
+ "log": {
117
+ "http_requests": true,
118
+ "exceptions": true
119
+ },
120
+ "body": {
121
+ "max_size": 5242880,
122
+ "timeout": 15000
123
+ },
124
+ "docs": {
125
+ "output": "./openapi.json",
126
+ "title": "My API",
127
+ "version": "1.0.0",
128
+ "level": 2,
129
+ "productionBranch": "main",
130
+ "llm": {
131
+ "baseURL": "https://api.openai.com/v1",
132
+ "model": "gpt-4o-mini"
133
+ }
134
+ },
135
+ "errors": {
136
+ "llm": {
137
+ "enabled": true,
138
+ "baseURL": "https://api.openai.com/v1",
139
+ "model": "gpt-4o-mini",
140
+ "messageType": "endUser"
141
+ }
142
+ }
143
+ }
144
+ ```
145
+
146
+ ## Environment Variables
147
+
148
+ Create a `.env` file in your project root. Tejas uses [tej-env](https://www.npmjs.com/package/tej-env) to load it automatically:
149
+
150
+ ```bash
151
+ # Server
152
+ PORT=3000
153
+
154
+ # Logging
155
+ LOG_HTTP_REQUESTS=true
156
+ LOG_EXCEPTIONS=true
157
+
158
+ # Body limits
159
+ BODY_MAX_SIZE=5242880
160
+ BODY_TIMEOUT=15000
161
+
162
+ # Target directory
163
+ DIR_TARGETS=targets
164
+
165
+ # LLM shared fallback for docs.llm and errors.llm when feature-specific vars are unset
166
+ LLM_BASE_URL=https://api.openai.com/v1
167
+ LLM_API_KEY=sk-...
168
+ LLM_MODEL=gpt-4o-mini
169
+
170
+ # Optional: override per feature (docs.llm)
171
+ # DOCS_LLM_BASE_URL=...
172
+ # DOCS_LLM_API_KEY=...
173
+ # DOCS_LLM_MODEL=...
174
+
175
+ # Optional: override for error-inference (errors.llm)
176
+ # ERRORS_LLM_ENABLED=true
177
+ # ERRORS_LLM_BASE_URL=...
178
+ # ERRORS_LLM_API_KEY=...
179
+ # ERRORS_LLM_MODEL=...
180
+ # ERRORS_LLM_MESSAGE_TYPE=endUser # or "developer" for technical messages
181
+ ```
182
+
183
+ ## Constructor Options
184
+
185
+ Pass an object to `new Tejas()` using the same nested structure as `tejas.config.json`:
186
+
187
+ ```javascript
188
+ import Tejas from 'te.js';
189
+
190
+ const app = new Tejas({
191
+ port: 3000,
192
+ log: {
193
+ http_requests: true,
194
+ exceptions: true
195
+ },
196
+ body: {
197
+ max_size: 10 * 1024 * 1024,
198
+ timeout: 30000
199
+ }
200
+ });
201
+ ```
202
+
203
+ Constructor options have the highest priority and override both the config file and environment variables.
204
+
205
+ ## How Merging Works
206
+
207
+ All configuration is flattened into a single-level object with uppercased keys:
208
+
209
+ ```javascript
210
+ // tejas.config.json
211
+ { "log": { "http_requests": true } }
212
+
213
+ // Becomes accessible as:
214
+ env('LOG_HTTP_REQUESTS') // true
215
+ ```
216
+
217
+ The merge order is: config file values, then env vars override those, then constructor options override everything.
218
+
219
+ ## Accessing Configuration at Runtime
220
+
221
+ Use the `env()` function from `tej-env` to read any configuration value:
222
+
223
+ ```javascript
224
+ import { env } from 'tej-env';
225
+
226
+ target.register('/info', (ammo) => {
227
+ ammo.fire({
228
+ port: env('PORT'),
229
+ maxBodySize: env('BODY_MAX_SIZE')
230
+ });
231
+ });
232
+ ```
233
+
234
+ ## Auto-Registration
235
+
236
+ Tejas automatically discovers and imports all files ending in `.target.js` from the configured `dir.targets` directory (recursively, including subdirectories):
237
+
238
+ ```
239
+ targets/
240
+ ├── user.target.js --> Auto-loaded
241
+ ├── auth.target.js --> Auto-loaded
242
+ ├── utils.js --> Ignored (wrong suffix)
243
+ └── api/
244
+ └── v1.target.js --> Auto-loaded
245
+ ```
246
+
247
+ To change the targets directory:
248
+
249
+ ```json
250
+ {
251
+ "dir": {
252
+ "targets": "src/routes"
253
+ }
254
+ }
255
+ ```
256
+
257
+ ## Database Configuration
258
+
259
+ Database connections are configured via `takeoff()` options, not through the config file:
260
+
261
+ ```javascript
262
+ app.takeoff({
263
+ withRedis: { url: 'redis://localhost:6379' },
264
+ withMongo: { uri: 'mongodb://localhost:27017/myapp' }
265
+ });
266
+ ```
267
+
268
+ See [Database Integration](./database.md) for details.
269
+
270
+ ## Next Steps
271
+
272
+ - [Getting Started](./getting-started.md) — Build your first Tejas application
273
+ - [Routing](./routing.md) — Define routes and endpoints
274
+ - [Auto-Documentation](./auto-docs.md) — Generate OpenAPI docs from your code
275
+ - [CLI Reference](./cli.md) — `tejas fly` and doc generation commands