Building a Modern Business Card Scanner with AI: A Deep Dive into AWS and DeepSeek Integration
Hey there, fellow developers! ๐ Today, I'm excited to share my journey of building a modern business card scanner application that leverages AI to transform physical business cards into organized digital contacts. This project combines AWS services with the DeepSeek API to create a powerful networking tool.
๐ฏ The Problem
In today's digital age, we still exchange physical business cards, but managing them efficiently is a challenge:
- Cards get lost or damaged
- Manual data entry is time-consuming and error-prone
- It's hard to analyze your professional network effectively
- Finding specific contacts or seeing connections between companies is difficult
There are existing digital business card scanning solution in the market, but they are often:
- expensive
- not user friendly
- only supports internal address book, no integration with device contacts
- data stored in the providers' database, you don't own the data
๐ก The Solution
I built a web application that solves these problems by:
- Using AI to extract information from business card images
- Organizing contacts with rich metadata
- Allows importing the contacts to your phone contacts in batch!
- self-deployable solution, meaning you own and control your data!
- Providing network analysis and visualization
- Offering an AI-powered chat interface for querying your contact database
๐๏ธ Technical Architecture
The application is built on a modern serverless stack:
Key Components:
-
Frontend:
- Single-page application hosted on S3
- Interactive network visualization using D3.js
- Real-time chat interface
- Responsive design with Tailwind CSS
-
Backend:
- AWS Lambda for serverless compute
- Amazon Textract for OCR
- DeepSeek API for intelligent data extraction
- DynamoDB for contact storage
- S3 for image storage
-
Authentication:
- AWS Cognito for user management
- Secure API access with IAM roles
๐ Key Features
1. Intelligent Card Scanning
def parse_with_deepseek(raw_text):
prompt = (
"Extract the following information from the provided business card text: "
"name, company, department, title, email, phone, address, website. "
"Additionally, categorize the company's industry..."
)
# DeepSeek API integration for smart data extraction
2. Network Analysis
function updateNetworkVisualization() {
// D3.js force-directed graph
const simulation = d3.forceSimulation(nodes)
.force("link", d3.forceLink(links).id(d => d.id))
.force("charge", d3.forceManyBody())
.force("center", d3.forceCenter(width / 2, height / 2));
3. AI-Powered Chat Interface
def handle_chat_message(event, cors_headers):
"""Handle chat messages using DeepSeek."""
# Process natural language queries about your contacts
# Generate insights and recommendations
๐ Getting Started
Want to try it yourself? Here's how:
- Clone the repository:
git clone <repository-url>
cd business-card-scanner
- Install dependencies:
cd application
pip install -r requirements.txt
- Configure AWS and DeepSeek:
Environment:
Variables:
DEEPSEEK_API_KEY: 'YOUR_API_KEY'
- Deploy:
./deploy.sh
๐จ User Experience
The application provides a seamless experience:
- Upload business card images (single or batch)
- AI automatically extracts and categorizes information
- View your contacts in a modern, filterable interface
- Explore network connections through interactive visualizations
- Chat with AI to analyze your professional network
- Easily export contacts as vcard files for your phone contacts
๐ฐ Cost Estimation
AWS: Total 12 months cost = 15.00 USD AWS Pricing Calculator
DeepSeek API: minimum spend = 10RMB = 1.38 USD (1USD = 7.24 RMB)
Total Annual Cost = AWS+DeepSeek key = 15+1.38=16.38= around 16.5 USD
main assumptions:
Number of API Requests 1000 API requests each day x 20 working days = 20000 API requests per month
Number of scan card requests: 1 card each day x 30 days = 30 requests
๐ฎ Future Enhancements
I'm planning to add:
- Maybe with https so that the can directly scan with device mobile
- Better UI/UX and improve latency with AI chatbot.
- The current serverless architecture is a "Lambdalith", which is great for quick development for PoC but does not scale well with more features coming in. So may need decouple this part in the future.
๐ค Key Learnings
Building this project taught me several valuable lessons:
- Serverless architectures need thoughtful timeout configurations
- User experience is crucial for AI-powered application
๐ Open Source
This project is open source! Feel free to:
- Star the repository
- Submit issues or feature requests
- Contribute improvements
- Fork and adapt for your needs
๐ Resources
๐ Connect
I'd love to hear your thoughts and suggestions! Connect with me:
- GitHub: [https://github.com/john-ng-hk]
- LinkedIn: [https://www.linkedin.com/in/john-nch-hk/]
Let me know in the comments if you'd like to see more detailed posts about specific aspects of this project!
Top comments (0)