queen-mq 0.1.0

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 (90) hide show
  1. package/API.md +1116 -0
  2. package/CACHE.md +519 -0
  3. package/DASHBOARD-V3.md +478 -0
  4. package/DASHBOARD.md +382 -0
  5. package/MOD_QUEUE.md +453 -0
  6. package/PARTITION_LOCKING_DESIGN.md +989 -0
  7. package/PLAN.md +707 -0
  8. package/QUERY_ANALSYS.md +72 -0
  9. package/QUEUE_BUS.md +334 -0
  10. package/README.md +1495 -0
  11. package/V2-PLAN.md +236 -0
  12. package/assets/dashboard.png +0 -0
  13. package/dashboard/.vscode/extensions.json +3 -0
  14. package/dashboard/README.md +5 -0
  15. package/dashboard/index.html +14 -0
  16. package/dashboard/package-lock.json +1458 -0
  17. package/dashboard/package.json +25 -0
  18. package/dashboard/public/vite.svg +1 -0
  19. package/dashboard/src/App.vue +29 -0
  20. package/dashboard/src/assets/styles/main.css +908 -0
  21. package/dashboard/src/assets/vue.svg +1 -0
  22. package/dashboard/src/components/cards/MetricCard.vue +298 -0
  23. package/dashboard/src/components/charts/QueueDepthChart.vue +276 -0
  24. package/dashboard/src/components/charts/QueueLagChart.vue +436 -0
  25. package/dashboard/src/components/charts/ThroughputChart.vue +302 -0
  26. package/dashboard/src/components/common/ActivityFeed.vue +251 -0
  27. package/dashboard/src/components/layout/AppHeader.vue +208 -0
  28. package/dashboard/src/components/layout/AppLayout.vue +88 -0
  29. package/dashboard/src/components/layout/AppSidebar.vue +261 -0
  30. package/dashboard/src/main.js +44 -0
  31. package/dashboard/src/router.js +54 -0
  32. package/dashboard/src/services/api.js +187 -0
  33. package/dashboard/src/services/websocket.js +167 -0
  34. package/dashboard/src/utils/constants.js +56 -0
  35. package/dashboard/src/utils/helpers.js +118 -0
  36. package/dashboard/src/views/Analytics.vue +912 -0
  37. package/dashboard/src/views/Dashboard.vue +906 -0
  38. package/dashboard/src/views/Messages.vue +437 -0
  39. package/dashboard/src/views/QueueDetail.vue +501 -0
  40. package/dashboard/src/views/Queues.vue +333 -0
  41. package/dashboard/vite.config.js +30 -0
  42. package/debug-namespace.js +110 -0
  43. package/docs/long-polling.md +159 -0
  44. package/docs/multi-server-cache-solutions.md +185 -0
  45. package/docs/performance-tuning.md +222 -0
  46. package/examples/bus-mode.js +239 -0
  47. package/examples/continuous-consumer-optimized.js +215 -0
  48. package/examples/continuous-consumer.js +159 -0
  49. package/examples/continuous-producer.js +343 -0
  50. package/examples/mixed-mode.js +277 -0
  51. package/examples/multi-server-test.js +305 -0
  52. package/examples/single.js +64 -0
  53. package/examples/smartchat-dealyed.js +42 -0
  54. package/examples/smartchat.js +52 -0
  55. package/examples/test-cache-invalidation.js +119 -0
  56. package/examples/test-cache-multi-server.js +245 -0
  57. package/examples/test-minimal-client.js +112 -0
  58. package/examples/test-queue-creation-policy.js +137 -0
  59. package/init-db.js +20 -0
  60. package/package.json +36 -0
  61. package/src/client/client.js +291 -0
  62. package/src/client/index.js +6 -0
  63. package/src/client/queenClient.js +513 -0
  64. package/src/client/utils/http.js +172 -0
  65. package/src/client/utils/loadBalancer.js +152 -0
  66. package/src/client/utils/retry.js +35 -0
  67. package/src/config.js +215 -0
  68. package/src/database/connection.js +103 -0
  69. package/src/database/poolManager.js +192 -0
  70. package/src/database/schema-v2.sql +214 -0
  71. package/src/managers/eventManager.js +59 -0
  72. package/src/managers/queueManagerOptimized.js +1512 -0
  73. package/src/managers/resourceCache.js +96 -0
  74. package/src/managers/systemEventManager.js +127 -0
  75. package/src/routes/ack.js +26 -0
  76. package/src/routes/analytics.js +812 -0
  77. package/src/routes/configure.js +46 -0
  78. package/src/routes/messages.js +298 -0
  79. package/src/routes/pop.js +85 -0
  80. package/src/routes/push.js +28 -0
  81. package/src/routes/resources.js +296 -0
  82. package/src/server.js +1286 -0
  83. package/src/services/encryptionService.js +82 -0
  84. package/src/services/evictionService.js +131 -0
  85. package/src/services/retentionService.js +129 -0
  86. package/src/services/startupSync.js +35 -0
  87. package/src/test/test.js +4521 -0
  88. package/src/utils/logger.js +44 -0
  89. package/src/utils/uuid.js +5 -0
  90. package/src/websocket/wsServer.js +221 -0
@@ -0,0 +1,478 @@
1
+ # Queen Dashboard V3 - PrimeVue Dark Theme Redesign Plan
2
+
3
+ ## Vision
4
+ Transform the Queen Dashboard into a modern, dark-themed application inspired by PrimeVue's showcase design, featuring the Aura theme with rose/pink primary colors and sophisticated data visualization.
5
+
6
+ ## Design Reference
7
+ Based on [PrimeVue's homepage dashboard](https://primevue.org/) showcasing:
8
+ - Dark mode with Aura theme
9
+ - Rose/pink gradient primary colors
10
+ - Modern card-based layouts
11
+ - Sophisticated charts and data tables
12
+ - Glass-morphism and subtle depth effects
13
+
14
+ ## Technology Stack (No Changes)
15
+ - Vue 3 (Composition API)
16
+ - PrimeVue 4.x with Aura Theme
17
+ - Chart.js with PrimeVue Chart
18
+ - Vite
19
+ - JavaScript (ESM modules)
20
+
21
+ ## Theme Configuration
22
+
23
+ ### Color Palette
24
+ ```css
25
+ /* Dark Mode Colors - Aura Theme with Rose Primary */
26
+ --surface-0: #0f172a; /* Darkest background */
27
+ --surface-50: #1e293b; /* Card backgrounds */
28
+ --surface-100: #334155; /* Elevated surfaces */
29
+ --surface-200: #475569; /* Borders, dividers */
30
+ --surface-300: #64748b; /* Disabled text */
31
+ --surface-400: #94a3b8; /* Muted text */
32
+ --surface-500: #cbd5e1; /* Regular text */
33
+ --surface-600: #e2e8f0; /* Emphasized text */
34
+ --surface-700: #f1f5f9; /* Bright text */
35
+
36
+ /* Rose/Pink Primary Colors */
37
+ --primary-50: #fdf2f8;
38
+ --primary-100: #fce7f3;
39
+ --primary-200: #fbcfe8;
40
+ --primary-300: #f9a8d4;
41
+ --primary-400: #f472b6;
42
+ --primary-500: #ec4899; /* Main rose */
43
+ --primary-600: #db2777;
44
+ --primary-700: #be185d;
45
+ --primary-800: #9f1239;
46
+ --primary-900: #881337;
47
+
48
+ /* Gradient Definitions */
49
+ --gradient-primary: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
50
+ --gradient-chart: linear-gradient(180deg, rgba(236, 72, 153, 0.4) 0%, rgba(236, 72, 153, 0.1) 100%);
51
+ ```
52
+
53
+ ### Typography
54
+ - Font Family: Inter, system-ui
55
+ - Base Size: 14px
56
+ - Scale: 0.75rem to 1.875rem
57
+ - Weight: 300-700
58
+
59
+ ## Component Redesign
60
+
61
+ ### 1. Layout Structure
62
+ ```
63
+ ┌─────────────────────────────────────────────────────┐
64
+ │ Top Bar (Dark) │
65
+ ├──────┬──────────────────────────────────────────────┤
66
+ │ │ │
67
+ │ S │ Main Content Area │
68
+ │ i │ (Dark background #0f172a) │
69
+ │ d │ │
70
+ │ e │ ┌──────────────────────────────┐ │
71
+ │ b │ │ Cards with #1e293b bg │ │
72
+ │ a │ └──────────────────────────────┘ │
73
+ │ r │ │
74
+ │ │ │
75
+ └──────┴──────────────────────────────────────────────┘
76
+ ```
77
+
78
+ ### 2. Sidebar Redesign
79
+ - **Width**: 80px collapsed, 250px expanded
80
+ - **Background**: #1e293b with subtle border
81
+ - **Icons**: Outline style, 20px size
82
+ - **Active Item**: Rose gradient background with glow effect
83
+ - **User Profile**: Avatar at bottom with status indicator
84
+ - **Navigation Items**:
85
+ ```
86
+ 🏠 Dashboard
87
+ 📊 Queues
88
+ 📈 Analytics
89
+ ✉️ Messages
90
+ ⚙️ System
91
+ 👤 Profile (bottom)
92
+ ```
93
+
94
+ ### 3. Top Bar
95
+ - **Height**: 64px
96
+ - **Background**: Transparent with backdrop blur
97
+ - **Content**:
98
+ - Left: Menu toggle + Logo
99
+ - Center: Page title
100
+ - Right: Search bar, notifications, theme toggle, settings
101
+
102
+ ### 4. Dashboard Cards
103
+
104
+ #### 4.1 Metric Cards (Redesigned)
105
+ ```html
106
+ <div class="metric-card-v3">
107
+ <div class="metric-icon-wrapper">
108
+ <i class="pi pi-envelope"></i>
109
+ </div>
110
+ <div class="metric-content">
111
+ <p class="metric-label">Total Messages</p>
112
+ <h3 class="metric-value">1.9K</h3>
113
+ <p class="metric-change">
114
+ <i class="pi pi-arrow-up"></i>
115
+ <span>12.5%</span>
116
+ </p>
117
+ </div>
118
+ <div class="metric-sparkline">
119
+ <!-- Mini chart here -->
120
+ </div>
121
+ </div>
122
+ ```
123
+
124
+ **Styling**:
125
+ - Background: #1e293b
126
+ - Border: 1px solid rgba(236, 72, 153, 0.2)
127
+ - Hover: Subtle glow effect
128
+ - Icon: Rose gradient background
129
+
130
+ #### 4.2 Charts (PrimeVue Dark Style for Message Queue Data)
131
+
132
+ **Message Throughput Chart** (Styled like Crypto Analytics):
133
+ ```javascript
134
+ {
135
+ type: 'bar',
136
+ data: {
137
+ labels: ['00:00', '01:00', '02:00', ...], // Time periods
138
+ datasets: [
139
+ {
140
+ label: 'Incoming Messages',
141
+ backgroundColor: '#ec4899',
142
+ data: [...] // Actual message counts
143
+ },
144
+ {
145
+ label: 'Completed Messages',
146
+ backgroundColor: 'rgba(236, 72, 153, 0.5)',
147
+ data: [...]
148
+ },
149
+ {
150
+ label: 'Failed Messages',
151
+ backgroundColor: 'rgba(236, 72, 153, 0.2)',
152
+ data: [...]
153
+ }
154
+ ]
155
+ },
156
+ options: {
157
+ // Stacked bar chart for message flow visualization
158
+ scales: {
159
+ x: { stacked: true },
160
+ y: { stacked: true }
161
+ }
162
+ }
163
+ }
164
+ ```
165
+
166
+ #### 4.3 Queue Table (Transaction Table Style)
167
+ ```html
168
+ <DataTable class="dark-table-v3">
169
+ <Column field="name" header="Queue Name">
170
+ <template #body="{data}">
171
+ <div class="queue-name-cell">
172
+ <div class="queue-icon">Q</div>
173
+ <span>{{data.name}}</span>
174
+ </div>
175
+ </template>
176
+ </Column>
177
+ <Column field="namespace" header="Namespace" />
178
+ <Column field="pending" header="Pending">
179
+ <template #body="{data}">
180
+ <Badge value="{{data.pending}}" severity="warning" />
181
+ </template>
182
+ </Column>
183
+ <Column field="processing" header="Processing">
184
+ <template #body="{data}">
185
+ <Badge value="{{data.processing}}" severity="info" />
186
+ </template>
187
+ </Column>
188
+ <Column field="rate" header="Rate">
189
+ <template #body="{data}">
190
+ <span class="rate-value">{{data.rate}} msg/min</span>
191
+ </template>
192
+ </Column>
193
+ </DataTable>
194
+ ```
195
+
196
+ **Features**:
197
+ - Dark header (#0f172a)
198
+ - Row hover with rose glow
199
+ - Action buttons with gradient
200
+ - Status badges for message counts
201
+
202
+ #### 4.4 Queue Distribution (My Wallet Style)
203
+ ```html
204
+ <div class="distribution-card">
205
+ <div class="distribution-header">
206
+ <h3>Queue Distribution</h3>
207
+ <Button icon="pi pi-ellipsis-h" />
208
+ </div>
209
+ <div class="distribution-bar">
210
+ <!-- Colorful segments showing message distribution across queues -->
211
+ <div class="segment" style="width: 25%; background: #ec4899"
212
+ title="email-queue: 25%"></div>
213
+ <div class="segment" style="width: 15%; background: #10b981"
214
+ title="notification-queue: 15%"></div>
215
+ <div class="segment" style="width: 30%; background: #f59e0b"
216
+ title="analytics-queue: 30%"></div>
217
+ <div class="segment" style="width: 30%; background: #3b82f6"
218
+ title="payment-queue: 30%"></div>
219
+ </div>
220
+ <div class="distribution-legend">
221
+ <div class="legend-item">
222
+ <span class="dot" style="background: #ec4899"></span>
223
+ <span>email-queue (250 msgs)</span>
224
+ </div>
225
+ <!-- More queue legend items -->
226
+ </div>
227
+ </div>
228
+ ```
229
+
230
+ ### 5. Component Specific Styles
231
+
232
+ #### Cards
233
+ ```css
234
+ .card-v3 {
235
+ background: #1e293b;
236
+ border: 1px solid rgba(255, 255, 255, 0.05);
237
+ border-radius: 12px;
238
+ padding: 1.5rem;
239
+ position: relative;
240
+ overflow: hidden;
241
+ }
242
+
243
+ .card-v3::before {
244
+ content: '';
245
+ position: absolute;
246
+ top: 0;
247
+ left: 0;
248
+ right: 0;
249
+ height: 1px;
250
+ background: linear-gradient(90deg,
251
+ transparent,
252
+ rgba(236, 72, 153, 0.5),
253
+ transparent
254
+ );
255
+ }
256
+ ```
257
+
258
+ #### Buttons
259
+ ```css
260
+ .btn-primary {
261
+ background: linear-gradient(135deg, #ec4899, #db2777);
262
+ border: none;
263
+ color: white;
264
+ padding: 0.625rem 1.25rem;
265
+ border-radius: 8px;
266
+ font-weight: 500;
267
+ box-shadow: 0 4px 14px rgba(236, 72, 153, 0.3);
268
+ }
269
+
270
+ .btn-secondary {
271
+ background: rgba(255, 255, 255, 0.05);
272
+ border: 1px solid rgba(255, 255, 255, 0.1);
273
+ color: #cbd5e1;
274
+ }
275
+ ```
276
+
277
+ #### Input Fields
278
+ ```css
279
+ .input-v3 {
280
+ background: rgba(0, 0, 0, 0.3);
281
+ border: 1px solid rgba(255, 255, 255, 0.1);
282
+ border-radius: 8px;
283
+ color: #e2e8f0;
284
+ padding: 0.625rem 1rem;
285
+ }
286
+
287
+ .input-v3:focus {
288
+ border-color: #ec4899;
289
+ box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
290
+ }
291
+ ```
292
+
293
+ ### 6. Animations & Interactions
294
+
295
+ #### Hover Effects
296
+ - Cards: Subtle lift with glow
297
+ - Buttons: Brightness increase
298
+ - Table rows: Rose highlight
299
+ - Links: Underline animation
300
+
301
+ #### Transitions
302
+ ```css
303
+ /* Smooth transitions for all interactive elements */
304
+ * {
305
+ transition: background-color 0.2s,
306
+ border-color 0.2s,
307
+ box-shadow 0.2s,
308
+ transform 0.2s;
309
+ }
310
+ ```
311
+
312
+ #### Loading States
313
+ - Skeleton screens with animated gradients
314
+ - Pulse animations for pending items
315
+ - Shimmer effects on data loading
316
+
317
+ ### 7. Responsive Breakpoints
318
+ - Desktop: 1440px+ (full layout)
319
+ - Laptop: 1024px-1439px (adjusted spacing)
320
+ - Tablet: 768px-1023px (collapsed sidebar)
321
+ - Mobile: <768px (bottom navigation)
322
+
323
+ ### 8. View-Specific Redesigns (Queen Message Queue Data)
324
+
325
+ #### Dashboard View
326
+ - **Metric Cards**: Total Messages, Pending, Processing, Completed Today, Failed Today, Messages/sec
327
+ - **Throughput Chart**: Message flow (Incoming/Completed/Failed) using stacked bar chart style from PrimeVue
328
+ - **Top Queues Table**: Styled like the Transactions table but showing Queue Name, Namespace, Pending, Processing, Rate
329
+ - **Queue Distribution**: Colorful segmented bar (like My Wallet) showing distribution across queues
330
+ - **Live Activity Feed**: Real-time message events in dark cards
331
+
332
+ #### Queues View
333
+ - **Queue Cards**: Each queue as a dark card with metrics
334
+ - **Queue Table**: Dark themed table showing all queues with their statistics
335
+ - **Actions**: Configure, Clear, View buttons with rose gradient
336
+
337
+ #### Analytics View
338
+ - **Throughput Chart**: Full-width dark chart with rose gradients
339
+ - **Queue Performance**: Dark table with queue metrics
340
+ - **System Metrics**: Cards showing Database Connections, Memory, Request Rate, Latency
341
+
342
+ #### Messages View
343
+ - **Message Browser**: Dark table showing Transaction ID, Queue, Status, Created date
344
+ - **Message Detail**: Dark modal with JSON payload viewer
345
+ - **Filters**: Queue and Status dropdowns with dark theme
346
+
347
+ #### System View
348
+ - **Health Status**: Dark cards with system health metrics
349
+ - **Memory Usage**: Progress bars with rose accent
350
+ - **Database Pool**: Connection statistics in dark cards
351
+ - **Configuration**: System settings in dark themed cards
352
+
353
+ ### 9. PrimeVue Configuration
354
+
355
+ ```javascript
356
+ // main.js
357
+ import PrimeVue from 'primevue/config';
358
+ import Aura from '@primevue/themes/aura';
359
+
360
+ app.use(PrimeVue, {
361
+ theme: {
362
+ preset: Aura,
363
+ options: {
364
+ primary: 'rose',
365
+ darkModeSelector: '.dark',
366
+ cssLayer: {
367
+ name: 'primevue',
368
+ order: 'tailwind-base, primevue, tailwind-utilities'
369
+ }
370
+ }
371
+ },
372
+ ripple: true
373
+ });
374
+ ```
375
+
376
+ ### 10. Implementation Phases
377
+
378
+ #### Phase 1: Core Theme Setup (Day 1)
379
+ - [ ] Configure Aura theme with rose primary
380
+ - [ ] Set up dark mode variables
381
+ - [ ] Update base layout components
382
+ - [ ] Implement new color system
383
+
384
+ #### Phase 2: Component Library (Day 2)
385
+ - [ ] Create new metric card component
386
+ - [ ] Update chart configurations
387
+ - [ ] Redesign data tables
388
+ - [ ] Build distribution bar component
389
+
390
+ #### Phase 3: Layout Redesign (Day 3)
391
+ - [ ] Implement new sidebar with icons
392
+ - [ ] Create glass-morphism top bar
393
+ - [ ] Update navigation system
394
+ - [ ] Add user profile section
395
+
396
+ #### Phase 4: View Updates (Day 4-5)
397
+ - [ ] Redesign Dashboard view
398
+ - [ ] Update Queues view with cards
399
+ - [ ] Enhance Analytics with new charts
400
+ - [ ] Modernize Messages view
401
+ - [ ] Revamp System view
402
+
403
+ #### Phase 5: Polish & Optimization (Day 6)
404
+ - [ ] Add animations and transitions
405
+ - [ ] Implement loading states
406
+ - [ ] Optimize for performance
407
+ - [ ] Test responsive design
408
+ - [ ] Fix edge cases
409
+
410
+ ### 11. Key Features to Implement
411
+
412
+ #### Visual Effects
413
+ - Glass morphism on elevated elements
414
+ - Gradient borders and accents
415
+ - Subtle glow effects on hover
416
+ - Smooth color transitions
417
+ - Animated number counters
418
+
419
+ #### Interactive Elements
420
+ - Ripple effect on clicks
421
+ - Tooltip on hover
422
+ - Expandable cards
423
+ - Draggable widgets
424
+ - Keyboard shortcuts
425
+
426
+ #### Data Visualization
427
+ - Animated chart transitions
428
+ - Interactive legends
429
+ - Zoom and pan capabilities
430
+ - Export functionality
431
+ - Real-time updates with animations
432
+
433
+ ### 12. Performance Considerations
434
+ - Use CSS variables for theme switching
435
+ - Lazy load heavy components
436
+ - Optimize chart rendering
437
+ - Implement virtual scrolling for long lists
438
+ - Cache static assets
439
+
440
+ ### 13. Accessibility
441
+ - ARIA labels for all interactive elements
442
+ - Keyboard navigation support
443
+ - Focus indicators with rose color
444
+ - Screen reader announcements
445
+ - High contrast mode option
446
+
447
+ ### 14. Testing Strategy
448
+ - Component testing with Vitest
449
+ - E2E testing with Playwright
450
+ - Visual regression testing
451
+ - Performance monitoring
452
+ - Accessibility audits
453
+
454
+ ## Success Metrics
455
+ - Load time < 2 seconds
456
+ - Lighthouse score > 90
457
+ - Smooth 60fps animations
458
+ - Mobile-first responsive design
459
+ - WCAG 2.1 AA compliance
460
+
461
+ ## Deliverables
462
+ 1. Fully themed dark mode dashboard
463
+ 2. Reusable component library
464
+ 3. Responsive design system
465
+ 4. Documentation and style guide
466
+ 5. Performance optimization report
467
+
468
+ ## Timeline
469
+ - Week 1: Theme setup and component development
470
+ - Week 2: View implementation and testing
471
+ - Week 3: Polish, optimization, and deployment
472
+
473
+ ## Inspiration Sources
474
+ - [PrimeVue Showcase](https://primevue.org/)
475
+ - Modern crypto dashboards
476
+ - Financial trading platforms
477
+ - Dark mode design patterns
478
+ - Glass morphism trends