Skip to content

feat: add public shareable link for Grade A freshness reports#69

Merged
jpdevhub merged 5 commits into
jpdevhub:mainfrom
samalbishnupriya06-stack:feat/shareable-grade-a-report
Jun 6, 2026
Merged

feat: add public shareable link for Grade A freshness reports#69
jpdevhub merged 5 commits into
jpdevhub:mainfrom
samalbishnupriya06-stack:feat/shareable-grade-a-report

Conversation

@samalbishnupriya06-stack

@samalbishnupriya06-stack samalbishnupriya06-stack commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

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

@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Invalid vercel.json file provided

@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
fresh-scan-ai Ready Ready Preview, Comment Jun 6, 2026 3:15am

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

🎉 Thank you for your Pull Request! We're thrilled to have your contribution to FreshScan AI.

Before we review, please make sure you have:

  • Followed the CONTRIBUTING.md guidelines.
  • Ensured all automated CI checks (linting, tests) are passing.
  • Checked that your commit messages follow the Conventional Commits format.

A maintainer will review your code as soon as possible!

@samalbishnupriya06-stack

Copy link
Copy Markdown
Contributor Author

Hey @jpdevhub I've submitted PR #69 for this — would appreciate a review when you get a chance!

@jpdevhub

jpdevhub commented Jun 4, 2026

Copy link
Copy Markdown
Owner

tag the issue no.

@jpdevhub

jpdevhub commented Jun 4, 2026

Copy link
Copy Markdown
Owner

See the issue of the vercel and ci cd pipeline also failing.

@jpdevhub

jpdevhub commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Still many test are failing and also tag the issue no.

@samalbishnupriya06-stack

Copy link
Copy Markdown
Contributor Author

Still many test are failing and also tag the issue no.

solving them.

@samalbishnupriya06-stack

Copy link
Copy Markdown
Contributor Author

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!

@vercel

vercel Bot commented Jun 6, 2026

Copy link
Copy Markdown

@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 jpdevhub left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Their was some issues, I have fixed . Its ready for merge and Thanks for contributing.

@jpdevhub jpdevhub merged commit 5f361f0 into jpdevhub:main Jun 6, 2026
7 checks passed
@samalbishnupriya06-stack

Copy link
Copy Markdown
Contributor Author

Their was some issues, I have fixed . Its ready for merge and Thanks for contributing.

thank you so much. means a lot

@jpdevhub

Copy link
Copy Markdown
Owner

You are not in the contributers list of new ssoc link contact the support team asap.

@samalbishnupriya06-stack

Copy link
Copy Markdown
Contributor Author

You are not in the contributers list of new ssoc link contact the support team asap.

Okhhh doing

@samalbishnupriya06-stack

Copy link
Copy Markdown
Contributor Author

You are not in the contributers list of new ssoc link contact the support team asap.

do u know how to do that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

M-06: Shareable Scan Report (PDF / Link)

2 participants