feat: campaign analytics report export to pdf - #775
Merged
dotunv merged 1 commit intoAug 31, 2026
Merged
Conversation
|
@Stanley-Owoh Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
8 tasks
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.
feat: Campaign analytics report export to PDF
Overview
Adds campaign creator analytics export to PDF, complementing the existing CSV export (#408). Creators can now generate a polished, printable financial and engagement report for their campaign, and share it via an expiring signed URL.
Changes
Backend
New:
backend/src/services/campaignReportService.jsNew:
backend/src/services/campaignReportPdf.jspdfkit, including: campaign summary, raised vs goal (with progress bar), fee breakdown, contributor count, top contributors, milestone status, and funding/status timeline.streamCampaignReportPdfpipes PDF bytes directly to the HTTP response (no large in-memory buffer) as required by the issue.generateCampaignReportPdfBufferprovided for tests / object-storage flows.backend/src/routes/campaigns.js— new routes:GET /api/campaigns/:id/report/export— streams a PDF attachment; requires authentication and owner (or admin) membership.GET /api/campaigns/:id/report/share— returns an expiring signed share URL; requires authentication and owner (or admin) membership.GET /api/campaigns/:id/report/share/:token— serves the PDF via a validated signed token (shareable link, no auth required, token-expiry enforced).backend/package.json— addedpdfkitdependency.Frontend
frontend/src/pages/CreatorCampaignAnalytics.jsx— added a "Download Report" button beside the existing CSV export, with loading state.frontend/src/services/api.js— addedexportCampaignReport()blob download helper.Tests
New:
backend/src/services/campaignReportService.test.jsbackend/src/routes/campaigns.test.js— added route coverage:All backend tests pass (39 tests).
Closes #765