Messaging
Direct messages between buyers and producers. Real-time delivery uses Socket.IO when available; on Vercel serverless the app falls back to REST + polling.
Pages & UI
/dashboard/messages— conversation list and thread viewConversationView,MessageModal— message UIstores/messages.ts— Pinia store for conversationsUiMessagesCount— unread badge in header
Real-time vs polling
useSocket+plugins/socket.client.ts— Socket.IO clientNUXT_PUBLIC_ENABLE_SOCKET=true— only when API runs on a persistent host- On Vercel: disabled by default; messages page polls every ~10s
Notifications
/dashboard/notifications— notification centerGET /api/messages/notifications— fetch notificationsPUT /api/messages/notifications/read-all— mark all read
Relevant API
GET /api/messages/conversations— list threadsGET /api/messages/conversations/:userId— messages with userPOST /api/messages/send— send messagePUT /api/messages/:messageId/read— mark read