Skip to content

[FEATURE]: Implement Server-Side Analytics & Trend Reports#277

Merged
Nitya-003 merged 5 commits into
Nitya-003:mainfrom
rach-kanc:main
Jun 15, 2026
Merged

[FEATURE]: Implement Server-Side Analytics & Trend Reports#277
Nitya-003 merged 5 commits into
Nitya-003:mainfrom
rach-kanc:main

Conversation

@rach-kanc

Copy link
Copy Markdown
Contributor

📝 Pull Request Summary

This PR migrates the heavy data calculations for the Analytics Dashboard from the client's browser to the backend, fulfilling the "Enhanced Analytics" milestone on the project roadmap.

Key changes include:

  • Added firebase-admin to securely execute database queries on the server without strict client rules.
  • Created a high-performance Next.js API route (app/api/analytics/route.ts) that verifies the user's Auth token and calculates their total entries, streaks, and most common moods entirely on the server.
  • Developed a custom useServerAnalytics hook to fetch this data.
  • Updated BentoDashboard and MoodStats to prioritize server-rendered analytics while maintaining local Zustand state as an instant fallback for an optimal offline experience.

🔗 Related Issue

Closes #276

🛠️ Type of Change

  • 🚀 New Feature
  • 🐛 Bug Fix
  • 📄 Documentation Update
  • 🎨 UI/UX Enhancement

✅ Contributor Checklist

  • I have tested my changes locally.
  • My code follows the Apple-level design guidelines.
  • I have updated the README if necessary.
  • (Apertre 3.0) I have added relevant badges/labels.

##Tags
database, ssoc26, hard

@vercel

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown

@rach-kanc is attempting to deploy a commit to the Nitya Gosain's projects Team on Vercel.

A member of the Team first needs to authorize it.

@rach-kanc

Copy link
Copy Markdown
Contributor Author

@Nitya-003 Check the PR and add respective tags

@Nitya-003 Nitya-003 added enhancement New feature or request Hard 40 pts SSoC26 labels Jun 15, 2026
@Nitya-003 Nitya-003 merged commit 1464b8b into Nitya-003:main Jun 15, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Hard 40 pts SSoC26

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Migrate Analytics Aggregation to Server-Side API for Performance

2 participants