Introduction
Typing all those paper business cards you pile up at trade shows into a CRM by hand is a real chore. So at work, I built a feature where "you upload a PDF (or images) stuffed with business cards, and it automatically bulk-registers the company and contact data."
At first I thought, "Just throw it at OCR and we're done." But once I actually tried it, I realized that OCR isn't as all-powerful as you'd think , and that the design decision of where to split the processing is the real key. In this post I'll share those key points, plus the problem I agonized over the most: "What do we do when a single page has multiple business cards lined up on it?"
The Overall Flow
Upload a file (PDF / JPEG / PNG)
Validate on the server side (format, size, page count)
Create an "importing" history record and return a response right away
Run the heavy work (OCR → structuring → create/update) in a background job
The frontend polls the history ID and shows progress
The point is to cleanly separate "accepting"…