Skip to content

Dev environment setup + event seed data + ObjectId aggregate fix#499

Draft
AZ0228 wants to merge 7 commits into
mainfrom
cursor/dev-environment-setup-3be9
Draft

Dev environment setup + event seed data + ObjectId aggregate fix#499
AZ0228 wants to merge 7 commits into
mainfrom
cursor/dev-environment-setup-3be9

Conversation

@AZ0228
Copy link
Copy Markdown
Collaborator

@AZ0228 AZ0228 commented May 5, 2026

Summary

Sets up the development environment, adds a comprehensive event demo seed script with full analytics funnel data, and fixes an ObjectId casting bug in aggregate queries.

Changes

  1. AGENTS.md: Updated Events-Backend stub instructions and corrected test documentation.

  2. Seed script (scripts/seed-event-demo.js): Populates local MongoDB with realistic data for demoing the org event dashboard:

    • 16 users with natural names and RPI emails
    • 1 org (RPI Innovators Hub) with 4 role tiers and 16 members
    • 6 events — Spring Innovation Showcase is the flagship upcoming event (8 days out) with exponential registration growth:
      • Registration curve uses power-law distribution (t^2.2) with ±40% variance and occasional spikes/dips
      • 178 registrations out of 250 expected, ramping from ~1/day early to ~18/day near the event
    • Analytics funnel with clear drop-off at each stage:
      • 847 unique viewers → 312 form opens → 178 registrations → 0 check-ins
      • Traffic sources: Direct (40%), Explore (40%), Org Page (20%)
    • 178 registration form responses, 7-item event agenda, 3 volunteer roles, equipment allocations
    • Login: demo@meridian.test / password123
  3. ObjectId casting fix (backend/routes/orgEventManagementRoutes.js): buildOrgEventScope casts string orgId to ObjectId for aggregate pipeline compatibility.

  4. Event schema stubs: Added attendees, collaboratorOrgs, registrationFormId refs for Mongoose populate.

Demo

Tip: Suppress onboarding popups by running in browser console:

localStorage.setItem('clubDashOnboardingSeen', 'true');
localStorage.setItem('eventDashboardOnboardingSeen', 'true');

Demo flow: Events list → Overview (registration curve) → Registrations → Agenda → Analytics (funnel) → Jobs → Members

event-dashboard-final-demo.mp4

Exponential registration curve ramping toward event date
Engagement funnel: 847 viewers → 312 form opens → 178 registrations

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

cursoragent and others added 4 commits May 5, 2026 02:52
…ackend test commands

Co-authored-by: James Liu <AZ0228@users.noreply.github.com>
Co-authored-by: James Liu <AZ0228@users.noreply.github.com>
…n data

Creates scripts/seed-event-demo.js that populates the local MongoDB with:
- 16 users with natural names and RPI emails
- 1 org (RPI Innovators Hub) with roles and positions
- 6 events (4 past, 2 upcoming) spanning showcase, talk, social, workshop, gala, study types
- Event analytics (views, registrations, engagement rates)
- Registration forms and 12 form responses
- Event agenda with 7 items for the flagship showcase event
- Volunteer roles (Stage Manager, AV Tech, Registration Desk) with assignments
- Equipment allocations
- Org followers

Login: demo@meridian.test / password123
Dashboard: /club-dashboard/RPI-Innovators-Hub

Co-authored-by: James Liu <AZ0228@users.noreply.github.com>
The orgId from req.params is a string, which doesn't match ObjectId
fields in MongoDB aggregate pipelines (unlike Mongoose find() which
auto-casts). This caused event analytics and dashboard aggregations
to return zero results even with valid data.

Co-authored-by: James Liu <AZ0228@users.noreply.github.com>
@cursor cursor Bot changed the title Update AGENTS.md with improved Events-Backend stub instructions Dev environment setup + event seed data + ObjectId aggregate fix May 5, 2026
cursoragent and others added 3 commits May 5, 2026 06:19
- Add viewHistory to EventAnalytics seed entries for legacy analytics
- Seed analytics_events collection with platform-level events:
  event_view, event_registration_form_open, event_registration,
  event_checkin (with referrer source attribution)
- Update event schema stub to include attendees, registrationFormId,
  and collaboratorOrgs for Mongoose populate support
- Update eventAnalytics schema stub with viewHistory and rsvpHistory
- Update formResponse schema stub with submittedBy ref for populate

Funnel data for Spring Innovation Showcase:
  15 unique viewers → 12 form opens → 12 registrations → 10 check-ins
  Sources: 6 direct, 6 explore, 3 org_page

Co-authored-by: James Liu <AZ0228@users.noreply.github.com>
- Showcase: 250 expected → 178 registered, 142 checked in
  Funnel: 312 viewers → 245 form opens → 178 regs → 142 check-ins
- Tech Talk: 80 expected → 62 registered, 54 checked in
- Networking Mixer: 60 expected → 47 registered, 43 checked in
- HackRPI (upcoming): 120 expected → 34 registered
- Annual Gala (upcoming): 200 expected → 18 registered
- Study Session: 20 expected → 15 registered, 13 checked in

Generate synthetic ObjectIds for platform analytics events so
unique user counts are accurate at scale (previously capped at 15
because of reusing the same 15 member users).

Co-authored-by: James Liu <AZ0228@users.noreply.github.com>
…unnel drop-off

- Spring Innovation Showcase is now 8 days in the future (upcoming event)
- Registration dates follow an exponential curve with day-to-day noise:
  slow trickle early on, compounding toward the event (power-law t^2.2
  with ±40% variance, occasional spikes and dips)
- Funnel views increased to 847 unique viewers vs 312 form opens (63%
  drop-off) vs 178 registrations — clear narrowing at each stage
- All analytics timestamps capped to now (future-dated events no longer
  produce future timestamps that get filtered by the 90d query window)
- Event jobs/volunteers/agenda times updated to match new event date

Co-authored-by: James Liu <AZ0228@users.noreply.github.com>
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.

2 participants