- Inspiration :-
I live in Nadiad, Gujarat. In my town almost every family has someone working abroad, in the US, UK, Canada or the Gulf, while the parents stay here. I have seen the same problem many times. A parent visits the doctor, sends a photo of the prescription on WhatsApp, and the son or daughter abroad cannot do much with it. The handwriting is hard to read, the local medical store wants cash or UPI and not a foreign card, and nobody is sure if the medicine really reached home. I also build software for pharmacies, so I wanted to make something that solves this properly, from the prescription photo to the medicine at the door.
- What it does:-
The family member abroad uploads a photo of the prescription. Google Gemini reads it: every medicine, the strength, the dose (like 1-0-1) and the number of days. Each medicine is then matched to the real stock of a pharmacy near the parents. The app works out how many strips are needed from dose and days. If the pharmacy has a cheaper brand with the same salt, the family can switch with one tap. In our sample prescription this saves around 40%. If a brand is out of stock, the app picks an in-stock brand with the same salt. The family pays in US dollars with PayPal. The pharmacy then sees the paid order with the prescription photo and moves it through accepted, packed and out for delivery. The family gets a 4-digit code to share with their parents, and the pharmacy can only mark the order delivered when the right code is given at the door. If the pharmacy cannot supply the order, one click refunds the full amount through PayPal and the family sees the reason. The app also knows when the medicine will finish, so the family can order the same again in one click. All screens update by themselves, so nobody has to refresh.
- How we built it:-
The backend is Node.js with Express and PostgreSQL, and the screens are React with Vite. For PayPal I used the Orders API v2. The server creates the order, then captures it after the buyer approves in the PayPal popup (JS SDK). Before marking an order as paid, the server checks the amount, the currency and our order id against what PayPal returns, so the price can never come from the browser. Refunds use the Payments API. Everything runs in the PayPal sandbox. For the AI I used the Gemini API. The prescription photo goes to Gemini with a prompt that asks for clean JSON. The answer is cleaned up and matched to a list of 500 common Indian medicines using PostgreSQL fuzzy search (pg_trgm). I built this with Claude (Anthropic) as my coding partner. I came up with the idea and the flow, made the decisions, set up PayPal and Gemini, tested everything, and Claude helped me write and test the code. There are 34 automated tests for things like wrong payment amount, paying twice, wrong delivery code and refunds.
- Challenges we ran into:-
The PayPal popup first opened completely blank. It took a while to find out that my own security headers were blocking it. I fixed it with a CSP nonce for the PayPal script and by allowing the checkout popup. Then the payment kept failing with "Things don't appear to be working". The reason was that both my sandbox buyer and my business account were in India, and PayPal India does not allow India-to-India payments. With a US buyer it worked, which actually matches the real use case: a family abroad paying an Indian pharmacy. Gemini sometimes answered "high demand", and one older model was not available anymore. So the app now tries the next model automatically. The AI also returns things like "Tab. Crocin" or "5 days", so I clean that before matching. Small things also took time, like making the dollar total in the cart match the PayPal amount to the exact cent.
- Accomplishments that we're proud of:-
The full flow works with the real PayPal sandbox: photo, AI reading, cart, payment, pharmacy, delivery code, refund and refill. The same-salt switch can save families a lot of money, and the delivery code plus automatic refund make paying from far away feel safe.
- What we learned:-
I learned how PayPal's order, capture and refund flow works on the server side, and why you should never trust the amount from the browser. I also learned that AI output should not be used directly. It needs to be checked and matched to real data first. What's next for PI Family Care
- Live exchange rates:-
More pharmacies across India, with stock synced from their billing software A delivery partner app with live tracking WhatsApp reminders to parents in Gujarati and Hindi Letting the pharmacist confirm the AI's reading before packing
- About the video:-
The video is recorded from the running app. The PayPal payment in it is a real sandbox checkout that I did by hand. The narration is a Windows text-to-speech voice and the music was made for this video (no copyright).
- Links:-
Code (MIT): https://github.com/shefilvhora545-art/pi-family-care Demo video: https://youtu.be/edJ3FR9g_6s
Built With
- express.js
- google-gemini
- node.js
- paypal
- paypal-js-sdk
- paypal-orders-api
- postgresql
- react
- vite