feat: Analytics Phase 5 — Export & Reporting (CSV + JSON) - #30
Open
ChitkulLakshya wants to merge 5 commits into
Open
feat: Analytics Phase 5 — Export & Reporting (CSV + JSON)#30ChitkulLakshya wants to merge 5 commits into
ChitkulLakshya wants to merge 5 commits into
Conversation
- exportOverviewCSV: multi-section CSV with KPIs, templates, trends, type distribution - exportOverviewJSON: structured JSON with all overview data - exportTemplateDetailCSV: per-template CSV with info, field stats, raw submissions - exportTemplateDetailJSON: structured JSON for template detail - exportAllSubmissionsCSV: flat CSV of all submissions for a template - arrayToCSV + escapeCSV: helpers for proper CSV formatting (quotes, commas, newlines) - All functions scoped by ownerUid for user isolation
- GET /api/analytics/export/overview.csv — full overview as multi-section CSV - GET /api/analytics/export/overview.json — structured JSON overview - GET /api/analytics/templates/:draftId/export.csv — template detail with field stats + submissions - GET /api/analytics/templates/:draftId/export.json — structured JSON template detail - GET /api/analytics/templates/:draftId/submissions/export.csv — flat submissions CSV - All endpoints behind verifyToken, scoped to req.user.uid - Proper Content-Disposition headers for file download
…lateDetailAnalytics AnalyticsPage.jsx: - Added Download icon import - handleExport function: fetches blob, creates download link, triggers file download - CSV and JSON export buttons in header next to Sync Data button - Exporting state with spinner during download TemplateDetailAnalytics.jsx: - Added Download icon import - handleExport function: same blob download pattern for per-template export - CSV and JSON export buttons in detail header - Exporting state with spinner
- .analytics-export-group: flex container for CSV/JSON buttons - .analytics-export-btn: outlined button with blue hover state - .analytics-detail-header: flex space-between for title + export buttons
✅ Deploy Preview for leddger-ai ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Analytics Phase 5 — Export & Reporting
Adds CSV and JSON export capabilities to the analytics feature.
Changes
Backend:
Frontend:
Docs:
Export Endpoints
Build