Communication Queue System - Quick Start π
Get your queue monitoring dashboard running in 10 minutes!
β What's Already Doneβ
β
Backend API (9 endpoints) - Ready
β
Frontend Dashboard (7 components) - Ready
β
Custom hooks (2 hooks) - Ready
β
Service layer - Ready
β
Type definitions - Ready
β
Documentation (7 guides) - Ready
Everything compiles with ZERO errors!
π 10-Minute Integrationβ
Step 1: Add the Route (2 minutes)β
Find your router file and add:
// apps/frontend-pwa/src/App.tsx or your router config
import QueueMonitoringPage from "@/components/queue/QueueMonitoringPage";
// Add this route:
{
path: "/admin/queue",
element: <QueueMonitoringPage />,
}
Step 2: Add Navigation Link (2 minutes)β
Add to your sidebar/admin menu:
import { Activity } from "lucide-react";
<Link to="/admin/queue" className="nav-link">
<Activity className="w-5 h-5" />
Queue Monitoring
</Link>
Step 3: Test (6 minutes)β
# 1. Ensure backend is running
# Should already be running in your terminal
# 2. Open browser and navigate to:
http://localhost:5173/admin/queue
# 3. You should see:
β
Stats cards (Total, Pending, Processing, etc.)
β
Jobs list (or "No jobs found" if queue is empty)
β
Filter tabs (All, Pending, Failed, etc.)
β
Action buttons (Refresh, Process Now)
# 4. Test an action:
β
Click "Refresh" - Data reloads
β
Click "Process Now" - Queue processes manually
β
If you have jobs, click "View" - Modal opens
That's it! You're done! π
π― Quick Feature Testβ
Create a Test Job (Optional)β
If your queue is empty and you want to see data:
-- Run in your database
INSERT INTO communication_queue (
communication_id,
priority,
scheduled_at,
status,
attempts,
max_attempts,
payload,
created_at
) VALUES (
uuid_generate_v4(),
'normal',
NOW(),
'pending',
0,
3,
'{"test": "Sample job for dashboard testing"}',
NOW()
);
Refresh the dashboard - you'll see the job appear!
π What You'll Seeβ
Dashboard Componentsβ
-
Stats Cards (Top Section)
- 6 color-coded cards showing queue health
- Auto-refreshes every 30 seconds
- Alert banners if thresholds exceeded
-
Filter Tabs (Middle)
- Click to filter jobs by status
- Instant client-side filtering
-
Jobs Table (Main Content)
- Desktop: Full table with all details
- Mobile: Card layout
- Action buttons on each row
-
Details Modal (On Click)
- Opens when you click "View"
- Shows complete job information
- JSON payload viewer
π¨ Customization (Optional)β
Change Auto-Refresh Intervalβ
// In QueueMonitoringPage.tsx
const { stats } = useQueueStats(60000); // 60 seconds instead of 30
Change Alert Thresholdsβ
// In QueueStatsCards.tsx
alert={stats.pending > 200} // Change from 100 to 200
Change Jobs Limitβ
// In QueueMonitoringPage.tsx
const { jobs } = useQueueJobs(filterStatus, 100); // 100 instead of 50
π Troubleshootingβ
Dashboard Shows "No jobs found"β
This is normal if:
- Queue is empty
- No communications have been sent
- All jobs completed
To populate:
- Send a test communication
- Or insert test data (SQL above)
Stats Show All Zerosβ
Check:
- Backend is running
- API URL is correct
- Authentication token is valid
- Business ID is set
"Failed to load" Errorβ
Solutions:
- Check browser console for detailed error
- Verify backend endpoint:
http://localhost:3000/api/businesses/{id}/communication-queue/stats - Test with curl to verify API works
- Check authentication token
π Documentation Referenceβ
Need more details?
- Integration:
QUEUE-DASHBOARD-INTEGRATION-GUIDE.md - API Reference:
COMMUNICATION-QUEUE-API.md - Complete Overview:
COMPLETE-QUEUE-IMPLEMENTATION-SUMMARY.md - Visual Guide:
QUEUE-SYSTEM-VISUAL-OVERVIEW.md
β Success Checklistβ
After integration, verify:
- Dashboard accessible at
/admin/queue - Stats cards display (even if zeros)
- Filter tabs are clickable
- Refresh button works
- Mobile view is responsive
- No console errors
- Authentication works
- Business context is set
π That's It!β
You now have a production-ready Communication Queue Monitoring Dashboard!
Total setup time: ~10 minutes
Navigate to: http://localhost:5173/admin/queue
Enjoy your new operational superpower! π