- Ticketed events: full CRUD, ticket tiers (free/paid/donation), Stripe checkout, QR-based check-in scanner, public event pages, ticket confirmation emails - Event formats: IN_PERSON/ONLINE/HYBRID with auto Jitsi meeting room lifecycle, ticket-gated meeting access, moderator JWT tokens, feature-flag guarded - Social engagement: challenges with scoring/leaderboards, referral tracking, volunteer spotlight, impact stories, campaign celebrations, wall of fame - Social calendar: personal calendar layers, shared calendar items with recurrence, scheduling polls, mobile day view - MCP server: events tool pack with full admin CRUD + meeting token generation - Unified calendar: eventFormat-aware tags, online event indicators - Updated docs site, pangolin configs, and various admin UI improvements Bunker Admin
60 lines
2.4 KiB
TypeScript
60 lines
2.4 KiB
TypeScript
import { Router } from 'express';
|
|
import { authenticate } from '../../middleware/auth.middleware';
|
|
import { requireRole } from '../../middleware/rbac.middleware';
|
|
import { friendshipRouter } from './friendship.routes';
|
|
import { blockRouter } from './block.routes';
|
|
import { privacyRouter } from './privacy.routes';
|
|
import { notificationRouter } from './notification.routes';
|
|
import { profileRouter } from './profile.routes';
|
|
import { feedRouter } from './feed.routes';
|
|
import { suggestionsRouter } from './suggestions.routes';
|
|
import { pokeRouter } from './poke.routes';
|
|
import { recommendationRouter } from './recommendation.routes';
|
|
import { integrationRouter } from './integration.routes';
|
|
import { groupRouter } from './group.routes';
|
|
import { achievementsRouter } from './achievements.routes';
|
|
import { sseRouter } from './sse.routes';
|
|
import { socialAdminRouter } from './social-admin.routes';
|
|
import { referralRouter } from './referral.routes';
|
|
import { impactStoriesRouter } from './impact-stories.routes';
|
|
import { spotlightRouter } from './spotlight.routes';
|
|
import { challengeRouter } from './challenge.routes';
|
|
|
|
const router = Router();
|
|
|
|
// EventSource (SSE) doesn't support custom headers — accept token via query param
|
|
// This runs before authenticate so the SSE connection can be established
|
|
router.use((req, _res, next) => {
|
|
if (req.query.token && !req.headers.authorization) {
|
|
req.headers.authorization = `Bearer ${req.query.token}`;
|
|
}
|
|
next();
|
|
});
|
|
|
|
// All social routes require authentication
|
|
router.use(authenticate);
|
|
|
|
// Admin sub-router (requires admin role)
|
|
router.use('/admin', requireRole('SUPER_ADMIN', 'INFLUENCE_ADMIN', 'MAP_ADMIN'), socialAdminRouter);
|
|
|
|
// Sub-routers
|
|
router.use('/friends', friendshipRouter);
|
|
router.use('/blocks', blockRouter);
|
|
router.use('/privacy', privacyRouter);
|
|
router.use('/notifications', notificationRouter);
|
|
router.use('/profile', profileRouter);
|
|
router.use('/feed', feedRouter);
|
|
router.use('/suggestions', suggestionsRouter);
|
|
router.use('/pokes', pokeRouter);
|
|
router.use('/recommendations', recommendationRouter);
|
|
router.use('/integration', integrationRouter);
|
|
router.use('/groups', groupRouter);
|
|
router.use('/achievements', achievementsRouter);
|
|
router.use('/sse', sseRouter);
|
|
router.use('/referrals', referralRouter);
|
|
router.use('/stories', impactStoriesRouter);
|
|
router.use('/spotlight', spotlightRouter);
|
|
router.use('/challenges', challengeRouter);
|
|
|
|
export { router as socialRouter };
|