SquidBills (2026)

A bill-splitting web app that splits each item among the members who shared it, with AI receipt scanning for Thai receipts.

SquidBills
Next.jsTypeScriptTailwind CSSExpressPrismaPostgreSQLSupabaseGeminiOpenCV.jsLLMDockerGitHub ActionsMicrosoft Azure
✦

My responsibility

UX/UI Design

Designed the user flow and all screens, from bill creation to the summary and payment slip, with a mobile-first layout. Also designed the mascot, น้องหมึก, used across the interface.

UX/UI DesignMascot Design

Full-stack Development

Built the Next.js frontend and an Express + TypeScript API in a pnpm monorepo, with Prisma on PostgreSQL (Supabase) for bills, members, items and sharing permissions.

Next.jsTypeScriptTailwind CSSExpressPrismaPostgreSQLSupabase

AI & Computer Vision

Built the receipt scanner: edge detection and auto-capture on the client with OpenCV.js, and Thai receipt extraction with Gemini 2.5 Flash on the server.

OpenCV.jsWeb WorkerGeminiLLM

DevOps

Containerized both apps with Docker and set up GitHub Actions to build, test and deploy to Azure Container Apps on every tagged release.

DockerGitHub ActionsMicrosoft Azure

Splitting a bill in 4 steps

The project started from a common problem when eating out in a group: not everyone orders the same items, so an even split is often inaccurate. The app splits each item among the members who shared it. The flow has four steps.

01 / 04

Create a bill

A bill can be created from a receipt photo or entered manually. When a receipt is used, the shop name, branch, items, prices and VAT / service charge settings are pre-filled and can be edited before saving. Members can be added one by one or as a comma-separated list.

Receipt scanning pipeline

Entering every item by hand was the slowest part of the flow. The scanner is split into two stages: image processing on the client, then text extraction on the server.

  1. 01 · On device

    Find the receipt

    OpenCV.js runs in a Web Worker on every camera frame: blur, Canny edge detection, then the largest four-cornered contour becomes the receipt outline.

  2. 02 · On device

    Auto-capture

    When the outline is detected for 30 consecutive frames, the frame is captured automatically.

  3. 03 · On device

    Flatten it

    A perspective transform crops and straightens the receipt into a top-down image before it is sent to the server.

  4. 04 · Server

    Read it with AI

    The Express backend sends the image to Gemini 2.5 Flash and receives structured JSON: shop, branch, items, prices, VAT and service charge.

Prompt design for Thai receipts

Thai receipts are usually printed in small fonts on thermal paper, and tone marks or vowels are often misread. The prompt sets the following rules:

  • Correct misspelled Thai menu names, e.g. ยา → ยำ, ก้ง → กุ้ง, ตะไค้ → ตะไคร้
  • Use only the prices printed on the receipt, without estimating
  • Extract the shop name and branch
  • Return JSON only, using the response MIME type application/json

Since the output can still contain errors, results are shown on a review screen next to the receipt image, where items can be edited or removed and the payer selected before importing.

Guest and signed-in modes

The app supports two modes. Guest mode keeps data on the device, while signed-in users store bills in the database and can share them with others.

Guest mode

Local storage

  • Bills are stored in the browser with IndexedDB
  • The service layer switches between IndexedDB and the API, so both modes share the same screens
  • No account is required to create or split a bill

Signed in

Database storage

  • Local drafts can be migrated to the account with "Save to account"
  • Authentication with email or Google via Supabase Auth
  • Bills can be shared with other users as Editor or Viewer

Sharing

Bill sharing and permissions

A bill owner can grant access to other users by email or username with an Editor or Viewer role. The role is checked on the server for each request, so Viewers have read-only access.

Deployment: shipped like a real product

Frontend, backend and shared types live in one pnpm monorepo. Each app has its own Docker image and its own release line, so a frontend fix never forces a backend redeploy.

  1. 01

    Push / PR

    Lint, test and build

  2. 02

    Git tag

    back-v1.2.0 / front-v1.2.0

  3. 03

    Azure Container Registry

    Docker image per version

  4. 04

    Azure Container Apps

    New revision takes traffic

Versioned releases

Pushing to main only runs checks. A semantic version tag is what ships to production, and the image is tagged with both the version and the commit.

One-click rollback

Every release becomes its own Container Apps revision, so going back means switching traffic to the previous one.

Safe by default

Sessions are verified with Supabase Auth, every bill route checks the user's role, and the API is rate limited to keep shared bills private.