Database: - Migration 005: SaaS marketplace tables (enhanced shippers, vehicles, loads, bids, negotiations, ratings, notifications, load_views) Public Registration: - GET/POST /register/shipper — self-registration with validation - GET/POST /register/driver — self-registration with vehicle details - Public landing page with tricolor design - Auto-login after registration Marketplace: - GET /marketplace — browse loads with filters (from, to, type, sort) - GET /marketplace/load/:id — load detail with bid info - GET/POST /marketplace/post — post a load (shipper) - GET /marketplace/notifications — notification center with real-time badge - GET /marketplace/notifications/count — unread count API Bidding System: - POST /marketplace/bid — place a bid (driver) - POST /marketplace/bid/:id/accept — accept bid (shipper, auto-rejects others) - POST /marketplace/bid/:id/negotiate — counter-offer - POST /marketplace/rate — submit rating/review - Automatic notifications on bid/accept/reject Views: - Marketplace index with load cards and bid status - Load detail with bid form (driver) or bid management (shipper) - Post load form with full details - Notification center with mark-read - Portal header/footer partials for portal layout Architecture: - Added portalUser to res.locals - Wired /marketplace route into server.js - Landing page at / (redirects to dashboard if logged in)
22 lines
585 B
Text
22 lines
585 B
Text
</main>
|
|
</div>
|
|
|
|
<script src="/js/app.js"></script>
|
|
<script>
|
|
// Fetch unread notification count for badge
|
|
(async function() {
|
|
try {
|
|
const res = await fetch('/marketplace/notifications/count');
|
|
if (res.ok) {
|
|
const data = await res.json();
|
|
const badge = document.getElementById('notif-badge');
|
|
if (badge && data.count > 0) {
|
|
badge.textContent = data.count > 99 ? '99+' : data.count;
|
|
badge.style.display = 'block';
|
|
}
|
|
}
|
|
} catch(e) {}
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|