blaizejs 0.1.0 โ 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +746 -198
- package/dist/index.cjs +314 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +314 -40
- package/dist/index.js.map +1 -1
- package/package.json +23 -24
package/README.md
CHANGED
|
@@ -1,308 +1,856 @@
|
|
|
1
|
-
# BlaizeJS
|
|
1
|
+
# ๐ BlaizeJS Core
|
|
2
|
+
|
|
3
|
+
> A blazing-fast, type-safe Node.js framework with file-based routing, powerful middleware, and end-to-end type safety
|
|
4
|
+
|
|
5
|
+
[](https://badge.fury.io/js/blaizejs)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://www.typescriptlang.org/)
|
|
8
|
+
|
|
9
|
+
## ๐ Table of Contents
|
|
10
|
+
|
|
11
|
+
- [๐ Features](#-features)
|
|
12
|
+
- [๐ฆ Installation](#-installation)
|
|
13
|
+
- [๐ Quick Start](#-quick-start)
|
|
14
|
+
- [๐๏ธ Architecture Overview](#๏ธ-architecture-overview)
|
|
15
|
+
- [๐ Project Structure](#-project-structure)
|
|
16
|
+
- [๐ Production Deployment](#-production-deployment)
|
|
17
|
+
- [๐ Framework Modules](#-framework-modules)
|
|
18
|
+
- [๐งฉ Plugin Ecosystem](#-plugin-ecosystem)
|
|
19
|
+
- [๐ก Type-Safe Client](#-type-safe-client)
|
|
20
|
+
- [โ
Testing](#-testing)
|
|
21
|
+
- [๐ค Contributing](#-contributing)
|
|
22
|
+
- [๐บ๏ธ Roadmap](#๏ธ-roadmap)
|
|
23
|
+
|
|
24
|
+
## ๐ Features
|
|
25
|
+
|
|
26
|
+
- โก **Blazing Fast Performance** - HTTP/2 by default with HTTP/1.1 fallback
|
|
27
|
+
- ๐ **End-to-End Type Safety** - Full TypeScript support from API to client
|
|
28
|
+
- ๐ **File-Based Routing** - Intuitive routing based on file structure
|
|
29
|
+
- ๐ **Powerful Middleware System** - Composable middleware with onion-style execution
|
|
30
|
+
- ๐งฉ **Plugin Architecture** - Extensible with lifecycle management
|
|
31
|
+
- ๐ **Context Management** - AsyncLocalStorage for automatic context propagation
|
|
32
|
+
- ๐ **Hot Reloading** - Instant development feedback
|
|
33
|
+
- ๐ก๏ธ **Schema Validation** - Built-in Zod integration for request/response validation
|
|
34
|
+
- ๐ **Client Generation** - Automatic type-safe API client generation
|
|
35
|
+
- ๐ **Production Ready** - Graceful shutdown, error handling, and monitoring
|
|
36
|
+
|
|
37
|
+
## ๐ฆ Installation
|
|
2
38
|
|
|
3
|
-
|
|
39
|
+
```bash
|
|
40
|
+
# Using pnpm (recommended)
|
|
41
|
+
pnpm add blaizejs
|
|
4
42
|
|
|
5
|
-
|
|
43
|
+
# Using npm
|
|
44
|
+
npm install blaizejs
|
|
6
45
|
|
|
7
|
-
|
|
46
|
+
# Using yarn
|
|
47
|
+
yarn add blaizejs
|
|
48
|
+
```
|
|
8
49
|
|
|
9
|
-
|
|
50
|
+
### ๐ Requirements
|
|
10
51
|
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **Middleware System** - Intuitive middleware chain for request/response processing
|
|
15
|
-
- **Plugin Architecture** - Extend functionality with a powerful plugin system
|
|
16
|
-
- **Context API** - Clean, unified interface for request handling using AsyncLocalStorage
|
|
17
|
-
- **Developer Experience** - Fast refresh during development with minimal configuration
|
|
52
|
+
- **Node.js**: >= 22.0.0 (LTS recommended)
|
|
53
|
+
- **TypeScript**: >= 5.8.3 (for development)
|
|
54
|
+
- **Package Manager**: pnpm 9.7.0+ (recommended)
|
|
18
55
|
|
|
19
|
-
##
|
|
56
|
+
## ๐ Quick Start
|
|
20
57
|
|
|
21
|
-
|
|
22
|
-
blaizejs/
|
|
23
|
-
โโโ src/ # Source code
|
|
24
|
-
โ โโโ context/ # Request/response context
|
|
25
|
-
โ โโโ middleware/ # Middleware system
|
|
26
|
-
โ โโโ plugins/ # Plugin system
|
|
27
|
-
โ โโโ router/ # File-based routing
|
|
28
|
-
โ โโโ server/ # HTTP/2 server implementation
|
|
29
|
-
โ โโโ types/ # TypeScript type definitions
|
|
30
|
-
โ โโโ utils/ # Utility functions
|
|
31
|
-
โ โโโ index.ts # Main entry point
|
|
32
|
-
โโโ examples/ # Example applications
|
|
33
|
-
โ โโโ basic/ # Basic server example
|
|
34
|
-
โ โโโ middleware/ # Middleware examples
|
|
35
|
-
โ โโโ plugins/ # Plugin examples
|
|
36
|
-
โ โโโ routing/ # Routing examples
|
|
37
|
-
โโโ tests/ # Test suite
|
|
38
|
-
โ โโโ context/ # Context tests
|
|
39
|
-
โ โโโ middleware/ # Middleware tests
|
|
40
|
-
โ โโโ plugins/ # Plugin tests
|
|
41
|
-
โ โโโ router/ # Router tests
|
|
42
|
-
โ โโโ server/ # Server tests
|
|
43
|
-
โ โโโ integration/ # Integration tests
|
|
44
|
-
โโโ package.json # Project configuration
|
|
45
|
-
โโโ tsconfig.json # TypeScript configuration
|
|
46
|
-
```
|
|
58
|
+
### ๐ฏ Create Your First Server
|
|
47
59
|
|
|
48
|
-
|
|
60
|
+
```typescript
|
|
61
|
+
import { createServer } from 'blaizejs';
|
|
62
|
+
import { fileURLToPath } from 'node:url';
|
|
63
|
+
import path from 'node:path';
|
|
49
64
|
|
|
50
|
-
|
|
65
|
+
// Required for ESM module path resolution
|
|
66
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
67
|
+
const __dirname = path.dirname(__filename);
|
|
51
68
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
69
|
+
// Create server with automatic routing
|
|
70
|
+
const server = createServer({
|
|
71
|
+
routesDir: path.resolve(__dirname, './routes'),
|
|
72
|
+
});
|
|
55
73
|
|
|
56
|
-
|
|
74
|
+
await server.listen();
|
|
75
|
+
console.log('๐ Server running on https://localhost:3000');
|
|
76
|
+
```
|
|
57
77
|
|
|
58
|
-
Create
|
|
78
|
+
### ๐ Create Your First Route
|
|
59
79
|
|
|
60
80
|
```typescript
|
|
61
|
-
|
|
81
|
+
// routes/users.ts
|
|
82
|
+
import { createGetRoute, createPostRoute } from 'blaizejs';
|
|
83
|
+
import { z } from 'zod';
|
|
84
|
+
|
|
85
|
+
// GET /users - List users with type safety
|
|
86
|
+
export const getUsers = createGetRoute({
|
|
87
|
+
schema: {
|
|
88
|
+
query: z.object({
|
|
89
|
+
limit: z.coerce.number().min(1).max(100).default(10),
|
|
90
|
+
search: z.string().optional(),
|
|
91
|
+
}),
|
|
92
|
+
response: z.object({
|
|
93
|
+
users: z.array(
|
|
94
|
+
z.object({
|
|
95
|
+
id: z.string(),
|
|
96
|
+
name: z.string(),
|
|
97
|
+
email: z.string(),
|
|
98
|
+
})
|
|
99
|
+
),
|
|
100
|
+
total: z.number(),
|
|
101
|
+
}),
|
|
102
|
+
},
|
|
103
|
+
handler: async ctx => {
|
|
104
|
+
// Query params are automatically typed and validated
|
|
105
|
+
const { limit, search } = ctx.request.query;
|
|
62
106
|
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
107
|
+
const users = await findUsers({ limit, search });
|
|
108
|
+
return { users, total: users.length };
|
|
109
|
+
},
|
|
66
110
|
});
|
|
67
111
|
|
|
68
|
-
|
|
69
|
-
|
|
112
|
+
// POST /users - Create user with validation
|
|
113
|
+
export const createUser = createPostRoute({
|
|
114
|
+
schema: {
|
|
115
|
+
body: z.object({
|
|
116
|
+
name: z.string().min(1),
|
|
117
|
+
email: z.string().email(),
|
|
118
|
+
}),
|
|
119
|
+
response: z.object({
|
|
120
|
+
id: z.string(),
|
|
121
|
+
name: z.string(),
|
|
122
|
+
email: z.string(),
|
|
123
|
+
createdAt: z.string(),
|
|
124
|
+
}),
|
|
125
|
+
},
|
|
126
|
+
handler: async ctx => {
|
|
127
|
+
// Request body is automatically validated
|
|
128
|
+
const userData = ctx.request.body;
|
|
129
|
+
|
|
130
|
+
const user = await createNewUser(userData);
|
|
131
|
+
return user;
|
|
132
|
+
},
|
|
70
133
|
});
|
|
71
134
|
```
|
|
72
135
|
|
|
73
|
-
|
|
136
|
+
### ๐ Add Middleware
|
|
74
137
|
|
|
75
138
|
```typescript
|
|
76
|
-
import {
|
|
139
|
+
import { createServer, createMiddleware } from 'blaizejs';
|
|
140
|
+
import { fileURLToPath } from 'node:url';
|
|
141
|
+
import path from 'node:path';
|
|
142
|
+
|
|
143
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
144
|
+
const __dirname = path.dirname(__filename);
|
|
145
|
+
|
|
146
|
+
// Create logging middleware
|
|
147
|
+
const logger = createMiddleware({
|
|
148
|
+
name: 'logger',
|
|
149
|
+
handler: async (ctx, next) => {
|
|
150
|
+
const start = Date.now();
|
|
151
|
+
console.log(`โ ${ctx.request.method} ${ctx.request.path}`);
|
|
77
152
|
|
|
78
|
-
// Export default middleware function
|
|
79
|
-
export default function helloRoute(): Middleware {
|
|
80
|
-
return async (ctx, next) => {
|
|
81
|
-
ctx.json({ message: 'Hello, World!' });
|
|
82
153
|
await next();
|
|
83
|
-
|
|
84
|
-
|
|
154
|
+
|
|
155
|
+
const duration = Date.now() - start;
|
|
156
|
+
console.log(`โ ${ctx.response.raw.statusCode} (${duration}ms)`);
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// Create server with middleware
|
|
161
|
+
const server = createServer({
|
|
162
|
+
routesDir: path.resolve(__dirname, './routes'),
|
|
163
|
+
middleware: [logger],
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
await server.listen();
|
|
85
167
|
```
|
|
86
168
|
|
|
87
|
-
|
|
169
|
+
## ๐๏ธ Architecture Overview
|
|
88
170
|
|
|
89
|
-
|
|
90
|
-
|
|
171
|
+
BlaizeJS is built around five core modules that work together seamlessly:
|
|
172
|
+
|
|
173
|
+
```mermaid
|
|
174
|
+
graph TD
|
|
175
|
+
A[Server] --> B[Router]
|
|
176
|
+
A --> C[Context]
|
|
177
|
+
B --> D[Middleware]
|
|
178
|
+
A --> E[Plugins]
|
|
179
|
+
|
|
180
|
+
B --> F[File-based Routes]
|
|
181
|
+
C --> G[AsyncLocalStorage]
|
|
182
|
+
D --> H[Composable Pipeline]
|
|
183
|
+
E --> I[Lifecycle Management]
|
|
184
|
+
|
|
185
|
+
F --> J[Type-safe Handlers]
|
|
186
|
+
G --> K[State Management]
|
|
187
|
+
H --> L[Request/Response Flow]
|
|
188
|
+
I --> M[Plugin Integration]
|
|
91
189
|
```
|
|
92
190
|
|
|
93
|
-
|
|
191
|
+
### ๐ Request Lifecycle
|
|
94
192
|
|
|
95
|
-
|
|
193
|
+
1. **Server** receives HTTP request
|
|
194
|
+
2. **Context** creates request/response wrappers with AsyncLocalStorage
|
|
195
|
+
3. **Router** matches request to file-based route
|
|
196
|
+
4. **Middleware** executes in onion-style pattern
|
|
197
|
+
5. **Route Handler** processes request with full type safety
|
|
198
|
+
6. **Context** sends validated response
|
|
96
199
|
|
|
97
|
-
|
|
200
|
+
## ๐ Project Structure
|
|
98
201
|
|
|
99
|
-
|
|
100
|
-
import { createServer, Middleware } from 'blaizejs';
|
|
202
|
+
### ๐ฏ Recommended Structure
|
|
101
203
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
204
|
+
```
|
|
205
|
+
my-blaize-app/
|
|
206
|
+
โโโ src/
|
|
207
|
+
โ โโโ server.ts # Server entry point
|
|
208
|
+
โ โโโ app-routes.ts # Route registry for blaize client
|
|
209
|
+
โ โโโ routes/ # File-based routes
|
|
210
|
+
โ โ โโโ index.ts # โ /
|
|
211
|
+
โ โ โโโ users.ts # โ /users
|
|
212
|
+
โ โ โโโ users/
|
|
213
|
+
โ โ โ โโโ [id].ts # โ /users/:id
|
|
214
|
+
โ โ โโโ api/
|
|
215
|
+
โ โ โโโ v1/
|
|
216
|
+
โ โ โโโ posts.ts # โ /api/v1/posts
|
|
217
|
+
โ โโโ middleware/ # Custom middleware
|
|
218
|
+
โ โโโ plugins/ # Custom plugins
|
|
219
|
+
โ โโโ types/ # Shared types
|
|
220
|
+
โโโ tests/ # Test files
|
|
221
|
+
โโโ package.json
|
|
222
|
+
โโโ tsconfig.json
|
|
223
|
+
```
|
|
106
224
|
|
|
107
|
-
|
|
225
|
+
### ๐ Module Responsibilities
|
|
108
226
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
227
|
+
| Module | Purpose | Key Features |
|
|
228
|
+
| -------------- | ------------------------- | -------------------------- |
|
|
229
|
+
| **Server** | HTTP server management | HTTP/2, SSL, lifecycle |
|
|
230
|
+
| **Router** | Request routing | File-based, type-safe |
|
|
231
|
+
| **Context** | Request/response handling | AsyncLocalStorage, state |
|
|
232
|
+
| **Middleware** | Request processing | Composable, error handling |
|
|
233
|
+
| **Plugins** | Framework extension | Lifecycle, validation |
|
|
112
234
|
|
|
113
|
-
|
|
114
|
-
const errorHandler: Middleware = async (ctx, next) => {
|
|
115
|
-
try {
|
|
116
|
-
await next();
|
|
117
|
-
} catch (err) {
|
|
118
|
-
console.error('Request error:', err);
|
|
119
|
-
ctx.status = 500;
|
|
120
|
-
ctx.json({
|
|
121
|
-
error: 'Internal Server Error',
|
|
122
|
-
message: process.env.NODE_ENV === 'production' ? undefined : String(err),
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
};
|
|
235
|
+
## ๐ Production Deployment
|
|
126
236
|
|
|
127
|
-
|
|
237
|
+
### โ ๏ธ HTTP/2 Hosting Limitations
|
|
238
|
+
|
|
239
|
+
BlaizeJS defaults to HTTP/2 for optimal performance, but many hosting providers don't expose SSL certificate access required for HTTP/2:
|
|
240
|
+
|
|
241
|
+
```typescript
|
|
242
|
+
// Production configuration for hosting providers
|
|
128
243
|
const server = createServer({
|
|
129
|
-
|
|
244
|
+
routesDir: path.resolve(__dirname, './routes'),
|
|
245
|
+
http2: {
|
|
246
|
+
// Disable HTTP/2 if certificates aren't accessible
|
|
247
|
+
enabled: process.env.HTTP2_ENABLED === 'true',
|
|
248
|
+
},
|
|
130
249
|
});
|
|
250
|
+
```
|
|
131
251
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
252
|
+
### ๐ง Hosting Provider Configurations
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
// Vercel/Netlify (HTTP/1.1 only)
|
|
256
|
+
const server = createServer({
|
|
257
|
+
port: parseInt(process.env.PORT || '3000'),
|
|
258
|
+
routesDir: path.resolve(__dirname, './routes'),
|
|
259
|
+
http2: { enabled: false },
|
|
136
260
|
});
|
|
137
261
|
|
|
138
|
-
|
|
139
|
-
|
|
262
|
+
// VPS/Dedicated (HTTP/2 with Let's Encrypt)
|
|
263
|
+
const server = createServer({
|
|
264
|
+
port: 443,
|
|
265
|
+
host: '0.0.0.0',
|
|
266
|
+
routesDir: path.resolve(__dirname, './routes'),
|
|
267
|
+
http2: {
|
|
268
|
+
enabled: true,
|
|
269
|
+
keyFile: '/etc/letsencrypt/live/yourdomain.com/privkey.pem',
|
|
270
|
+
certFile: '/etc/letsencrypt/live/yourdomain.com/fullchain.pem',
|
|
271
|
+
},
|
|
272
|
+
});
|
|
140
273
|
|
|
141
|
-
|
|
274
|
+
// Docker Container
|
|
275
|
+
const server = createServer({
|
|
276
|
+
port: parseInt(process.env.PORT || '3000'),
|
|
277
|
+
host: '0.0.0.0',
|
|
278
|
+
routesDir: path.resolve(__dirname, './routes'),
|
|
279
|
+
http2: {
|
|
280
|
+
enabled: process.env.SSL_CERT_PATH && process.env.SSL_KEY_PATH,
|
|
281
|
+
keyFile: process.env.SSL_KEY_PATH,
|
|
282
|
+
certFile: process.env.SSL_CERT_PATH,
|
|
283
|
+
},
|
|
284
|
+
});
|
|
285
|
+
```
|
|
142
286
|
|
|
143
|
-
|
|
287
|
+
### ๐ Environment Configuration
|
|
144
288
|
|
|
145
289
|
```typescript
|
|
146
|
-
//
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
290
|
+
// Environment-aware server setup
|
|
291
|
+
const getServerConfig = () => {
|
|
292
|
+
const env = process.env.NODE_ENV || 'development';
|
|
293
|
+
|
|
294
|
+
switch (env) {
|
|
295
|
+
case 'development':
|
|
296
|
+
return {
|
|
297
|
+
port: 3000,
|
|
298
|
+
routesDir: path.resolve(__dirname, './routes'),
|
|
299
|
+
http2: { enabled: true }, // Auto-generates certs
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
case 'production':
|
|
303
|
+
return {
|
|
304
|
+
port: parseInt(process.env.PORT || '443'),
|
|
305
|
+
host: '0.0.0.0',
|
|
306
|
+
routesDir: path.resolve(__dirname, './dist/routes'),
|
|
307
|
+
http2: {
|
|
308
|
+
enabled: !!process.env.SSL_CERT_PATH,
|
|
309
|
+
keyFile: process.env.SSL_KEY_PATH,
|
|
310
|
+
certFile: process.env.SSL_CERT_PATH,
|
|
311
|
+
},
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
case 'test':
|
|
315
|
+
return {
|
|
316
|
+
port: 0,
|
|
317
|
+
routesDir: path.resolve(__dirname, './test-fixtures/routes'),
|
|
318
|
+
http2: { enabled: false },
|
|
319
|
+
};
|
|
320
|
+
}
|
|
165
321
|
};
|
|
322
|
+
|
|
323
|
+
const server = createServer(getServerConfig());
|
|
166
324
|
```
|
|
167
325
|
|
|
168
|
-
|
|
326
|
+
> **๐ HTTP/2 Workaround:** We're actively working on solutions for HTTP/2 deployment in constrained hosting environments. Follow our roadmap for updates.
|
|
327
|
+
|
|
328
|
+
## ๐ Framework Modules
|
|
169
329
|
|
|
170
|
-
|
|
330
|
+
### ๐ Server Module
|
|
331
|
+
|
|
332
|
+
High-performance HTTP/2 server with graceful lifecycle management.
|
|
171
333
|
|
|
172
334
|
```typescript
|
|
173
335
|
import { createServer } from 'blaizejs';
|
|
174
|
-
import fs from 'node:fs';
|
|
175
|
-
import path from 'node:path';
|
|
176
336
|
|
|
177
|
-
// Create HTTP/2 server with TLS
|
|
178
337
|
const server = createServer({
|
|
179
338
|
port: 3000,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
339
|
+
routesDir: './routes',
|
|
340
|
+
http2: { enabled: true },
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
// Event-driven lifecycle
|
|
344
|
+
server.events.on('started', () => console.log('Server ready'));
|
|
345
|
+
server.events.on('stopping', () => console.log('Graceful shutdown'));
|
|
346
|
+
|
|
347
|
+
await server.listen();
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
[๐ Server Module Documentation](./src/server/README.md)
|
|
351
|
+
|
|
352
|
+
### ๐ Router Module
|
|
353
|
+
|
|
354
|
+
File-based routing with automatic path generation and type safety.
|
|
355
|
+
|
|
356
|
+
```typescript
|
|
357
|
+
import { createGetRoute } from 'blaizejs';
|
|
358
|
+
import { z } from 'zod';
|
|
359
|
+
|
|
360
|
+
// routes/posts/[id].ts โ GET /posts/:id
|
|
361
|
+
export const getPost = createGetRoute({
|
|
362
|
+
schema: {
|
|
363
|
+
params: z.object({ id: z.string().uuid() }),
|
|
364
|
+
response: z.object({
|
|
365
|
+
id: z.string(),
|
|
366
|
+
title: z.string(),
|
|
367
|
+
content: z.string(),
|
|
368
|
+
}),
|
|
369
|
+
},
|
|
370
|
+
handler: async (ctx, params) => {
|
|
371
|
+
return await findPost(params.id);
|
|
184
372
|
},
|
|
185
373
|
});
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
[๐ Router Module Documentation](./src/router/README.md)
|
|
377
|
+
|
|
378
|
+
### ๐ Context Module
|
|
379
|
+
|
|
380
|
+
Request/response context with AsyncLocalStorage integration.
|
|
186
381
|
|
|
187
|
-
|
|
382
|
+
```typescript
|
|
383
|
+
import { getCurrentContext, setState, getState } from 'blaizejs';
|
|
384
|
+
|
|
385
|
+
export const handler = async () => {
|
|
386
|
+
const ctx = getCurrentContext(); // Available anywhere
|
|
387
|
+
|
|
388
|
+
// Request data
|
|
389
|
+
const userAgent = ctx.request.header('user-agent');
|
|
390
|
+
const body = ctx.request.body;
|
|
391
|
+
|
|
392
|
+
// State management
|
|
393
|
+
setState('userId', '123');
|
|
394
|
+
const userId = getState<string>('userId');
|
|
395
|
+
|
|
396
|
+
// Response
|
|
397
|
+
return ctx.response.json({ success: true });
|
|
398
|
+
};
|
|
188
399
|
```
|
|
189
400
|
|
|
190
|
-
|
|
401
|
+
[๐ Context Module Documentation](./src/context/README.md)
|
|
191
402
|
|
|
192
|
-
|
|
403
|
+
### ๐ Middleware Module
|
|
404
|
+
|
|
405
|
+
Composable middleware with onion-style execution.
|
|
193
406
|
|
|
194
407
|
```typescript
|
|
195
|
-
import {
|
|
196
|
-
import corsPlugin from '@blaizejs/cors-plugin';
|
|
197
|
-
import loggerPlugin from '@blaizejs/logger-plugin';
|
|
408
|
+
import { createMiddleware, compose } from 'blaizejs';
|
|
198
409
|
|
|
199
|
-
const
|
|
200
|
-
|
|
410
|
+
const auth = createMiddleware({
|
|
411
|
+
name: 'auth',
|
|
412
|
+
handler: async (ctx, next) => {
|
|
413
|
+
// Pre-processing
|
|
414
|
+
const token = ctx.request.header('authorization');
|
|
415
|
+
if (!token) return ctx.response.status(401).json({ error: 'Unauthorized' });
|
|
416
|
+
|
|
417
|
+
await next();
|
|
418
|
+
|
|
419
|
+
// Post-processing
|
|
420
|
+
ctx.response.header('X-Authenticated', 'true');
|
|
421
|
+
},
|
|
201
422
|
});
|
|
202
423
|
|
|
203
|
-
//
|
|
204
|
-
|
|
205
|
-
|
|
424
|
+
// Compose multiple middleware
|
|
425
|
+
const apiMiddleware = compose([cors, auth, rateLimit]);
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
[๐ Middleware Module Documentation](./src/middleware/README.md)
|
|
429
|
+
|
|
430
|
+
### ๐งฉ Plugins Module
|
|
431
|
+
|
|
432
|
+
Extensible plugin system with lifecycle management.
|
|
433
|
+
|
|
434
|
+
```typescript
|
|
435
|
+
import { createPlugin } from 'blaizejs';
|
|
436
|
+
|
|
437
|
+
const databasePlugin = createPlugin(
|
|
438
|
+
'database',
|
|
439
|
+
'1.0.0',
|
|
440
|
+
async (server, options) => {
|
|
441
|
+
let db: Database;
|
|
442
|
+
|
|
443
|
+
return {
|
|
444
|
+
initialize: async () => {
|
|
445
|
+
db = await connectToDatabase(options.connectionString);
|
|
446
|
+
server.context.setGlobal('db', db);
|
|
447
|
+
},
|
|
448
|
+
terminate: async () => {
|
|
449
|
+
await db.close();
|
|
450
|
+
},
|
|
451
|
+
};
|
|
452
|
+
},
|
|
453
|
+
{ connectionString: 'mongodb://localhost:27017/app' }
|
|
454
|
+
);
|
|
455
|
+
|
|
456
|
+
const server = createServer({
|
|
457
|
+
routesDir: './routes',
|
|
458
|
+
plugins: [databasePlugin()],
|
|
206
459
|
});
|
|
207
460
|
```
|
|
208
461
|
|
|
209
|
-
|
|
462
|
+
[๐ Plugins Module Documentation](./src/plugins/README.md)
|
|
463
|
+
|
|
464
|
+
## ๐งฉ Plugin Ecosystem
|
|
465
|
+
|
|
466
|
+
### ๐๏ธ Official Plugins
|
|
467
|
+
|
|
468
|
+
| Plugin | Purpose | Status |
|
|
469
|
+
| ----------------------------- | ------------------------------ | -------------- |
|
|
470
|
+
| `@blaizejs/auth-plugin` | Authentication & authorization | ๐ Coming Soon |
|
|
471
|
+
| `@blaizejs/database-plugin` | Database integration | ๐ Coming Soon |
|
|
472
|
+
| `@blaizejs/cache-plugin` | Caching strategies | ๐ Coming Soon |
|
|
473
|
+
| `@blaizejs/validation-plugin` | Enhanced validation | ๐ Coming Soon |
|
|
474
|
+
| `@blaizejs/monitoring-plugin` | Metrics & observability | ๐ Coming Soon |
|
|
475
|
+
|
|
476
|
+
### ๐ ๏ธ Creating Custom Plugins
|
|
477
|
+
|
|
478
|
+
```typescript
|
|
479
|
+
import { createPlugin } from 'blaizejs';
|
|
480
|
+
|
|
481
|
+
export const myPlugin = createPlugin(
|
|
482
|
+
'my-plugin',
|
|
483
|
+
'1.0.0',
|
|
484
|
+
(server, options) => {
|
|
485
|
+
// Add middleware
|
|
486
|
+
server.use(
|
|
487
|
+
createMiddleware({
|
|
488
|
+
name: 'my-middleware',
|
|
489
|
+
handler: async (ctx, next) => {
|
|
490
|
+
// Plugin logic
|
|
491
|
+
await next();
|
|
492
|
+
},
|
|
493
|
+
})
|
|
494
|
+
);
|
|
495
|
+
|
|
496
|
+
// Add routes
|
|
497
|
+
server.router.addRoute('GET', '/plugin-route', {
|
|
498
|
+
handler: () => ({ message: 'From plugin' }),
|
|
499
|
+
});
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
/* default options */
|
|
503
|
+
}
|
|
504
|
+
);
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
## ๐ก Type-Safe Client
|
|
508
|
+
|
|
509
|
+
BlaizeJS provides seamless client generation with the `@blaizejs/client` package for consuming your APIs with full type safety:
|
|
210
510
|
|
|
211
|
-
|
|
511
|
+
### ๐ฆ Client Installation
|
|
212
512
|
|
|
213
513
|
```bash
|
|
214
|
-
# Install the
|
|
215
|
-
pnpm
|
|
514
|
+
# Install the client package
|
|
515
|
+
pnpm add @blaizejs/client
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
### ๐ฏ Export Your Routes
|
|
519
|
+
|
|
520
|
+
First, export your routes from your server for client consumption:
|
|
521
|
+
|
|
522
|
+
```typescript
|
|
523
|
+
// routes/hello.ts
|
|
524
|
+
import { createGetRoute, createPostRoute } from 'blaizejs';
|
|
525
|
+
import { z } from 'zod';
|
|
526
|
+
|
|
527
|
+
export const getHello = createGetRoute({
|
|
528
|
+
schema: {
|
|
529
|
+
query: z.object({
|
|
530
|
+
name: z.string().optional(),
|
|
531
|
+
}),
|
|
532
|
+
response: z.object({
|
|
533
|
+
message: z.string(),
|
|
534
|
+
timestamp: z.string(),
|
|
535
|
+
}),
|
|
536
|
+
},
|
|
537
|
+
handler: async ctx => {
|
|
538
|
+
const { name } = ctx.request.query;
|
|
539
|
+
return {
|
|
540
|
+
message: `Hello ${name || 'World'}!`,
|
|
541
|
+
timestamp: new Date().toISOString(),
|
|
542
|
+
};
|
|
543
|
+
},
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
export const postHello = createPostRoute({
|
|
547
|
+
schema: {
|
|
548
|
+
body: z.object({
|
|
549
|
+
message: z.string(),
|
|
550
|
+
}),
|
|
551
|
+
response: z.object({
|
|
552
|
+
id: z.string(),
|
|
553
|
+
echo: z.string(),
|
|
554
|
+
}),
|
|
555
|
+
},
|
|
556
|
+
handler: async ctx => {
|
|
557
|
+
const { message } = ctx.request.body;
|
|
558
|
+
return {
|
|
559
|
+
id: crypto.randomUUID(),
|
|
560
|
+
echo: message,
|
|
561
|
+
};
|
|
562
|
+
},
|
|
563
|
+
});
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
```typescript
|
|
567
|
+
// app-routes.ts - Export all your routes
|
|
568
|
+
import { getHello, postHello } from './routes/hello.js';
|
|
569
|
+
|
|
570
|
+
export const routes = {
|
|
571
|
+
getHello,
|
|
572
|
+
postHello,
|
|
573
|
+
} as const;
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
### ๐ Create Type-Safe Client
|
|
577
|
+
|
|
578
|
+
```typescript
|
|
579
|
+
// client.ts
|
|
580
|
+
import { createClient } from '@blaizejs/client';
|
|
581
|
+
import { routes } from './app-routes.js';
|
|
582
|
+
|
|
583
|
+
// Create client with full type safety
|
|
584
|
+
const client = createClient('http://localhost:3000', routes);
|
|
585
|
+
|
|
586
|
+
// Fully typed API calls with method grouping
|
|
587
|
+
const helloData = await client.$get.getHello({
|
|
588
|
+
query: { name: 'TypeScript' }, // Typed and validated
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
console.log(helloData.message); // Type: string
|
|
592
|
+
console.log(helloData.timestamp); // Type: string
|
|
593
|
+
|
|
594
|
+
// POST request with body validation
|
|
595
|
+
const postData = await client.$post.postHello({
|
|
596
|
+
body: { message: 'Hello from client!' }, // Typed and validated
|
|
597
|
+
});
|
|
598
|
+
|
|
599
|
+
console.log(postData.id); // Type: string
|
|
600
|
+
console.log(postData.echo); // Type: string
|
|
601
|
+
```
|
|
216
602
|
|
|
217
|
-
|
|
218
|
-
blaize create my-api
|
|
603
|
+
### ๐๏ธ Client Configuration
|
|
219
604
|
|
|
220
|
-
|
|
221
|
-
|
|
605
|
+
```typescript
|
|
606
|
+
import { createClient } from '@blaizejs/client';
|
|
607
|
+
import type { ClientConfig } from '@blaizejs/types';
|
|
608
|
+
|
|
609
|
+
// Advanced client configuration
|
|
610
|
+
const config: ClientConfig = {
|
|
611
|
+
baseUrl: 'https://api.example.com',
|
|
612
|
+
defaultHeaders: {
|
|
613
|
+
Authorization: 'Bearer your-token',
|
|
614
|
+
'User-Agent': 'MyApp/1.0.0',
|
|
615
|
+
},
|
|
616
|
+
timeout: 10000,
|
|
617
|
+
};
|
|
618
|
+
|
|
619
|
+
const client = createClient(config, routes);
|
|
620
|
+
|
|
621
|
+
// All requests will use the configured headers and timeout
|
|
622
|
+
const data = await client.$get.getHello();
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
### ๐ Client Method Structure
|
|
626
|
+
|
|
627
|
+
The client organizes methods by HTTP verb using the `$method` pattern:
|
|
628
|
+
|
|
629
|
+
```typescript
|
|
630
|
+
// Available client methods
|
|
631
|
+
client.$get.routeName(); // GET requests
|
|
632
|
+
client.$post.routeName(); // POST requests
|
|
633
|
+
client.$put.routeName(); // PUT requests
|
|
634
|
+
client.$delete.routeName(); // DELETE requests
|
|
635
|
+
client.$patch.routeName(); // PATCH requests
|
|
636
|
+
client.$head.routeName(); // HEAD requests
|
|
637
|
+
client.$options.routeName(); // OPTIONS requests
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
**Key Client Features:**
|
|
641
|
+
|
|
642
|
+
- ๐ **Full Type Safety** - Automatically inferred from your route schemas
|
|
643
|
+
- โ
**Request Validation** - Client-side validation before sending requests
|
|
644
|
+
- ๐ **Response Validation** - Runtime validation of API responses
|
|
645
|
+
- ๐ฏ **IntelliSense Support** - Complete autocomplete for all routes and parameters
|
|
646
|
+
- ๐ **Error Handling** - Typed error responses with detailed validation messages
|
|
647
|
+
- โก **Lightweight** - Minimal runtime overhead with proxy-based implementation
|
|
222
648
|
|
|
223
|
-
|
|
224
|
-
blaize build
|
|
649
|
+
[๐ Client Package Documentation](https://github.com/jleajones/blaize/tree/main/packages/blaize-client#readme)
|
|
225
650
|
|
|
226
|
-
|
|
227
|
-
|
|
651
|
+
## โ
Testing
|
|
652
|
+
|
|
653
|
+
### ๐งช Framework Testing Tools
|
|
654
|
+
|
|
655
|
+
BlaizeJS provides comprehensive testing utilities:
|
|
656
|
+
|
|
657
|
+
```typescript
|
|
658
|
+
import { describe, test, expect } from 'vitest';
|
|
659
|
+
import { createTestContext } from '@blaizejs/testing-utils';
|
|
660
|
+
import { getUsers } from '../routes/users';
|
|
661
|
+
|
|
662
|
+
describe('Users API', () => {
|
|
663
|
+
test('should return paginated users', async () => {
|
|
664
|
+
const ctx = createTestContext({
|
|
665
|
+
method: 'GET',
|
|
666
|
+
path: '/users',
|
|
667
|
+
query: { limit: '5', offset: '0' },
|
|
668
|
+
});
|
|
669
|
+
|
|
670
|
+
const result = await getUsers.handler(ctx, {});
|
|
671
|
+
|
|
672
|
+
expect(result).toEqual({
|
|
673
|
+
users: expect.arrayContaining([
|
|
674
|
+
expect.objectContaining({
|
|
675
|
+
id: expect.any(String),
|
|
676
|
+
name: expect.any(String),
|
|
677
|
+
email: expect.any(String),
|
|
678
|
+
}),
|
|
679
|
+
]),
|
|
680
|
+
total: expect.any(Number),
|
|
681
|
+
});
|
|
682
|
+
});
|
|
683
|
+
});
|
|
228
684
|
```
|
|
229
685
|
|
|
230
|
-
|
|
686
|
+
### ๐ง Testing Configuration
|
|
687
|
+
|
|
688
|
+
```json
|
|
689
|
+
{
|
|
690
|
+
"scripts": {
|
|
691
|
+
"test": "vitest run",
|
|
692
|
+
"test:watch": "vitest",
|
|
693
|
+
"test:coverage": "vitest run --coverage"
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
```
|
|
231
697
|
|
|
232
|
-
###
|
|
698
|
+
### ๐โโ๏ธ Running Tests
|
|
233
699
|
|
|
234
700
|
```bash
|
|
235
|
-
#
|
|
236
|
-
pnpm
|
|
701
|
+
# Run all tests
|
|
702
|
+
pnpm test
|
|
703
|
+
|
|
704
|
+
# Watch mode
|
|
705
|
+
pnpm test:watch
|
|
706
|
+
|
|
707
|
+
# Coverage report
|
|
708
|
+
pnpm test:coverage
|
|
709
|
+
|
|
710
|
+
# Test specific modules
|
|
711
|
+
pnpm test server
|
|
712
|
+
pnpm test router
|
|
713
|
+
pnpm test middleware
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
## ๐ค Contributing
|
|
237
717
|
|
|
238
|
-
|
|
239
|
-
|
|
718
|
+
We welcome contributions to BlaizeJS! Please see our [Contributing Guide](../../CONTRIBUTING.md) for details.
|
|
719
|
+
|
|
720
|
+
### ๐ ๏ธ Development Setup
|
|
721
|
+
|
|
722
|
+
```bash
|
|
723
|
+
# Clone the repository
|
|
724
|
+
git clone https://github.com/jleajones/blaize.git
|
|
725
|
+
cd blaize
|
|
726
|
+
|
|
727
|
+
# Install dependencies (uses pnpm workspaces)
|
|
728
|
+
pnpm install
|
|
240
729
|
|
|
241
730
|
# Run tests
|
|
242
731
|
pnpm test
|
|
243
732
|
|
|
244
|
-
# Start development
|
|
245
|
-
pnpm
|
|
733
|
+
# Start development
|
|
734
|
+
pnpm dev
|
|
735
|
+
|
|
736
|
+
# Build all packages
|
|
737
|
+
pnpm build
|
|
246
738
|
```
|
|
247
739
|
|
|
248
|
-
###
|
|
740
|
+
### ๐๏ธ Monorepo Structure
|
|
249
741
|
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
|
|
742
|
+
```
|
|
743
|
+
blaize/
|
|
744
|
+
โโโ packages/
|
|
745
|
+
โ โโโ blaizejs/ # Core framework (this package)
|
|
746
|
+
โ โโโ client/ # Type-safe client generator
|
|
747
|
+
โ โโโ types/ # Shared TypeScript types
|
|
748
|
+
โ โโโ testing-utils/ # Testing utilities
|
|
749
|
+
โ โโโ configs/ # Shared configurations
|
|
750
|
+
โโโ plugins/ # Official plugins
|
|
751
|
+
โโโ apps/ # Example applications
|
|
752
|
+
โโโ docs/ # Documentation
|
|
753
|
+
```
|
|
253
754
|
|
|
254
|
-
|
|
255
|
-
pnpm run example:middleware
|
|
755
|
+
### ๐ Code Standards
|
|
256
756
|
|
|
257
|
-
|
|
258
|
-
|
|
757
|
+
- โ
**TypeScript**: Strict mode enabled for all packages
|
|
758
|
+
- โ
**Testing**: Comprehensive test coverage with Vitest
|
|
759
|
+
- โ
**Linting**: ESLint with consistent configuration
|
|
760
|
+
- โ
**Formatting**: Prettier for code formatting
|
|
761
|
+
- โ
**Commits**: Conventional commits for clear history
|
|
762
|
+
- โ
**Documentation**: JSDoc comments for public APIs
|
|
259
763
|
|
|
260
|
-
|
|
261
|
-
|
|
764
|
+
### ๐ง Available Scripts
|
|
765
|
+
|
|
766
|
+
```bash
|
|
767
|
+
pnpm build # Build all packages
|
|
768
|
+
pnpm dev # Start development mode
|
|
769
|
+
pnpm lint # Run ESLint across packages
|
|
770
|
+
pnpm format # Format code with Prettier
|
|
771
|
+
pnpm type-check # Run TypeScript checks
|
|
772
|
+
pnpm clean # Clean all build artifacts
|
|
773
|
+
pnpm changeset # Create changeset for versioning
|
|
262
774
|
```
|
|
263
775
|
|
|
264
|
-
|
|
776
|
+
### ๐งช Testing Guidelines
|
|
777
|
+
|
|
778
|
+
When contributing to the core framework:
|
|
265
779
|
|
|
266
|
-
|
|
780
|
+
- โ
Test all HTTP/2 and HTTP/1.1 compatibility
|
|
781
|
+
- โ
Test ESM module resolution and path handling
|
|
782
|
+
- โ
Test AsyncLocalStorage context propagation
|
|
783
|
+
- โ
Test middleware composition and error handling
|
|
784
|
+
- โ
Test plugin lifecycle management
|
|
785
|
+
- โ
Include integration tests with real HTTP requests
|
|
786
|
+
- โ
Test production deployment scenarios
|
|
787
|
+
- โ
Test type safety and schema validation
|
|
267
788
|
|
|
268
|
-
|
|
789
|
+
### ๐ฏ Architecture Guidelines
|
|
269
790
|
|
|
270
|
-
|
|
791
|
+
Key principles for core framework development:
|
|
271
792
|
|
|
272
|
-
-
|
|
273
|
-
-
|
|
274
|
-
-
|
|
275
|
-
-
|
|
276
|
-
-
|
|
277
|
-
-
|
|
793
|
+
- ๐ **Type Safety First** - Everything should be typed and validated
|
|
794
|
+
- โก **Performance** - Minimal overhead and optimal execution
|
|
795
|
+
- ๐งฉ **Modularity** - Clean separation between modules
|
|
796
|
+
- ๐ **Async/Await** - Modern async patterns throughout
|
|
797
|
+
- ๐ก๏ธ **Error Handling** - Comprehensive error management
|
|
798
|
+
- ๐ **Documentation** - Clear examples and API docs
|
|
278
799
|
|
|
279
|
-
|
|
800
|
+
## ๐บ๏ธ Roadmap
|
|
280
801
|
|
|
281
|
-
|
|
282
|
-
- โฌ Type inference system
|
|
283
|
-
- โฌ Client library generation
|
|
284
|
-
- โฌ OpenAPI integration
|
|
285
|
-
- โฌ Performance optimizations
|
|
286
|
-
- โฌ Documentation
|
|
802
|
+
### ๐ Current (v0.1.x)
|
|
287
803
|
|
|
288
|
-
|
|
804
|
+
- โ
**HTTP/2 Server** with HTTP/1.1 fallback and SSL support
|
|
805
|
+
- โ
**File-Based Routing** with automatic path generation and hot reloading
|
|
806
|
+
- โ
**Type-Safe Routes** with Zod schema validation and route creators
|
|
807
|
+
- โ
**Composable Middleware** with onion execution and error handling
|
|
808
|
+
- โ
**Plugin System** with lifecycle management and validation
|
|
809
|
+
- โ
**Context Management** with AsyncLocalStorage and state isolation
|
|
810
|
+
- โ
**Testing Utilities** with comprehensive test helpers
|
|
811
|
+
- โ
**ESM Support** with proper module resolution
|
|
812
|
+
- โ
**Client Generation** with full type safety (separate package)
|
|
289
813
|
|
|
290
|
-
|
|
291
|
-
- โฌ Core plugins (CORS, logging, validation)
|
|
292
|
-
- โฌ Premium plugins (authentication, caching)
|
|
293
|
-
- โฌ Example applications
|
|
294
|
-
- โฌ Deployment guides
|
|
814
|
+
### ๐ฏ Next Release (v0.2.x)
|
|
295
815
|
|
|
296
|
-
|
|
816
|
+
- ๐ **HTTP/2 Hosting Solutions** - Workarounds for hosting provider limitations
|
|
817
|
+
- ๐ **Performance Optimizations** - Radix tree improvements and caching
|
|
818
|
+
- ๐ **Advanced Schema Validation** - Enhanced Zod integration and custom validators
|
|
819
|
+
- ๐ **Built-in Monitoring** - Performance metrics and health checks
|
|
820
|
+
- ๐ **Route Groups** - Organized routing with shared middleware
|
|
821
|
+
- ๐ **Plugin Registry** - Centralized plugin discovery and management
|
|
297
822
|
|
|
298
|
-
|
|
823
|
+
### ๐ฎ Future (v0.3.x+)
|
|
299
824
|
|
|
300
|
-
|
|
825
|
+
- ๐ **GraphQL Integration** - File-based GraphQL resolvers
|
|
826
|
+
- ๐ **WebSocket Support** - Real-time endpoints with type safety
|
|
827
|
+
- ๐ **Server-Side Streaming** - Streaming responses and SSE
|
|
828
|
+
- ๐ **Edge Runtime** - Deployment to edge computing platforms
|
|
829
|
+
- ๐ **Zero-Config Deployment** - One-command deployment to various platforms
|
|
830
|
+
- ๐ **Advanced Caching** - Multi-layer caching strategies
|
|
301
831
|
|
|
302
|
-
|
|
832
|
+
### ๐ Long-term Vision
|
|
833
|
+
|
|
834
|
+
- ๐ **Visual Development** - GUI tools for route and middleware management
|
|
835
|
+
- ๐ **AI-Powered Optimization** - Automatic performance tuning and suggestions
|
|
836
|
+
- ๐ **Multi-Protocol Support** - gRPC, WebSocket, and HTTP/3 in unified framework
|
|
837
|
+
- ๐ **Microservices Platform** - Service mesh integration and distributed systems
|
|
838
|
+
- ๐ **Enterprise Features** - Advanced security, compliance, and governance
|
|
839
|
+
|
|
840
|
+
---
|
|
841
|
+
|
|
842
|
+
## ๐ Related Documentation
|
|
843
|
+
|
|
844
|
+
- ๐ [Server Module](./src/server/README.md) - HTTP server creation and lifecycle management
|
|
845
|
+
- ๐ [Router Module](./src/router/README.md) - File-based routing and type-safe handlers
|
|
846
|
+
- ๐ [Context Module](./src/context/README.md) - Request/response context and state management
|
|
847
|
+
- ๐ [Middleware Module](./src/middleware/README.md) - Composable middleware system
|
|
848
|
+
- ๐งฉ [Plugins Module](./src/plugins/README.md) - Plugin architecture and lifecycle
|
|
849
|
+
- ๐ [Client Package](./src/client/README.md) - Type-safe API client generation
|
|
850
|
+
- ๐งช [Testing Utils](./src/testing-utils/README.md) - Testing utilities and helpers
|
|
303
851
|
|
|
304
852
|
---
|
|
305
853
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
854
|
+
**Built with โค๏ธ by the BlaizeJS team**
|
|
855
|
+
|
|
856
|
+
For questions, feature requests, or bug reports, please [open an issue](https://github.com/jleajones/blaize/issues) on GitHub.
|