dolphin-server-modules 1.3.0 → 1.3.1

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 CHANGED
@@ -9,6 +9,7 @@
9
9
  ### 📘 Official Master Guide (Nepal)
10
10
  Dolphin Framework को विस्तृत र आधिकारिक गाइड अब उपलब्ध छ। यसमा **Auth, CRUD, Models, र Controllers** को १००% ट्युटोरियल समावेश छ।
11
11
 
12
+ 👉 **[Dolphin Master Guide (Markdown)](https://github.com/Phuyalshankar/dolphin-server-modules/blob/main/DOLPHIN_MASTER_GUIDE_NEPALI.md)** *(Most Up-to-Date)*
12
13
  👉 **[Dolphin Master Guide (PDF)](https://github.com/Phuyalshankar/dolphin-server-modules/blob/main/DOLPHIN_MASTER_GUIDE_NEPALI.pdf)**
13
14
 
14
15
  ---
@@ -116,13 +117,29 @@ Seamlessly switch between databases with the Adapter pattern.
116
117
  Validate payloads and params with 100% type inference.
117
118
 
118
119
  ### 🌐 6. Realtime & IoT Core (`/realtime`)
119
- High-performance pub/sub with MQTT-style matching.
120
+ High-performance pub/sub with MQTT-style matching and binary codecs.
121
+ ```typescript
122
+ import { RealtimeCore } from 'dolphin-server-modules/realtime';
123
+ const rt = new RealtimeCore();
124
+
125
+ rt.subscribe('sensors/+', (ctx) => {
126
+ console.log(`Topic: ${ctx.topic}, Data:`, ctx.payload);
127
+ });
128
+
129
+ rt.publish('sensors/temp', { value: 24.5 });
130
+ ```
120
131
 
121
132
  ### 🛣️ 7. Independent Routing (`/router`) [NEW]
122
133
  Express-style standalone routers for clean organization.
123
- - `app.use('/prefix', subRouter)`: Mount sub-modules with ease.
124
- - **Nested Routing**: Unlimited nesting with prefix inheritance.
125
- - **Unified Matcher**: Optimized matching for both static and dynamic routes.
134
+ ```typescript
135
+ // authRoutes.ts
136
+ import { createDolphinRouter } from 'dolphin-server-modules/router';
137
+ export const authRouter = createDolphinRouter();
138
+ authRouter.get('/login', (ctx) => ctx.json({ status: 'ok' }));
139
+
140
+ // main.ts
141
+ app.use('/auth', authRouter); // Accessible at /auth/login
142
+ ```
126
143
 
127
144
  ---
128
145
 
@@ -200,7 +200,23 @@ rt.publish('sensors/temp', { value: 24.5 });
200
200
 
201
201
  ---
202
202
 
203
- ## १२. अन्तिममा (Conclusion)
203
+ ## १२. इन्डिपेन्डेन्ट राउटिङ (Independent Routing) [NEW]
204
+ ठूला एप्लिकेसनहरूलाई व्यवस्थित गर्न अलग-अलग फाइलमा राउट्हरू राख्न सकिन्छ:
205
+
206
+ ```typescript
207
+ // routes.ts
208
+ import { createDolphinRouter } from 'dolphin-server-modules/router';
209
+ export const apiRouter = createDolphinRouter();
210
+ apiRouter.get('/ping', (ctx) => ctx.json({ msg: 'pong' }));
211
+
212
+ // index.ts
213
+ import { apiRouter } from './routes';
214
+ app.use('/api', apiRouter); // Route अब /api/ping मा उपलब्ध छ
215
+ ```
216
+
217
+ ---
218
+
219
+ ## १३. अन्तिममा (Conclusion)
204
220
 
205
221
  Dolphin Framework निकै छिटो र सजिलो छ। यसले तपाईँको ब्याकइन्ड डेभलपमेन्टको अनुभवलाई नयाँ उचाइमा पुर्‍याउँछ।
206
222
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dolphin-server-modules",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "homepage": "https://github.com/Phuyalshankar/dolphin-server-modules#readme",
5
5
  "description": "Core utility modules for Auth, CRUD, and Controllers",
6
6
  "main": "dist/index.js",