bootifyjs 0.0.1 โ†’ 0.0.3

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/README.md ADDED
@@ -0,0 +1,567 @@
1
+ # ๐Ÿš€ BootifyJs
2
+
3
+ A production-ready, Spring Boot-inspired TypeScript framework built on top of Fastify and express, designed for building scalable enterprise applications with modern development practices.
4
+
5
+ ## ๐ŸŽฏ Why This Framework?
6
+
7
+ ### The Problem
8
+ Building enterprise-grade Node.js applications often involves:
9
+ - โšก Repetitive boilerplate code for common patterns
10
+ - ๐Ÿ”ง Manual setup of logging, caching, validation, and error handling
11
+ - ๐Ÿ“ฆ Inconsistent project structure across teams
12
+ - ๐Ÿ—๏ธ Lack of standardized dependency injection
13
+ - ๐Ÿ”„ Manual configuration of database connections and migrations
14
+ - ๐Ÿ“Š Missing observability and monitoring out-of-the-box
15
+
16
+ ### The Solution
17
+ Our framework provides:
18
+ - ๐ŸŽจ **Spring Boot-style decorators** (`@Controller`, `@Service`, `@Repository`)
19
+ - ๐Ÿ—๏ธ **Dependency Injection** with Inversify
20
+ - ๐Ÿš€ **High-performance** Fastify web server
21
+ - ๐Ÿ“Š **Built-in observability** (logging, metrics, tracing)
22
+ - ๐Ÿ’พ **Integrated caching** with Redis
23
+ - ๐Ÿ—„๏ธ **Database abstraction** with Sequelize ORM
24
+ - ๐Ÿ”ง **Zero-config setup** for common enterprise patterns
25
+ - ๐Ÿ“ฆ **Monorepo structure** for scalable team development
26
+
27
+ ## ๐Ÿ—๏ธ Architecture Overview
28
+
29
+ ```
30
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
31
+ โ”‚ Application Layer โ”‚
32
+ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
33
+ โ”‚ โ”‚ CMS APIs โ”‚ โ”‚ Consumer APIs โ”‚ โ”‚ Admin APIs โ”‚ โ”‚
34
+ โ”‚ โ”‚ @Controller โ”‚ โ”‚ @Controller โ”‚ โ”‚ @Controller โ”‚ โ”‚
35
+ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
36
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
37
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
38
+ โ”‚ Service Layer โ”‚
39
+ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
40
+ โ”‚ โ”‚ UserService โ”‚ โ”‚ OrderService โ”‚ โ”‚ EmailService โ”‚ โ”‚
41
+ โ”‚ โ”‚ @Service โ”‚ โ”‚ @Service โ”‚ โ”‚ @Service โ”‚ โ”‚
42
+ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
43
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
44
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
45
+ โ”‚ Repository Layer โ”‚
46
+ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
47
+ โ”‚ โ”‚ UserRepository โ”‚ โ”‚ OrderRepository โ”‚ โ”‚EmailTemplate โ”‚ โ”‚
48
+ โ”‚ โ”‚ @Repository โ”‚ โ”‚ @Repository โ”‚ โ”‚ @Repository โ”‚ โ”‚
49
+ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
50
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
51
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
52
+ โ”‚ Core Framework โ”‚
53
+ โ”‚ Fastify + Decorators + DI + Caching + Logging โ”‚
54
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
55
+ ```
56
+
57
+ ## ๐Ÿ“ฆ Package Structure
58
+
59
+ ### `core` - Framework Foundation
60
+ - ๐ŸŽฏ **Application bootstrapping** with configurable features
61
+ - ๐Ÿ—๏ธ **Dependency injection** container with decorators
62
+ - ๐ŸŒ **HTTP decorators** (`@Get`, `@Post`, `@Put`, `@Delete`)
63
+ - โšก **Performance decorators** (`@Timed`, `@Cache`)
64
+ - ๐Ÿ“Š **Structured logging** (Application, Audit, Event logs)
65
+ - ๐Ÿ”„ **Transaction management** with `@Transactional`
66
+
67
+ ### `commons` - Shared Components
68
+ - ๐Ÿ—„๏ธ **Database clients** (Sequelize, Redis)
69
+ - ๐Ÿ“‹ **Base repository** with caching and pagination
70
+ - ๐Ÿ”ง **Database migrations** and seeders
71
+ - ๐Ÿท๏ธ **Shared models** and interfaces
72
+
73
+ ### `@monorepo/cms-apis` - Example Application
74
+ - ๐ŸŽฎ **Controllers** using framework decorators
75
+ - ๐Ÿ’ผ **Business logic** with service layer
76
+ - ๐Ÿ“Š **Complete CRUD** operations with caching
77
+
78
+ ## ๐Ÿš€ Quick Start
79
+
80
+ ### Prerequisites
81
+ - Node.js 18+
82
+ - PostgreSQL 12+
83
+ - Redis 6+ (optional, for caching)
84
+
85
+ ### Installation
86
+
87
+ ```bash
88
+ # Clone the repository
89
+ git clone <repository-url>
90
+ cd typescript-fastify-framework
91
+
92
+ # Install dependencies for all packages
93
+ npm install
94
+
95
+ # Build all packages
96
+ npm run build
97
+ ```
98
+
99
+ ### Environment Setup
100
+
101
+ ```bash
102
+ # Copy environment template
103
+ cp packages/cms-apis/.env.example packages/cms-apis/.env
104
+
105
+ # Edit with your configuration
106
+ nano packages/cms-apis/.env
107
+ ```
108
+
109
+ ### Database Setup
110
+
111
+ ```bash
112
+ # Navigate to commons package
113
+ cd packages/commons
114
+
115
+ # Create database
116
+ npm run db:create
117
+
118
+ # Run migrations
119
+ npm run db:migrate
120
+
121
+ # Seed with sample data (optional)
122
+ npm run db:seed
123
+ ```
124
+
125
+ ### Start Development Server
126
+
127
+ ```bash
128
+ # From root directory
129
+ npm run dev
130
+ ```
131
+
132
+ ๐ŸŽ‰ **Your API is now running at `http://localhost:3000`**
133
+
134
+ ## ๐Ÿ“š Core Concepts
135
+
136
+ ### 1. Controllers - HTTP Entry Points
137
+
138
+ ```typescript
139
+ import { Controller, Get, Post, Put, Delete } from '@monorepo/core';
140
+ import { inject } from 'inversify';
141
+
142
+ @Controller('/api/users')
143
+ export class UserController {
144
+ constructor(
145
+ @inject(UserService) private userService: UserService
146
+ ) {}
147
+
148
+ @Get('/')
149
+ async getAllUsers() {
150
+ return this.userService.findAllUsers();
151
+ }
152
+
153
+ @Post('/', {
154
+ schema: {
155
+ body: {
156
+ type: 'object',
157
+ required: ['email', 'firstName', 'lastName'],
158
+ properties: {
159
+ email: { type: 'string', format: 'email' },
160
+ firstName: { type: 'string', minLength: 1 },
161
+ lastName: { type: 'string', minLength: 1 }
162
+ }
163
+ }
164
+ }
165
+ })
166
+ async createUser(request: FastifyRequest<CreateUserRequest>) {
167
+ return this.userService.createUser(request.body);
168
+ }
169
+ }
170
+ ```
171
+
172
+ ### 2. Services - Business Logic Layer
173
+
174
+ ```typescript
175
+ import { Service, Timed, Logger } from '@monorepo/core';
176
+ import { inject } from 'inversify';
177
+
178
+ @Service('singleton')
179
+ export class UserService {
180
+ constructor(
181
+ @inject(UserRepository) private userRepository: UserRepository
182
+ ) {}
183
+
184
+ @Timed() // Automatically logs execution time
185
+ async createUser(userData: CreateUserData): Promise<User> {
186
+ Logger.info(`Creating user: ${userData.email}`);
187
+
188
+ // Business logic here
189
+ const user = await this.userRepository.create(userData);
190
+
191
+ // Audit logging
192
+ AuditLogger.info({
193
+ userId: 'system',
194
+ action: 'CREATE_USER',
195
+ resources: ['users'],
196
+ data: { userId: user.id, email: user.email }
197
+ });
198
+
199
+ return user;
200
+ }
201
+ }
202
+ ```
203
+
204
+ ### 3. Repositories - Data Access Layer
205
+
206
+ ```typescript
207
+ import { Repository, AppRepository } from '@monorepo/core';
208
+
209
+ @Repository('singleton')
210
+ export class UserRepository extends AppRepository<User> {
211
+ constructor() {
212
+ super(User, {
213
+ cacheTTL: 3600, // 1 hour cache
214
+ defaultFields: ['id', 'email', 'firstName', 'lastName', 'isActive']
215
+ });
216
+ }
217
+
218
+ // Custom methods with automatic caching
219
+ async findByEmail(email: string): Promise<User | null> {
220
+ return this.findOne({ where: { email } });
221
+ }
222
+
223
+ async findActiveUsers(): Promise<User[]> {
224
+ return this.findAll({ where: { isActive: true } });
225
+ }
226
+ }
227
+ ```
228
+
229
+ ### 4. Application Bootstrap
230
+
231
+ ```typescript
232
+ import { Application, Logger } from '@monorepo/core';
233
+
234
+ const app = new Application({
235
+ port: 3000,
236
+ enableCors: true,
237
+ enableSwagger: true,
238
+ enableMetrics: true,
239
+ corsOptions: {
240
+ origin: ['http://localhost:3000', 'https://yourdomain.com'],
241
+ credentials: true
242
+ }
243
+ });
244
+
245
+ // Register controllers
246
+ app.registerControllers([
247
+ UserController,
248
+ OrderController,
249
+ HealthController
250
+ ]);
251
+
252
+ await app.start();
253
+ ```
254
+
255
+ ## ๐Ÿ”ง Configuration Options
256
+
257
+ ### Application Configuration
258
+
259
+ ```typescript
260
+ interface FastifyServerConfig {
261
+ port?: number; // Server port (default: 3000)
262
+ host?: string; // Server host (default: '0.0.0.0')
263
+ enableCors?: boolean; // Enable CORS (default: true)
264
+ enableSwagger?: boolean; // Enable API docs (default: false)
265
+ enableLogging?: boolean; // Enable request logging (default: true)
266
+ enableErrorHandling?: boolean; // Global error handler (default: true)
267
+ enableMetrics?: boolean; // Prometheus metrics (default: false)
268
+ enableCookie?: boolean; // Cookie support (default: false)
269
+ enableAuth?: boolean; // Authentication middleware (default: false)
270
+ corsOptions?: CorsOptions; // CORS configuration
271
+ swaggerOptions?: SwaggerOptions; // Swagger configuration
272
+ }
273
+ ```
274
+
275
+ ### Environment Variables
276
+
277
+ ```bash
278
+ # Database Configuration
279
+ DB_NAME=your_database
280
+ DB_USER=postgres
281
+ DB_PASS=password
282
+ DB_HOST=localhost
283
+ DB_PORT=5432
284
+ DB_DIALECT=postgres
285
+
286
+ # Redis Configuration (optional)
287
+ REDIS_HOST=localhost
288
+ REDIS_PORT=6379
289
+ REDIS_PASSWORD=
290
+
291
+ # Application Configuration
292
+ APP_PORT=3000
293
+ NODE_ENV=development
294
+ LOG_LEVEL=info
295
+ ```
296
+
297
+ ## ๐Ÿ“Š Built-in Features
298
+
299
+ ### Automatic API Documentation
300
+ Visit `http://localhost:3000/docs` when `enableSwagger: true`
301
+
302
+ ### Health Checks
303
+ - `GET /health` - Application health
304
+ - `GET /health/ready` - Readiness probe
305
+
306
+ ### Metrics & Monitoring
307
+ - `GET /metrics` - Prometheus metrics (when enabled)
308
+ - Automatic request timing and counting
309
+ - Error rate monitoring
310
+
311
+ ### Structured Logging
312
+ ```typescript
313
+ // Application logs
314
+ Logger.info('User created successfully');
315
+
316
+ // Audit logs
317
+ AuditLogger.info({
318
+ userId: 'user123',
319
+ action: 'CREATE_ORDER',
320
+ resources: ['orders'],
321
+ data: { orderId: 'order456' }
322
+ });
323
+
324
+ // Event logs
325
+ EventLogger.info({
326
+ eventName: 'USER_SIGNUP',
327
+ status: 'SUCCESS',
328
+ metadata: { source: 'web', campaign: 'summer2024' }
329
+ });
330
+ ```
331
+
332
+ ## ๐ŸŽฏ Available APIs (CMS Example)
333
+
334
+ ### User Management
335
+ ```bash
336
+ # Get all users
337
+ GET /api/users
338
+
339
+ # Get user by ID
340
+ GET /api/users/:id
341
+
342
+ # Get user by email
343
+ GET /api/users/email/:email
344
+
345
+ # Create user
346
+ POST /api/users
347
+ {
348
+ "email": "john@example.com",
349
+ "firstName": "John",
350
+ "lastName": "Doe"
351
+ }
352
+
353
+ # Update user
354
+ PUT /api/users/:id
355
+ {
356
+ "firstName": "Jane"
357
+ }
358
+
359
+ # Delete user (soft delete)
360
+ DELETE /api/users/:id
361
+
362
+ # Get user statistics
363
+ GET /api/users/stats
364
+
365
+ # Paginated users
366
+ GET /api/users/paginate?page=1&limit=10
367
+ ```
368
+
369
+ ### System Health
370
+ ```bash
371
+ # Health check
372
+ GET /health
373
+
374
+ # Readiness check
375
+ GET /health/ready
376
+
377
+ # Metrics (if enabled)
378
+ GET /metrics
379
+ ```
380
+
381
+ ## ๐Ÿ”„ Development Workflow
382
+
383
+ ### Adding a New Feature
384
+
385
+ 1. **Create Model** (if needed)
386
+ ```typescript
387
+ // packages/commons/src/models/Product.ts
388
+ export class Product extends Model {
389
+ public id!: number;
390
+ public name!: string;
391
+ public price!: number;
392
+ }
393
+ ```
394
+
395
+ 2. **Create Repository**
396
+ ```typescript
397
+ // packages/commons/src/repositories/ProductRepository.ts
398
+ @Repository('singleton')
399
+ export class ProductRepository extends AppRepository<Product> {
400
+ constructor() {
401
+ super(Product, { cacheTTL: 1800 });
402
+ }
403
+ }
404
+ ```
405
+
406
+ 3. **Create Service**
407
+ ```typescript
408
+ // packages/commons/src/services/ProductService.ts
409
+ @Service('singleton')
410
+ export class ProductService {
411
+ constructor(
412
+ @inject(ProductRepository) private productRepo: ProductRepository
413
+ ) {}
414
+
415
+ @Timed()
416
+ async createProduct(data: CreateProductData): Promise<Product> {
417
+ return this.productRepo.create(data);
418
+ }
419
+ }
420
+ ```
421
+
422
+ 4. **Create Controller**
423
+ ```typescript
424
+ // packages/cms-apis/src/controllers/ProductController.ts
425
+ @Controller('/api/products')
426
+ export class ProductController {
427
+ constructor(
428
+ @inject(ProductService) private productService: ProductService
429
+ ) {}
430
+
431
+ @Post('/')
432
+ async createProduct(request: FastifyRequest) {
433
+ return this.productService.createProduct(request.body);
434
+ }
435
+ }
436
+ ```
437
+
438
+ 5. **Register Controller**
439
+ ```typescript
440
+ // packages/cms-apis/src/index.ts
441
+ app.registerControllers([
442
+ UserController,
443
+ ProductController, // Add new controller
444
+ HealthController
445
+ ]);
446
+ ```
447
+
448
+ ## ๐Ÿงช Testing
449
+
450
+ ```bash
451
+ # Run all tests
452
+ npm run test
453
+
454
+ # Run tests for specific package
455
+ npm run test --workspace=packages/core
456
+
457
+ # Run tests in watch mode
458
+ npm run test:watch
459
+ ```
460
+
461
+ ## ๐Ÿ“ฆ Building & Deployment
462
+
463
+ ### Development
464
+ ```bash
465
+ npm run dev
466
+ ```
467
+
468
+ ### Production Build
469
+ ```bash
470
+ npm run build
471
+ npm run start
472
+ ```
473
+
474
+ ### Docker Deployment
475
+ ```dockerfile
476
+ FROM node:18-alpine
477
+ WORKDIR /app
478
+ COPY package*.json ./
479
+ RUN npm ci --only=production
480
+ COPY dist/ ./dist/
481
+ EXPOSE 3000
482
+ CMD ["npm", "start"]
483
+ ```
484
+
485
+ ## ๐Ÿ”ง Advanced Usage
486
+
487
+ ### Custom Decorators
488
+ ```typescript
489
+ // Create custom validation decorator
490
+ export function ValidateUser(): MethodDecorator {
491
+ return (target, propertyKey, descriptor) => {
492
+ // Custom validation logic
493
+ };
494
+ }
495
+
496
+ // Usage
497
+ @Controller('/api/users')
498
+ export class UserController {
499
+ @Post('/')
500
+ @ValidateUser()
501
+ async createUser(request: FastifyRequest) {
502
+ // Method implementation
503
+ }
504
+ }
505
+ ```
506
+
507
+ ### Custom Middleware
508
+ ```typescript
509
+ const app = new Application({
510
+ // ... other config
511
+ });
512
+
513
+ // Add custom middleware
514
+ app.getServer().addHook('preHandler', async (request, reply) => {
515
+ // Custom logic before request handling
516
+ });
517
+ ```
518
+
519
+ ### Database Transactions
520
+ ```typescript
521
+ @Service('singleton')
522
+ export class OrderService {
523
+ @Transactional()
524
+ async createOrderWithItems(orderData: CreateOrderData, transaction?: Transaction) {
525
+ // All database operations will use the same transaction
526
+ const order = await this.orderRepo.create(orderData, { transaction });
527
+ const items = await this.orderItemRepo.bulkCreate(orderData.items, { transaction });
528
+
529
+ // Transaction automatically committed on success
530
+ // or rolled back on error
531
+ return { order, items };
532
+ }
533
+ }
534
+ ```
535
+
536
+ ## ๐Ÿค Contributing
537
+
538
+ 1. Fork the repository
539
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
540
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
541
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
542
+ 5. Open a Pull Request
543
+
544
+ ## ๐Ÿ“„ License
545
+
546
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
547
+
548
+ ## ๐Ÿ†˜ Support
549
+
550
+ - ๐Ÿ“– **Documentation**: [Link to full docs]
551
+ - ๐Ÿ’ฌ **Discord**: [Community chat]
552
+ - ๐Ÿ› **Issues**: [GitHub Issues]
553
+ - ๐Ÿ“ง **Email**: support@yourframework.com
554
+
555
+ ## ๐Ÿ—บ๏ธ Roadmap
556
+
557
+ - [ ] GraphQL support
558
+ - [ ] WebSocket integration
559
+ - [ ] Message queue integration (RabbitMQ, Kafka)
560
+ - [ ] Microservices communication patterns
561
+ - [ ] Advanced caching strategies
562
+ - [ ] Performance optimization tools
563
+ - [ ] CLI for scaffolding
564
+
565
+ ---
566
+
567
+ **Built with โค๏ธ for the Node.js community**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bootifyjs",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "Spring Boot inspired framework fro Node.js built on top of fastify and express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",