@bts-soft/core 1.0.1 → 1.0.2

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.
Files changed (2) hide show
  1. package/README.md +112 -14
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,91 +1,189 @@
1
1
  ## @bts-soft/core | The BTS Software Core Toolkit
2
2
 
3
+
4
+
3
5
  The **`@bts-soft/core`** package serves as the unified entry point for all high-quality, pre-configured modules developed by BTS Software.
4
6
 
7
+
8
+
5
9
  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.
6
10
 
11
+
12
+
7
13
  ---
8
14
 
15
+
16
+
9
17
  ## Features and Included Modules
10
18
 
19
+
20
+
11
21
  By installing `@bts-soft/core`, you automatically gain access to all the following specialized modules and services:
12
22
 
13
- | Module | NPM Package (Internal) | Description |
23
+
24
+
25
+ | Module          | NPM Package (Internal) | Description                                                                                    |
26
+
14
27
  | --------------- | ---------------------- | ---------------------------------------------------------------------------------------------- |
28
+
15
29
  | **Email Queue** | `@bts-soft/mail-queue` | Reliable, asynchronous email sending using BullMQ and Nodemailer, preventing request blocking. |
16
30
 
31
+
32
+
17
33
 
18
34
  ---
19
35
 
36
+
37
+
20
38
  ## Getting Started
21
39
 
40
+
41
+
22
42
  ### 1. Installation
23
43
 
44
+
45
+
24
46
  Install the core package and its required peer dependencies (BullMQ, Nodemailer, etc. are installed automatically as dependencies of `@bts-soft/mail-queue`):
25
47
 
48
+
49
+
26
50
 
27
51
  ```
52
+
28
53
  npm install @bts-soft/core
54
+
29
55
  ```
30
56
 
57
+
58
+
31
59
  ### 2. Configuration (Environment Variables)
32
60
 
61
+
62
+
33
63
  Your application must define the following environment variables (required primarily by the `mail-queue` module):
34
64
 
65
+
66
+
35
67
  |Variable|Usage|
68
+
36
69
  |---|---|
70
+
37
71
  |`REDIS_HOST`, `REDIS_PORT`|Required for BullMQ queue management.|
72
+
38
73
  |`MAIL_HOST`, `MAIL_USER`, `MAIL_PASS`|Required for Nodemailer SMTP connection.|
39
74
 
75
+
76
+
40
77
  ### 3. Usage in `AppModule`
41
78
 
79
+
80
+
42
81
  All modules are designed to be imported directly from the `@bts-soft/core` package.
43
82
 
83
+
84
+
44
85
 
45
86
  ```
87
+
46
88
  // app.module.ts
89
+
47
90
  import { Module } from '@nestjs/common';
91
+
48
92
  // Import all modules and services from the unified Core package
49
- import { EmailModule } from '@bts-soft/core';
93
+
94
+ import { EmailModule } from '@bts-soft/core';
95
+
96
+
50
97
 
51
98
  @Module({
99
+
52
100
    imports: [
101
+
53
102
      // Example: Registering the Email Module
103
+
54
104
      EmailModule.register({ 
105
+
55
106
        // Optional: Custom connection settings can be passed here
107
+
56
108
      }),
109
+
57
110
      // ... Other application modules
111
+
58
112
    ],
113
+
59
114
    // ...
115
+
60
116
  })
117
+
61
118
  export class AppModule {}
119
+
62
120
  ```
63
121
 
122
+
123
+
64
124
  ### 4. Injecting Services
65
125
 
126
+
127
+
66
128
  Access services (like the email sender) by importing them directly from the core package:
67
129
 
130
+
131
+
68
132
  TypeScript
69
133
 
134
+
135
+
70
136
  ```
137
+
71
138
  // my.service.ts
139
+
72
140
  import { Injectable } from '@nestjs/common';
141
+
73
142
  import { SendEmailService } from '@bts-soft/core'; // ⬅️ Imported from @bts-soft/core
74
143
 
144
+
145
+
75
146
  @Injectable()
147
+
76
148
  export class MyService {
77
- constructor(private readonly emailService: SendEmailService) {}
78
-
79
- async handleSignup(user: any) {
80
- // Logic...
81
-
82
- // Queue the email job
83
- await this.emailService.sendEmail(
84
- user.email,
85
- 'Welcome!',
86
- 'Thanks for signing up to our platform.'
87
- );
88
- }
149
+
150
+   constructor(private readonly emailService: SendEmailService) {}
151
+
152
+
153
+
154
+   async handleSignup(user: any) {
155
+
156
+     // Logic...
157
+
158
+     // Queue the email job
159
+
160
+     await this.emailService.sendEmail(
161
+
162
+       user.email,
163
+
164
+       'Welcome!',
165
+
166
+       'Thanks for signing up to our platform.'
167
+
168
+     );
169
+
170
+   }
171
+
89
172
  }
173
+
90
174
  ```
91
175
 
176
+
177
+
178
+ ## Contact
179
+
180
+ **Author:** Omar Sabry  
181
+ **Email:** omar.sabry.dev@gmail.com  
182
+ **LinkedIn:** [(1) Omar Sabry | LinkedIn](https://www.linkedin.com/in/omarsa6ry/)
183
+ Portfolio: https://omarsabry.netlify.app/
184
+
185
+
186
+
187
+ ## Repository
188
+
189
+ **GitHub:** [bts-soft/packages/core at main · Omar-Sa6ry/bts-soft](https://github.com/Omar-Sa6ry/bts-soft/tree/main/packages/core)
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@bts-soft/core",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "dependencies": {
7
- "@bts-soft/mail-queue": "^1.0.1"
7
+ "@bts-soft/mail-queue": "^1.0.2"
8
8
  },
9
9
  "peerDependencies": {
10
10
  "@nestjs/common": "^10.0.0",