Skip to content

Conversation

@codeunia-dev
Copy link
Owner

@codeunia-dev codeunia-dev commented Nov 18, 2025

This PR introduces enhancements and fixes for hackathon-related features in the company dashboard:

Changes included:

  • Added support for displaying hackathon data on the company dashboard overview.
  • Integrated hackathon metrics into dashboard analytics charts for better performance tracking.
  • Improved performance and reliability of hackathon data fetching.
  • Ensured seamless integration with existing company and event analytics.

Impact:

  • Provides companies with a clear view of hackathon participation and metrics.
  • Enhances the dashboard user experience by consolidating hackathon insights.

Future Improvements

  • Include drill-down views for individual hackathon analytics.
  • Optimize dashboard rendering for large datasets.
  • Automate testing for hackathon-related dashboard components.

Authored by: @akshay0611

Summary by CodeRabbit

Release Notes

  • New Features
    • Added hackathon metrics to the analytics dashboard, including views, clicks, and registrations alongside event metrics.
    • New Hackathons tab displays hackathon performance tracking and comparisons.
    • Upcoming Hackathons section shows scheduled hackathons with key details.
    • Hackathon activities (created, approved, rejected) now appear in recent activity logs.

- Add UpcomingHackathon interface to define hackathon data structure
- Extend RecentActivity type to include hackathon_created, hackathon_approved, and hackathon_rejected activity types
- Add upcomingHackathons state to track upcoming hackathons alongside events
- Fetch and filter hackathons data to display only approved upcoming hackathons
- Sort hackathons by date and limit display to 5 most recent
- Generate recent activity entries for hackathons with appropriate status icons and colors
- Add new "Upcoming Hackathons" card section with Trophy icon and grid layout
- Include create hackathon button when no upcoming hackathons exist
- Add UpcomingHackathonItem component to display individual hackathon details
- Update Recent Activity description to mention both events and hackathons
- Add console logging for debugging hackathons data retrieval
- Consolidate activity generation from both events and hackathons into single sorted feed
…mance tracking

- Import Trophy icon from lucide-react for hackathon visualization
- Add hackathonsCreated and hackathonsPublished fields to analytics data mapping
- Include hackathon metrics in totals and averages calculations
- Expand summary stats grid from 4 to 5 columns to accommodate new hackathon card
- Add new SummaryCard for Hackathons Published with created count subtitle
- Change Events Published icon color from yellow to purple for better distinction
- Reorganize performance comparison section into 2-column grid layout
- Add HackathonPerformanceComparison component alongside EventPerformanceComparison
- Rename "Engagement" tab to "Overall Engagement" for clarity
- Add new "Hackathons" tab with line, bar, and area chart visualizations
- Update Events Published chart colors from green (#22c55e) to purple (#a855f7)
- Add hackathon-specific charts with yellow (#eab308) for created and orange (#f97316) for published metrics
- Enhance analytics dashboard to provide comprehensive hackathon performance insights alongside event metrics
@vercel
Copy link

vercel bot commented Nov 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
codeunia Building Building Preview Comment Nov 18, 2025 6:49am

@codeunia-dev codeunia-dev merged commit beab5aa into main Nov 18, 2025
2 of 4 checks passed
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 18, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Two dashboard components are enhanced to support hackathon tracking. AnalyticsCharts gains hackathon metrics fields, a new Hackathons tab with dedicated charting, and a HackathonPerformanceComparison component. CompanyDashboard expands its stats interface with event and hackathon metric breakdowns, adds hackathon activity types, introduces an UpcomingHackathon component, and implements new data aggregation logic for distributed metric calculations.

Changes

Cohort / File(s) Summary
Analytics Hackathon Metrics
components/dashboard/AnalyticsCharts.tsx
Adds hackathonsCreated and hackathonsPublished fields to chart data transformation and totals calculation; introduces HackathonPerformanceComparison component mirroring EventPerformanceComparison structure with average calculations (views, clicks, registrations) and zero-state handling.
Analytics UI Expansion
components/dashboard/AnalyticsCharts.tsx
Expands main grid from 4 to 5 columns; adds "Hackathons Published" summary card with Trophy icon; updates chart color palettes with purple/orange variants for hackathon data; adds new Hackathons tab with dedicated line/bar/area chart section and corresponding data keys.
Dashboard Stats Interface
components/dashboard/CompanyDashboard.tsx
Updates CompanyDashboardStats interface to include eventMetrics and hackathonMetrics objects (each with views, registrations, clicks); expands RecentActivity type with hackathon_created, hackathon_approved, and hackathon_rejected activity types.
Dashboard Hackathon Support
components/dashboard/CompanyDashboard.tsx
Introduces UpcomingHackathon internal type; adds upcomingHackathons state; extends data fetching to retrieve hackathons; implements proportional metric distribution logic for eventMetrics and hackathonMetrics based on event/hackathon counts; adds UpcomingHackathonItem component and Upcoming Hackathons UI section.
Dashboard Metrics UI
components/dashboard/CompanyDashboard.tsx
Adds Event Metrics and Hackathon Metrics card components displaying per-type statistics and calculated conversion rates; expands activity generation to include hackathon-related events (created, approved, rejected).

Sequence Diagram(s)

sequenceDiagram
    participant Dashboard as CompanyDashboard
    participant Analytics as Analytics Data
    participant State as Component State
    participant UI as UI Components

    Dashboard->>Analytics: Fetch events & hackathons data
    Analytics-->>Dashboard: Return metrics (views, clicks, registrations)
    
    Dashboard->>State: Calculate metric distribution
    Note over State: Distribute views/clicks proportionally<br/>between events & hackathons<br/>based on respective counts
    
    Dashboard->>State: Aggregate into eventMetrics<br/>& hackathonMetrics
    State->>UI: Pass metrics to Event/Hackathon<br/>metric cards
    State->>UI: Pass hackathons to<br/>UpcomingHackathonItem
    UI-->>Dashboard: Render organized dashboard
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Metric distribution logic: Verify proportional calculation of views and clicks between events and hackathons—ensure no double-counting or loss of data integrity
  • HackathonPerformanceComparison component: Review averaging logic and comparison structure against EventPerformanceComparison to ensure consistency
  • Data aggregation flow: Trace hackathon data fetching and integration into stats and recent activities
  • Interface changes: Validate that CompanyDashboardStats updates and RecentActivity type extensions are properly consumed throughout the codebase

Possibly related PRs

Poem

🐰 Hop, hop, the data flows in streams,
Events and hackathons fill the dreams,
Trophy icons shine so bright,
Metrics split with all their might,
Dashboard dancing, side by side,
Two great features unified!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/companyhackathons

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4c196fe and c70befc.

📒 Files selected for processing (2)
  • components/dashboard/AnalyticsCharts.tsx (13 hunks)
  • components/dashboard/CompanyDashboard.tsx (16 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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