How jeypraveen/photoscore-engine works
PhotoScore is a multilingual product-photo quality checker exposed through a WhatsApp bot and a direct analysis API. The principal workflow accepts a product image, checks usage eligibility, retrieves and decodes the image, computes quality and marketplace-compliance scores, and returns a localized report. The WhatsApp route also supports language and marketplace preferences; payment webhooks activate paid plans, while admin statistics read usage data. The README contains only the product name, so capability details and relationships here rely on the supplied source excerpts; some implementation is unsampled.
Main entry points: main.py FastAPI routes · cv_engine.py Photo analysis · whatsapp.py WhatsApp integration · database.py Supabase database
Components 21
Entry and messaging
- FastAPI routes
app/main.py - WhatsApp integration
app/whatsapp.py
Photo analysis
- Image decoding
app/cv_engine.py - Photo analysis
app/cv_engine.py - Background check
app/cv_engine.py - Product framing
app/cv_engine.py - Sharpness check
app/cv_engine.py - Lighting check
app/cv_engine.py - Text detection
app/cv_engine.py - Marketplace compliance
app/cv_engine.py
Accounts and billing
- Supabase database
app/database.py - User preferences
app/database.py - Usage and limits
app/database.py - Paid plan activation
app/main.py
Localization
- Language messages
app/languages.py - Score report formatting
app/languages.py
Other components
- Photo seller
- API client
- Admin
- WhatsApp Cloud API
- Razorpay
Connections 30
- Photo seller → WhatsApp Cloud API: sends photo
- WhatsApp Cloud API → FastAPI routes: delivers webhook
- FastAPI routes → WhatsApp integration: extracts message
- FastAPI routes → User preferences: loads or updates
- FastAPI routes → Usage and limits: checks eligibility
- FastAPI routes → WhatsApp integration: downloads media
- WhatsApp integration → WhatsApp Cloud API: fetches media
- FastAPI routes → Image decoding: decodes image
- Image decoding → Photo analysis: provides image
- FastAPI routes → Photo analysis: analyzes API image
- Photo analysis → Background check: runs check
- Photo analysis → Product framing: runs check
- Photo analysis → Sharpness check: runs check
- Photo analysis → Lighting check: runs check
- Photo analysis → Text detection: runs check
- Photo analysis → Marketplace compliance: checks compliance
- FastAPI routes → Usage and limits: records usage
- FastAPI routes → Score report formatting: formats result
- Score report formatting → Language messages: gets messages
- FastAPI routes → WhatsApp integration: sends reply
- WhatsApp integration → WhatsApp Cloud API: sends message
- FastAPI routes → Paid plan activation: handles payment event
- Razorpay → FastAPI routes: posts payment webhook
- Paid plan activation → User preferences: activates plan
- FastAPI routes → Supabase database: requests account and usage data
- User preferences → Supabase database: reads and writes users
- Usage and limits → Supabase database: reads and writes usage
- API client → FastAPI routes: uploads image
- Admin → FastAPI routes: requests statistics
- FastAPI routes → Supabase database: reads statistics