11# NestJS MinIO Backend
22
3+ [ ![ NPM Version] [ npm-image ]] [ npm-url ]
4+ [ ![ Downloads Stats] [ npm-downloads ]] [ npm-url ]
5+ [ ![ License] [ license-image ]] [ license-url ]
6+ [ ![ TypeScript] [ typescript-image ]] [ typescript-url ]
7+ [ ![ NestJS] [ nestjs-image ]] [ nestjs-url ]
8+ [ ![ MinIO] [ minio-image ]] [ minio-url ]
9+
310A powerful and flexible NestJS module for integrating MinIO object storage into your NestJS applications. This package provides a seamless way to interact with MinIO, an open-source object storage service compatible with Amazon S3.
411
12+ ## Table of Contents
13+ - [ Features] ( #features )
14+ - [ Installation] ( #installation )
15+ - [ Requirements] ( #requirements )
16+ - [ Quick Start] ( #quick-start-using-decorators )
17+ - [ Configuration] ( #configuration )
18+ - [ API Reference] ( #api-reference )
19+ - [ Contributing] ( #contributing )
20+ - [ License] ( #license )
21+ - [ Support] ( #support )
22+
523## Features
624
725- 🚀 Easy integration with NestJS applications
@@ -320,19 +338,52 @@ async downloadFile(@Param('objectName') objectName: string, @Res() res: Response
320338
321339## API Reference
322340
323- ### MinioService Methods
341+ ### Decorators
342+
343+ #### @FileUpload ()
344+ Handles file uploads with automatic MinIO integration.
345+
346+ ``` typescript
347+ @FileUpload ([
348+ {
349+ name: string , // Field name in the request
350+ bucketName: string , // MinIO bucket name
351+ required?: boolean , // Whether the file is required
352+ maxCount?: number , // Maximum number of files
353+ maxSize?: number , // Maximum file size in bytes
354+ mimeTypes?: string [] // Allowed MIME types
355+ }
356+ ])
357+ ```
324358
325- - ` upload(bucketName: string, objectName: string, file: Buffer): Promise<void> `
326- - ` download(bucketName: string, objectName: string): Promise<Buffer> `
327- - ` delete(bucketName: string, objectName: string): Promise<void> `
328- - ` getSignedUrl(bucketName: string, objectName: string, expiryInSeconds: number): Promise<string> `
329- - And more...
359+ #### @FileField ()
360+ Swagger-ready DTO field decorator for file uploads.
330361
331- For detailed API documentation, please refer to the source code and included TypeScript definitions.
362+ ``` typescript
363+ @FileField ({
364+ bucketName: string , // MinIO bucket name
365+ required?: boolean , // Whether the field is required
366+ description?: string // Swagger description
367+ })
368+ ```
369+
370+ #### @FileSchemaField ()
371+ Mongoose schema integration for file fields.
372+
373+ ``` typescript
374+ @FileSchemaField ({
375+ bucketName: string , // MinIO bucket name
376+ required?: boolean // Whether the field is required
377+ })
378+ ```
332379
333380## Contributing
334381
335- Contributions are welcome! Please feel free to submit a Pull Request.
382+ 1 . Fork it ([ https://github.com/UtilKit/nestjs-minio-backend/fork ] ( https://github.com/UtilKit/nestjs-minio-backend/fork ) )
383+ 2 . Create your feature branch (` git checkout -b feature/amazing-feature ` )
384+ 3 . Commit your changes (` git commit -am 'Add some amazing feature' ` )
385+ 4 . Push to the branch (` git push origin feature/amazing-feature ` )
386+ 5 . Create a new Pull Request
336387
337388## License
338389
@@ -344,4 +395,18 @@ Mishhub
344395
345396## Support
346397
347- If you encounter any issues or have questions, please file an issue on the GitHub repository.
398+ - 📫 [ GitHub Issues] ( https://github.com/UtilKit/nestjs-minio-backend/issues )
399+ - 💬 [ Discord Community] ( https://discord.gg/your-community )
400+ - 📧 Email: support@example.com
401+
402+ [ npm-image ] : https://img.shields.io/npm/v/nestjs-minio-backend.svg?style=flat-square
403+ [ npm-url ] : https://npmjs.org/package/nestjs-minio-backend
404+ [ npm-downloads ] : https://img.shields.io/npm/dm/nestjs-minio-backend.svg?style=flat-square
405+ [ license-image ] : https://img.shields.io/npm/l/nestjs-minio-backend.svg?style=flat-square
406+ [ license-url ] : LICENSE
407+ [ typescript-image ] : https://img.shields.io/badge/TypeScript-Ready-blue.svg?style=flat-square
408+ [ typescript-url ] : https://www.typescriptlang.org/
409+ [ nestjs-image ] : https://img.shields.io/badge/NestJS-Compatible-red.svg?style=flat-square
410+ [ nestjs-url ] : https://nestjs.com/
411+ [ minio-image ] : https://img.shields.io/badge/MinIO-Compatible-green.svg?style=flat-square
412+ [ minio-url] : https://min.io/
0 commit comments