Skip to content

Conversation

@kanishkagarwal6101
Copy link

Description

This PR adds backend API endpoints for Event Popularity Analytics. Please verify everything shows properly in the frontend PR.

Related PRs

Main Changes

New Controller

  • eventPopularityController.js - Implements four main endpoints:
    • getPopularityMetrics() - Calculates popularity metrics by event type
    • getEngagementMetrics() - Calculates engagement metrics (session duration, interaction rate)
    • getEventValue() - Calculates estimated value per event
    • getFormatComparison() - Compares Virtual vs In-Person event metrics

New Router

  • eventPopularityRouter.js - Defines API routes:
    • GET /api/events/popularity - Get popularity metrics
    • GET /api/events/engagement - Get engagement metrics
    • GET /api/events/value - Get event value calculations
    • GET /api/events/format-comparison - Get format comparison data

Route Registration

  • Updated src/startup/routes.js to register the new eventPopularityRouter

Reviewer Notes

  • Please verify everything shows properly in the frontend PR
  • All endpoints require JWT authentication

- Created eventPopularityController with metrics calculation functions
- Implemented getPopularityMetrics endpoint for event type breakdown
- Implemented getEngagementMetrics endpoint for session analytics
- Implemented getEventValue endpoint for estimated value calculations
- Implemented getFormatComparison endpoint for Virtual vs In-Person comparison
- Created eventPopularityRouter with all API routes
- Registered router in startup/routes.js
- Added proper error handling and logging
- All endpoints support date range filtering via query parameters
Copy link

@Anusha-Gali Anusha-Gali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Kanishk,

I have reviewed your PR locally and the backend API responses are as per requirement.
Screenshot 2025-12-16 at 10 49 10 PM
Screenshot 2025-12-16 at 10 49 41 PM
Screenshot 2025-12-16 at 10 49 58 PM
Screenshot 2025-12-16 at 10 50 22 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants