StellarSplit provides a seamless experience for capturing physical receipts and turning them into digital splits. This document outlines the end-to-end journey of a receipt.
graph TD
A[Capture Image] --> B[Upload to Server]
B --> C[OCR Scanning]
C --> D{Confidence High?}
D -- Yes --> E[Auto-populate Draft]
D -- No --> F[Manual Review/Edit]
E --> G[Finalize Split]
F --> G
G --> H[Notify Participants]
- Frontend Component:
ReceiptCaptureFlow,CameraCapture, orReceiptUpload. - Action: User takes a photo or selects an image from their gallery.
- Backend Endpoint:
POST /api/receipts/uploadorPOST /api/receipts/split/:splitId/upload. - Storage: Images are processed in-memory for OCR. If a
splitIdis provided, they may be persisted to the configured storage provider (e.g., S3, local storage).
- Service:
ReceiptsServiceusingTesseract.js. - Logic:
- Image is preprocessed (grayscale, contrast enhancement).
- OCR extracts raw text.
ReceiptParseridentifies line items, quantities, prices, and totals.
- Output: A JSON object containing extracted items and a confidence score.
- Frontend Component:
ParsedItemEditor,ReceiptParserResults. - Action: The user reviews the extracted data. If the confidence score is low (highlighted in the UI), the user is prompted to verify and correct fields.
- Reconciliation: A
TotalReconciliationBannerensures that the sum of line items (plus tax/tip) matches the grand total on the receipt.
- Backend Endpoint:
POST /api/splits(withitemsandparticipantsfrom the OCR results). - Logic:
- The creator assigns items to specific participants.
- Tax and tip are distributed according to the selected
TipDistributionType(equal or proportional). - Final amounts are calculated for each participant.
backend/src/receipts: Handles storage and coordination.backend/src/ocr: Handles image processing and text extraction.
frontend/src/components/Receipt: UI for managing the receipt workflow.frontend/src/components/CameraCapture: Low-level camera interaction.
{
"items": [
{ "name": "Margherita Pizza", "quantity": 1, "price": 18.00 }
],
"subtotal": 18.00,
"tax": 1.50,
"tip": 3.00,
"total": 22.50,
"confidence": 0.92
}Tip
For better OCR results, ensure the receipt is flat, well-lit, and the text is not blurry.