@bts-soft/core 1.0.0 → 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 +189 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,189 @@
1
+ ## @bts-soft/core | The BTS Software Core Toolkit
2
+
3
+
4
+
5
+ The **`@bts-soft/core`** package serves as the unified entry point for all high-quality, pre-configured modules developed by BTS Software.
6
+
7
+
8
+
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.
10
+
11
+
12
+
13
+ ---
14
+
15
+
16
+
17
+ ## Features and Included Modules
18
+
19
+
20
+
21
+ By installing `@bts-soft/core`, you automatically gain access to all the following specialized modules and services:
22
+
23
+
24
+
25
+ | Module          | NPM Package (Internal) | Description                                                                                    |
26
+
27
+ | --------------- | ---------------------- | ---------------------------------------------------------------------------------------------- |
28
+
29
+ | **Email Queue** | `@bts-soft/mail-queue` | Reliable, asynchronous email sending using BullMQ and Nodemailer, preventing request blocking. |
30
+
31
+
32
+
33
+
34
+ ---
35
+
36
+
37
+
38
+ ## Getting Started
39
+
40
+
41
+
42
+ ### 1. Installation
43
+
44
+
45
+
46
+ Install the core package and its required peer dependencies (BullMQ, Nodemailer, etc. are installed automatically as dependencies of `@bts-soft/mail-queue`):
47
+
48
+
49
+
50
+
51
+ ```
52
+
53
+ npm install @bts-soft/core
54
+
55
+ ```
56
+
57
+
58
+
59
+ ### 2. Configuration (Environment Variables)
60
+
61
+
62
+
63
+ Your application must define the following environment variables (required primarily by the `mail-queue` module):
64
+
65
+
66
+
67
+ |Variable|Usage|
68
+
69
+ |---|---|
70
+
71
+ |`REDIS_HOST`, `REDIS_PORT`|Required for BullMQ queue management.|
72
+
73
+ |`MAIL_HOST`, `MAIL_USER`, `MAIL_PASS`|Required for Nodemailer SMTP connection.|
74
+
75
+
76
+
77
+ ### 3. Usage in `AppModule`
78
+
79
+
80
+
81
+ All modules are designed to be imported directly from the `@bts-soft/core` package.
82
+
83
+
84
+
85
+
86
+ ```
87
+
88
+ // app.module.ts
89
+
90
+ import { Module } from '@nestjs/common';
91
+
92
+ // Import all modules and services from the unified Core package
93
+
94
+ import { EmailModule } from '@bts-soft/core';
95
+
96
+
97
+
98
+ @Module({
99
+
100
+   imports: [
101
+
102
+     // Example: Registering the Email Module
103
+
104
+     EmailModule.register({ 
105
+
106
+       // Optional: Custom connection settings can be passed here
107
+
108
+     }),
109
+
110
+     // ... Other application modules
111
+
112
+   ],
113
+
114
+   // ...
115
+
116
+ })
117
+
118
+ export class AppModule {}
119
+
120
+ ```
121
+
122
+
123
+
124
+ ### 4. Injecting Services
125
+
126
+
127
+
128
+ Access services (like the email sender) by importing them directly from the core package:
129
+
130
+
131
+
132
+ TypeScript
133
+
134
+
135
+
136
+ ```
137
+
138
+ // my.service.ts
139
+
140
+ import { Injectable } from '@nestjs/common';
141
+
142
+ import { SendEmailService } from '@bts-soft/core'; // ⬅️ Imported from @bts-soft/core
143
+
144
+
145
+
146
+ @Injectable()
147
+
148
+ export class MyService {
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
+
172
+ }
173
+
174
+ ```
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.0",
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.0"
7
+ "@bts-soft/mail-queue": "^1.0.2"
8
8
  },
9
9
  "peerDependencies": {
10
10
  "@nestjs/common": "^10.0.0",