Skip to content

feat: Add analytics dashboard with performance insights (Phase 3.2)#25

Open
Datakult0r wants to merge 8 commits into
devin/1768448452-session9-pages-datafrom
devin/1768941364-analytics-dashboard
Open

feat: Add analytics dashboard with performance insights (Phase 3.2)#25
Datakult0r wants to merge 8 commits into
devin/1768448452-session9-pages-datafrom
devin/1768941364-analytics-dashboard

Conversation

@Datakult0r
Copy link
Copy Markdown
Owner

Summary

This PR implements Phase 3.2 of the PRD - Analytics Dashboard. It adds a comprehensive analytics system with backend API endpoints and a frontend visualization page.

Backend (308 lines): New /api/analytics routes providing dashboard stats, success rates by source, proposal generation times, relevance score distribution, grants by source, and 30-day activity trends.

Frontend (436 lines): New /analytics page with overview stat cards, proposal status distribution, relevance distribution bar chart, generation time comparison (Fast Track vs Research Track), success rate by source, grants by source, and a 30-day trend visualization.

Review & Testing Checklist for Human

  • Verify Supabase join syntax - The /success-rate endpoint uses proposals -> grants join. Confirm this works with your schema: grants (source, name) nested select.
  • Test with real data - The charts use CSS-based visualizations. Verify they render correctly with actual database content, especially edge cases (0 values, very large numbers).
  • Security: Analytics endpoints are unprotected - All /api/analytics/* routes have no authentication. Decide if business metrics should be public or protected.
  • Performance with large datasets - The /dashboard endpoint makes 6+ sequential Supabase queries. Test with production-scale data to ensure acceptable response times.

Recommended test plan:

  1. Start backend and frontend locally
  2. Navigate to /analytics
  3. Verify all 6 stat cards show correct counts
  4. Check that charts render (may show "No data available" if database is empty)
  5. Run the seed script (npm run seed) and refresh to see populated charts
  6. Inspect Network tab to verify all 6 API calls succeed

Notes

Link to Devin run: https://app.devin.ai/sessions/9573820f0f6d41dab1cff8a61c26c981
Requested by: @Datakult0r

- Added Dockerfile for containerized deployment
- Added fly.toml with Fly.io configuration
- Added .dockerignore to exclude unnecessary files
- Added comprehensive DEPLOYMENT.md guide
- Created backend analytics API routes:
  - GET /dashboard - Overview stats (grants, proposals, relevance)
  - GET /success-rate - Success rate by grant source
  - GET /generation-time - Avg proposal generation time by mode
  - GET /relevance-distribution - Relevance score ranges
  - GET /grants-by-source - Grant count by source
  - GET /trends - 30-day activity trends
- Created frontend analytics page with:
  - Overview stats cards (total grants, active, new this week, proposals)
  - Proposal status distribution chart
  - Relevance score distribution bar chart
  - Generation time comparison (Fast Track vs Research Track)
  - Success rate by source with progress bars
  - Grants by source horizontal bar chart
  - 30-day activity trend visualization
- Updated server.js to include analytics routes
@devin-ai-integration
Copy link
Copy Markdown
Contributor

Original prompt from Datakult
https://github.com/Datakult0r/ai-grant-crawler-a2a-pro
index this

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 20, 2026

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

Project Deployment Review Updated (UTC)
ai-grant-crawler-a2a-pro Error Error Jan 25, 2026 9:00pm

@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 20, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

…s-data

feat: Session 9 - Remaining Pages Data Integration
…vements

docs: Add PRD, deployment config, and fix README merge conflict
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.

1 participant