@bts-soft/core 1.0.4 → 1.2.5
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 +28 -93
- package/package.json +4 -2
- package/src/index.ts +4 -3
package/README.md
CHANGED
|
@@ -1,116 +1,51 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
2
|
+
# @bts-soft/core
|
|
3
3
|
|
|
4
|
-
The
|
|
5
|
-
|
|
6
|
-
This package simplifies development by bundling essential backend components (like email queuing, security guards, and utilities) into one dependency, ensuring a consistent and robust NestJS architecture out-of-the-box.
|
|
4
|
+
The **Core Package** is the main entry point of the **BTS Soft ecosystem**.
|
|
5
|
+
It bundles and re-exports all common utilities and modules used across different BTS packages, allowing developers to integrate them easily into any NestJS project.
|
|
7
6
|
|
|
8
7
|
---
|
|
9
8
|
|
|
10
|
-
##
|
|
11
|
-
|
|
12
|
-
By installing `@bts-soft/core`, you automatically gain access to all the following specialized modules and services:
|
|
13
|
-
|
|
14
|
-
| Module | NPM Package (Internal) | Description |
|
|
15
|
-
| --------------- | ---------------------- | ---------------------------------------------------------------------------------------------- |
|
|
16
|
-
| **Email Queue** | `@bts-soft/mail-queue` | Reliable, asynchronous email sending using BullMQ and Nodemailer, preventing request blocking. |
|
|
9
|
+
## Features
|
|
17
10
|
|
|
11
|
+
- Centralized import for all BTS Soft modules
|
|
12
|
+
- Simplifies project setup and maintenance
|
|
13
|
+
- Works seamlessly with both REST and GraphQL environments
|
|
18
14
|
|
|
19
15
|
---
|
|
20
16
|
|
|
21
|
-
##
|
|
22
|
-
|
|
23
|
-
### 1. Installation
|
|
24
|
-
|
|
25
|
-
Install the core package and its required peer dependencies (BullMQ, Nodemailer, etc. are installed automatically as dependencies of `@bts-soft/mail-queue`):
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
npm install @bts-soft/core
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### 2. Configuration (Environment Variables)
|
|
17
|
+
## Included Packages
|
|
33
18
|
|
|
34
|
-
|
|
19
|
+
- [@bts-soft/validation]([@bts-soft/validation - npm](https://www.npmjs.com/package/@bts-soft/validation)) — Input validation utilities & decorators
|
|
20
|
+
- [@bts-soft/upload]([@bts-soft/mail-queue - npm](https://www.npmjs.com/package/@bts-soft/upload)) — File upload middleware (GraphQL & REST)
|
|
21
|
+
- [@bts-soft/mail-queue]([@bts-soft/mail-queue - npm](https://www.npmjs.com/package/@bts-soft/mail-queue)) — Email queue handling with BullMQ
|
|
22
|
+
- [@bts-soft/config]([@bts-soft/mail-queue - npm](https://www.npmjs.com/package/@bts-soft/config)) — Environment & configuration management
|
|
35
23
|
|
|
36
|
-
|
|
37
|
-
|---|---|
|
|
38
|
-
|`REDIS_HOST`, `REDIS_PORT`|Required for BullMQ queue management.|
|
|
39
|
-
|`MAIL_HOST`, `MAIL_USER`, `MAIL_PASS`|Required for Nodemailer SMTP connection.|
|
|
40
|
-
|
|
41
|
-
### 3. Usage in `AppModule`
|
|
42
|
-
|
|
43
|
-
All modules are designed to be imported directly from the `@bts-soft/core` package.
|
|
24
|
+
---
|
|
44
25
|
|
|
26
|
+
## Usage Example
|
|
45
27
|
|
|
46
|
-
```
|
|
47
|
-
// app.module.ts
|
|
28
|
+
```ts
|
|
48
29
|
import { Module } from '@nestjs/common';
|
|
49
|
-
|
|
50
|
-
import { EmailModule } from '@bts-soft/core';
|
|
30
|
+
import { CoreModule } from '@bts-soft/core';
|
|
51
31
|
|
|
52
32
|
@Module({
|
|
53
|
-
|
|
54
|
-
// Example: Registering the Email Module
|
|
55
|
-
EmailModule.register({
|
|
56
|
-
// Optional: Custom connection settings can be passed here
|
|
57
|
-
}),
|
|
58
|
-
// ... Other application modules
|
|
59
|
-
],
|
|
60
|
-
// ...
|
|
33
|
+
imports: [CoreModule],
|
|
61
34
|
})
|
|
62
35
|
export class AppModule {}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
### 4. Injecting Services
|
|
36
|
+
````
|
|
66
37
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
TypeScript
|
|
38
|
+
---
|
|
70
39
|
|
|
71
|
-
|
|
72
|
-
// my.service.ts
|
|
73
|
-
import { Injectable } from '@nestjs/common';
|
|
74
|
-
import { SendEmailService } from '@bts-soft/core'; // Imported from @bts-soft/core
|
|
40
|
+
## Learn More
|
|
75
41
|
|
|
76
|
-
|
|
77
|
-
export class MyService {
|
|
78
|
-
constructor(private readonly emailService: SendEmailService) {}
|
|
42
|
+
Visit each module’s documentation for details and advanced usage examples:
|
|
79
43
|
|
|
80
|
-
|
|
81
|
-
// Logic...
|
|
44
|
+
- [Validation Documentation]([@bts-soft/validation - npm](https://www.npmjs.com/package/@bts-soft/validation))
|
|
82
45
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
## Contact
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
**Author:** Omar Sabry
|
|
101
|
-
|
|
102
|
-
**Email:** omar.sabry.dev@gmail.com
|
|
103
|
-
|
|
104
|
-
**LinkedIn:** [(1) Omar Sabry | LinkedIn](https://www.linkedin.com/in/omarsa6ry/)
|
|
105
|
-
|
|
106
|
-
Portfolio: https://omarsabry.netlify.app/
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
## Repository
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
**GitHub:** [bts-soft/packages/core at main · Omar-Sa6ry/bts-soft](https://github.com/Omar-Sa6ry/bts-soft/tree/main/packages/core)
|
|
46
|
+
- [Upload Documentation]([@bts-soft/validation - npm](https://www.npmjs.com/package/@bts-soft/upload))
|
|
47
|
+
|
|
48
|
+
- [Mail Queue Documentation]([@bts-soft/mail-queue - npm](https://www.npmjs.com/package/@bts-soft/mail-queue))
|
|
49
|
+
|
|
50
|
+
- [Config Documentation]([@bts-soft/mail-queue - npm](https://www.npmjs.com/package/@bts-soft/mail-queue))
|
|
51
|
+
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bts-soft/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"author": "Omar Sabry",
|
|
5
5
|
"description": "All bts-soft packages",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@bts-soft/mail-queue": "^1.0.5"
|
|
10
|
+
"@bts-soft/mail-queue": "^1.0.5",
|
|
11
|
+
"@bts-soft/upload": "^1.1.1",
|
|
12
|
+
"@bts-soft/validation":"^1.0.0"
|
|
11
13
|
},
|
|
12
14
|
"peerDependencies": {
|
|
13
15
|
"@nestjs/common": "^10.0.0",
|
package/src/index.ts
CHANGED