Skip to content

Conversation

@codeunia-dev
Copy link
Owner

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

This PR introduces analytics instrumentation across event and hackathon workflows to improve visibility into platform activity and enable richer reporting.

🔍 What’s Included

  • Added analytics hooks for:

    • Event creation
    • Event publication
    • Hackathon creation
    • Hackathon publication
  • Ensures all create/publish actions are captured consistently across the platform.

  • Centralized tracking logic to maintain cleaner and more maintainable code.

📈 Impact

  • Enables more accurate activity insights for companies and admins.
  • Supports future dashboards for growth monitoring and usage analytics.
  • Prepares backend for advanced reporting features.

🗂️ Files Updated

  • 1 commit
  • 4 files changed

Authored by: @akshay0611

Summary by CodeRabbit

  • Chores
    • Enhanced internal analytics tracking infrastructure to monitor event and hackathon creation, as well as their approval and publishing activities.

@vercel
Copy link

vercel bot commented Nov 19, 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 19, 2025 10:35am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 19, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request makes the incrementCompanyAnalytics method public in AnalyticsService, then integrates analytics tracking into event and hackathon creation and approval workflows. Analytics calls log errors gracefully without interrupting primary operations.

Changes

Cohort / File(s) Change Summary
AnalyticsService Method Visibility
lib/services/analytics-service.ts
Changed incrementCompanyAnalytics from private static to static (public), enabling external access to the method while preserving all parameters and return type.
Analytics Tracking Integration
lib/services/events.ts, lib/services/hackathons.ts, lib/services/moderation-service.ts
Added AnalyticsService imports and integrated analytics tracking calls into event/hackathon creation and approval workflows. Errors in analytics tracking are caught and logged but do not affect primary operation completion.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Service as Events/Hackathons/<br>Moderation Service
    participant DB as Database
    participant Analytics as AnalyticsService

    Client->>Service: Create/Approve Request
    Service->>DB: Insert/Update Entity
    DB-->>Service: Success
    
    rect rgb(200, 220, 240)
    Note over Service,Analytics: Analytics Tracking (Non-blocking)
    Service->>Analytics: incrementCompanyAnalytics(...)
    alt Analytics Success
        Analytics-->>Service: Tracked ✓
    else Analytics Error
        Analytics-->>Service: Error (logged, ignored)
    end
    end
    
    Service-->>Client: Operation Complete
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Consistency verification: Ensure metric names (events_created, hackathons_created, events_published, hackathons_published) are correct and aligned across all call sites.
  • Error handling pattern: Confirm that analytics failures are consistently logged without affecting primary operations in all four service files.
  • Import correctness: Verify AnalyticsService is properly imported in each modified service file.

Possibly related PRs

Poem

🐰 A method once private, now shines in the light,
Analytics flutter through events, oh what a sight!
Hackathons bloom, approvals cascade,
Each creation tracked—a data parade! 📊✨

✨ 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/analyticsgraph

📜 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 eebf9ef and 85f3179.

📒 Files selected for processing (4)
  • lib/services/analytics-service.ts (1 hunks)
  • lib/services/events.ts (10 hunks)
  • lib/services/hackathons.ts (10 hunks)
  • lib/services/moderation-service.ts (3 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.

@codeunia-dev codeunia-dev merged commit e3fffc5 into main Nov 19, 2025
2 of 4 checks passed
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