feat: add public shareable link for Grade A freshness reports#69
Conversation
|
Deployment failed with the following error: |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
🎉 Thank you for your Pull Request! We're thrilled to have your contribution to FreshScan AI. Before we review, please make sure you have:
A maintainer will review your code as soon as possible! |
|
tag the issue no. |
|
See the issue of the vercel and ci cd pipeline also failing. |
|
Still many test are failing and also tag the issue no. |
solving them. |
|
Hi @jpdevhub i've addressed the CI lint and TypeScript build errors in the latest commit. The only remaining check is the Vercel preview deployment which seems to be an environment variable issue on the preview side. Would appreciate a review when you get a chance! |
|
@jpdevhub is attempting to deploy a commit to the karan3431's projects Team on Vercel. A member of the Team first needs to authorize it. |
jpdevhub
left a comment
There was a problem hiding this comment.
Their was some issues, I have fixed . Its ready for merge and Thanks for contributing.
thank you so much. means a lot |
|
You are not in the contributers list of new ssoc link contact the support team asap. |
Okhhh doing |
do u know how to do that? |
This PR adds a public shareable link feature for Grade A freshness scan results. When a scan returns Grade A, a Share button appears that copies a public URL to the clipboard, and anyone with the link can view a read-only report page without logging in.
For the backend, the new endpoint is added in backend/main.py as a separate route outside router.py, so it sits outside the existing JWT dependency scope. All protected endpoints use Depends(get_current_user) at the router level — the public endpoint simply omits that dependency, accepts only a report ID, queries only Grade A results, and returns 404 for anything else. For frontend routing, the new /report/:id route is registered in src/App.tsx using React Router pointing to a new PublicReport.tsx page that fetches from the public endpoint using the id param with no auth context needed. For print styling, a @media print block in src/index.css hides the Navbar and BottomNav using display: none, and the Share page exposes a Download as PDF button that calls window.print() — since PublicReport.tsx renders no nav elements, only the report card prints cleanly.
Files changed: backend/main.py (public GET endpoint, no auth), backend/public_report.py (Grade A query logic), src/App.tsx (new route), src/pages/PublicReport.tsx (read-only page), src/pages/ScannerPage.tsx (Share button on Grade A card), src/index.css (print styles), vercel.json (SPA rewrite rule to prevent 404 on hard refresh). Browser print was chosen over jsPDF to avoid a heavy dependency. No breaking changes to existing protected endpoints.
closes #47