Dev environment setup + event seed data + ObjectId aggregate fix#499
Draft
AZ0228 wants to merge 7 commits into
Draft
Dev environment setup + event seed data + ObjectId aggregate fix#499AZ0228 wants to merge 7 commits into
AZ0228 wants to merge 7 commits into
Conversation
…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>
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
AGENTS.md: Updated Events-Backend stub instructions and corrected test documentation.
Seed script (
scripts/seed-event-demo.js): Populates local MongoDB with realistic data for demoing the org event dashboard:demo@meridian.test/password123ObjectId casting fix (
backend/routes/orgEventManagementRoutes.js):buildOrgEventScopecasts stringorgIdto ObjectId for aggregate pipeline compatibility.Event schema stubs: Added
attendees,collaboratorOrgs,registrationFormIdrefs for Mongoose populate.Demo
Tip: Suppress onboarding popups by running in browser console:
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.