Skip to content

Commit f399c4b

Browse files
committed
Refactor Added workflow
1 parent 5864756 commit f399c4b

File tree

6 files changed

+228
-10
lines changed

6 files changed

+228
-10
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Code example**
24+
```typescript
25+
// Your code here
26+
```
27+
28+
**Environment:**
29+
- Node.js version: [e.g. 20.15.0]
30+
- NestJS version: [e.g. 11.0.0]
31+
- MinIO version: [e.g. 8.0.5]
32+
- Package version: [e.g. 1.0.11]
33+
34+
**Additional context**
35+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [20.x]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Run linting
30+
run: npm run lint
31+
32+
- name: Run tests
33+
run: npm run test
34+
35+
- name: Build
36+
run: npm run build

CODE_OF_CONDUCT.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to a positive environment:
15+
16+
* Demonstrating empathy and kindness toward other people
17+
* Being respectful of differing opinions, viewpoints, and experiences
18+
* Giving and gracefully accepting constructive feedback
19+
* Accepting responsibility and apologizing to those affected by our mistakes
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior:
24+
25+
* The use of sexualized language or imagery, and sexual attention or advances
26+
* Trolling, insulting or derogatory comments, and personal or political attacks
27+
* Public or private harassment
28+
* Publishing others' private information without explicit permission
29+
* Other conduct which could reasonably be considered inappropriate
30+
31+
## Enforcement
32+
33+
Violations of the Code of Conduct may be reported to the project team at
34+
[INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.
35+
36+
## Attribution
37+
38+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
39+
version 2.0, available at
40+
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
41+
42+
[homepage]: https://www.contributor-covenant.org
43+
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html

README.md

Lines changed: 74 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
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+
310
A 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/

package.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@
1414
"homepage": "https://github.com/UtilKit/nestjs-minio-backend#readme",
1515
"main": "dist/index.js",
1616
"types": "dist/index.d.ts",
17+
"sideEffects": false,
18+
"exports": {
19+
".": {
20+
"types": "./dist/index.d.ts",
21+
"import": "./dist/index.js",
22+
"require": "./dist/index.js"
23+
}
24+
},
25+
"publishConfig": {
26+
"access": "public"
27+
},
1728
"files": [
1829
"dist",
1930
"README.md",
@@ -24,7 +35,15 @@
2435
"minio",
2536
"s3",
2637
"object-storage",
27-
"backend"
38+
"backend",
39+
"file-upload",
40+
"storage",
41+
"cloud-storage",
42+
"file-management",
43+
"typescript",
44+
"decorators",
45+
"swagger",
46+
"mongoose"
2847
],
2948
"engines": {
3049
"node": ">=20.15.0"

0 commit comments

Comments
 (0)