Production-ready Node.js + Express app that generates:
- a shareable SVG visiting card image
- a downloadable vCard (.vcf) contact file
- QR code links back to the hosted public card page
- Mobile-first form on
/with required fields:- First name
- Last name
- Designation
POST /create- validates inputs
- creates unique card ID
- stores card in memory
- returns immediate downloadable SVG card image
- Public card page:
/card/:id- full name
- designation
- card ID
- QR image
- Download Card Image button
- Download vCard button
- QR endpoint:
/card/:id/qr.png - Card image endpoint:
/card/:id/download - vCard endpoint:
/card/:id/contact.vcf - Friendly 404 pages for invalid card IDs and unknown routes
- Basic tests for form validation and route behavior
- Node.js (18+)
- Express
- qrcode
- supertest + node:test
-
Install dependencies:
npm install
-
Start the app:
npm start
-
Open:
http://localhost:3000 -
Run tests:
npm test
- Push this repository to GitHub.
- In Render, create a Blueprint deployment (or Web Service) from this repository.
- Render reads
render.yaml:env: nodebuildCommand: npm installstartCommand: npm start
- Click Manual Deploy → Deploy latest commit after every new push.
After deployment, verify these paths from your Render domain:
/should show the form.- submit form and confirm response downloads
.svg. - open
/card/:idand verify both buttons:Download Card Image→.svgDownload vCard→.vcf
/card/:id/contact.vcfshould return vCard text beginning withBEGIN:VCARD.
Most common reasons:
- latest commit is not pushed to GitHub
- Render service is connected to a different branch
- deploy did not run after merge
- browser cache (hard refresh needed)
This app currently stores cards in in-memory storage (Map).
- Server restarts/redeploys will clear all cards.
- Old
/card/:idlinks will return 404 after restart.
For permanent storage, switch to SQLite/Postgres.
To avoid recurring conflicts in server.js and public/styles.css:
-
Always pull/rebase before starting:
git checkout work git pull --rebase origin work
-
Keep these files as single-source-of-truth (avoid parallel edits in multiple branches).
-
Before push, run:
npm test -
If conflict appears, prefer current canonical versions of:
server.jspublic/styles.css