Skip to content
NoyaAdiviPublic

About

Split any bill, end up even: receipt scanning, per dish, group links, trips. Node.js + Docker + CI/CD

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Evenly: split any bill, end up even

לגרסה בעברית

Open live demo See the pipeline Health check

CI Deploy License Last commit

Split any bill. End up even.

Evenly splits any bill between friends, exactly to the last agora: scan a restaurant receipt, split per dish or just the drinks,
send a group link where everyone taps their own items, split hotel nights or a whole trip.
Under the hood, every push is tested, containerized and deployed to the cloud automatically.

🐳 Docker
multi-stage, non-root
✅ 2 × Node
tests on 20 and 22
📦 GHCR
image tagged per commit
☁️ Auto deploy
to Railway after CI

Evenly: split any bill, end up even

Evenly home page on the live site

What is Evenly

🐳 Containerized

✅ Tested on every push

  • Unit and API tests with Node's built-in runner
  • Matrix on Node 20 and 22, with coverage
  • Smoke test against the real running container
  • A failed test stops the deploy

☁️ Deploys itself

  • Image pushed to GHCR, tagged latest and per commit
  • Railway deploy triggered only after CI passes
  • Verifies the release: waits until /health shows the new commit
  • Pastel web UI to try it in the browser

🛡️ Protected API

  • Rate limit: 300 POST requests a minute per user, then 429 with Retry-After
  • Security headers on every response (nosniff, frame and referrer policies)
  • Tested like everything else

⚡ Fast and installable

  • Smart caching: files cached for an hour, the page always fresh
  • Service worker opens offline and updates itself
  • Install it on your phone like an app

💜 Friendly to use

  • Undo for any person, dish or expense you remove
  • ₪ $ € £ shown everywhere you type an amount
  • Mobile first, Hebrew and English, light and dark
  • ✨ Playful motion: sections float in as you scroll, cards tilt and glow under the mouse, buttons ripple and the main ones burst with pastel sparkles . On top of that fun.js makes the total shine when it changes, the main buttons magnetic and the hero drift with a soft parallax (all off with reduced motion)

The pipeline

flowchart LR
  A([💻 git push]) --> B{🧪 Tests<br/>Node 20 + 22}
  B -->|pass| C([🐳 Docker build<br/>+ smoke test])
  B -->|fail| X([❌ Stop, nothing deploys])
  C -->|main only| D([📦 Push image to GHCR])
  D --> E([☁️ Deploy to Railway])
  E --> F([❤️ /health reports<br/>the new commit])
  style A fill:#FFE6DE,stroke:#E36E57,color:#2C2668
  style B fill:#E8E4FF,stroke:#6F60F0,color:#2C2668
  style C fill:#D9F3E7,stroke:#1F7350,color:#1F4D38
  style X fill:#FBD5E0,stroke:#A03A5C,color:#5C1F33
  style D fill:#DAD5FF,stroke:#5548C8,color:#2C2668
  style E fill:#FFF1C9,stroke:#B98A1E,color:#5C4410
  style F fill:#D9F3E7,stroke:#1F7350,color:#1F4D38
Loading

Workflows: ci.yml · deploy.yml

Tech stack

App
Node.js 22 Express

Container
Docker Alpine Linux GHCR

CI / CD
GitHub Actions node:test

Cloud
Railway

API

Method Path What it does
GET / Pastel web UI with 10 ways to split: receipt scan, per dish, food & drinks, group link, equally, percent, shares, exact amounts, hotel nights, trip expenses
GET /health Status, version, commit SHA, uptime
POST /api/split Split a bill: equal, nights (hotel), items (per dish), percent, shares, exact or pools (food, drinks, taxi... each split only between its people), with optional tipPercent, treat (birthday: others pay for them) and roundTo (round shares up, no coins)
POST /api/settle Settle trip expenses with several payers in the fewest transfers (who pays whom)
POST /api/receipt/parse Turn scanned receipt text (Hebrew or English) into dishes with categories, total and service charge
POST /api/rooms Open a group link (kept in memory for 24 hours)
GET /api/rooms/:id Live room: items, who claimed what, totals
POST /api/rooms/:id/claim A friend taps an item as theirs (/join adds a name)

Every POST /api/* is limited to 300 requests a minute per user. Past that the API answers 429 with a Retry-After header.

curl -X POST https://evenly-app.up.railway.app/api/split \
  -H "content-type: application/json" \
  -d '{"total":1200,"mode":"nights","guests":[{"name":"Noya","nights":3},{"name":"Dana","nights":1}]}'
{ "currency": "ILS", "mode": "nights", "total": 1200,
  "shares": [ { "name": "Noya", "amount": 900 }, { "name": "Dana", "amount": 300 } ] }

Run it locally

With Docker:

docker compose up --build
# open http://localhost:3000

With Node 20+:

npm install
npm test
npm start

Deploy setup

  1. On Railway create a project from this GitHub repo. It builds the Dockerfile on its own.
  2. In the service Settings: Networking → Generate Domain, Deploy → Healthcheck Path /health, Source → turn on Wait for CI so it deploys only after the tests pass.
  3. Add your Railway address as the variable APP_URL in Settings → Variables → Actions, so the pipeline waits until the new version is live.

Tip

Railway services don't sleep, so group links stay alive for the whole dinner.

📂 Project structure
├── .github/workflows/
│   ├── ci.yml          tests on Node 20 + 22, Docker build, smoke test
│   └── deploy.yml      push image to GHCR, Railway deploys after CI, wait for /health
├── src/
│   ├── split.js        the splitting logic (exact to the agora)
│   ├── receipt.js      reads scanned receipt text into dishes
│   ├── settle.js       trip expenses in the fewest transfers
│   ├── rooms.js        live group links (24 hours in memory)
│   ├── app.js          Express app, routes, rate limit, security headers
│   └── server.js       entry point with graceful shutdown
├── public/             pastel web UI, installable (sw.js + manifest)
├── test/               unit + API tests (node:test)
├── docs/               README art and social images
├── Dockerfile          multi-stage, non-root, HEALTHCHECK
└── docker-compose.yml

Built by Noya Adivi

demo LinkedIn Portfolio More projects

About

Split any bill, end up even: receipt scanning, per dish, group links, trips. Node.js + Docker + CI/CD

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages