Replit Dental server Scan function Fix

Job ID: 40105560

Budget: $15 – $50 USD

I’m building a dental-office management web app inside Replit AI. Right now the flow can:

• let me choose an existing patient,
• open the phone’s camera,
• capture a photo

…but the moment I tap “save” Replit throws an error and nothing reaches the backend. I need a hand to make this feature production-ready.

Here are tech details from Replit
Replit use its own object storage. It is similar to google could storage. No base64. The steps are
Here's how it works:

Phone camera captures image → The file stays on your phone temporarily
Uppy requests a "signed URL" → Your app backend asks cloud storage for permission to upload
Direct upload to cloud storage → The photo goes directly from your phone to cloud storage (bypasses the backend server)
Save record to database → After upload succeeds, the app sends only the file info (name, path, size) to the backend, which saves it to the database

So the actual photo file never passes through the backend server - it goes straight to cloud storage. Only the metadata (file name, location, etc.) gets saved in the database.


Here’s what I need you to tackle:

1. Debug and repair the save routine so each captured page is stored in Replit AI cloud storage and linked to the selected patient record.

2. Add a post-capture “document filter” similar to Google Drive or OneDrive: automatic edge detection, perspective correction, conversion to crisp black-and-white, and shadow removal before the PDF is generated.

By the way, the AI also created an upload button/function. It can upload files from a pc (desktop) to database. It can be your reference.

You’ll have full access to the current Replit project so you can review frontend/backend, the existing Python and JavaScript code, environment variables, and storage helpers.

Acceptance criteria
– Tap “Scan” → take photo(s) →filter automatically, if it looks fine, hit “Save”: a PDF appears immediately in the patient’s file list with no console errors. Or cancel if it did not look good. Then it can scan again

– Visual quality matches typical mobile scanner apps: straightened page, high contrast, no background shadows.
– Solution runs entirely inside the current Replit workspace; no external services beyond Replit AI cloud storage are introduced.
– Clear comments or a short README explaining any new libraries or build steps.

Basically, the scan function is similar to google drive/one drive scan function. But only for documents scan, not other functions

Please explain your tech solution with details for this project when you reply. Thank you!