Skip to content

Open source · GitHub · Self-host

Split expenses with friends, without a spreadsheet

Bill Splitting App is an open-source Pericodes project for shared groups: log who paid what and see who owes whom. Use this instance, or clone it and deploy it on your own Vercel or Netlify account.

Free to use, audit, and contribute. No paid plan and no app stores.

What it does

Built for trips, shared flats, dinners, and any group that wants to settle up without friction.

  • Shared accounts

    Create a group with a name, icon, and currency (EUR, USD, or GBP). Each account has its own expense history and members.

  • Flexible expenses

    One payer or several. Equal shares or custom amounts. The app checks that paid and assigned amounts match the total.

  • Automatic balances

    See who owes whom and how to settle with as few transfers as possible. Balances update when you add or delete an expense.

  • Invite with a link or QR

    Share an invite link or QR code. Anyone who opens it can join the group without you collecting emails by hand.

  • Placeholder participants

    Add someone by name so they can be included in an expense. They can join later with the invite link.

  • Guest or registered account

    Start with a display name (local profile) or sign up with email. If you register later, you keep the groups from this browser.

  • English and Spanish

    The UI ships in both languages. Pick one in Profile; this landing page also has a Spanish version.

  • You own the code

    Next.js, TypeScript, Neon Postgres, and Auth. No opaque backend: you can read, audit, and deploy the same code we run.

Open source: use it, clone it, improve it

The code lives on GitHub. Issues, pull requests, and forks are welcome: translations, bugs, design, or new split modes. It is a Pericodes project, published so anyone can self-host it.

github.com/pericodes/bill-splitting-app

How to contribute

Fork the repo, create a branch, and open a pull request against main. For a large change, open an issue first.

  1. 1. Fork on GitHub

    Use the Fork button on the repository page to copy it to your account.

  2. 2. Clone your fork

    git clone https://github.com/YOUR_USER/bill-splitting-app.git
    cd bill-splitting-app
    git remote add upstream https://github.com/pericodes/bill-splitting-app.git
  3. 3. Branch and open a pull request

    git checkout -b feat/my-change
    git push -u origin feat/my-change

What you need to deploy it

Free-tier accounts are enough for a personal instance or a small group.

  • Node.js 20 or newer

    Next.js 15 needs Node 18.18+; we recommend the 20 LTS. Check with node -v.

  • Git and pnpm

    The repo ships a pnpm-lock.yaml. Install pnpm with npm install -g pnpm if needed.

  • A Neon project

    Serverless Postgres, Data API, and Neon Auth. In production the app does not open a Postgres TCP connection; it talks to the Data API.

  • Vercel or Netlify

    Either host can run a Next.js App Router project. Vercel is the most direct fit.

Deploy, command by command

Apply the schema on Neon from your machine first, then ship the frontend to Vercel or Netlify. Every block is copyable.

1. Create the Neon project

This is done in the browser, in the Neon console (neon.tech). No CLI is required for this step.

  1. Create an account and a Postgres project (pick a region close to your users).
  2. In the project, enable Data API and copy the URL (it ends with /rest/v1).
  3. Enable Neon Auth and copy the URL (it ends with /auth). Turn on anonymous tokens: the app uses them for the Data API.
  4. Copy the DIRECT connection string (host without -pooler). You will use it only locally as DEV_DATABASE_URL.
  5. Once you have the Vercel or Netlify URL, add it in Neon Auth as an allowed origin (otherwise sign-in returns Invalid Origin).

2. Environment variables

Copy .env.example to .env and fill in the Neon values. On Vercel/Netlify you will set the same NEXT_PUBLIC_* keys and APP_URL (DEV_DATABASE_URL is not needed on the host).

# Public URL of your deploy (Vercel, Netlify, or local)
APP_URL="https://your-domain.vercel.app"

# Neon Data API (Neon console → Data API)
NEXT_PUBLIC_NEON_DATA_API_URL="https://ep-xxxx.apirest.region.aws.neon.tech/neondb/rest/v1"

# Neon Auth (Neon console → Auth)
NEXT_PUBLIC_NEON_AUTH_URL="https://ep-xxxx.neonauth.region.aws.neon.tech/neondb/auth"

# Local machine only, to apply the schema. DIRECT connection string (no -pooler).
# Not needed on Vercel/Netlify: production talks to Data API.
DEV_DATABASE_URL="postgresql://USER:PASSWORD@ep-xxxx.region.aws.neon.tech/neondb?sslmode=require"

3. Clone and install

In a terminal, in the folder where you want the code:

  1. 1. Clone the repository

    git clone https://github.com/pericodes/bill-splitting-app.git
  2. 2. Enter the project

    cd bill-splitting-app
  3. 3. Install pnpm if you do not have it

    npm install -g pnpm
  4. 4. Install dependencies

    pnpm install
  5. 5. Create the env file

    cp .env.example .env
    # Windows PowerShell:
    Copy-Item .env.example .env

4. Create tables and grants

From your computer, with DEV_DATABASE_URL pointing at Neon (NODE_ENV must not be production). This script applies Prisma migrations, generated columns, and GRANTs for the Data API anonymous and authenticated roles. Enable Data API in Neon before running it.

pnpm db:dev:setup

5. Try it locally (optional)

With .env filled in, start the dev server and open http://localhost:3000

pnpm dev

Deploy on Vercel (CLI)

With a Vercel account and the repo already cloned. You can also import the repo at vercel.com/new; here are the commands.

  1. 1. Log in to Vercel

    npx vercel login
  2. 2. Link the project (from the repo root)

    Accept the defaults: Next.js framework, project root, pnpm build. You will get a preview URL.

    npx vercel
  3. 3. Add production environment variables

    Paste the Neon URLs. For APP_URL use the final URL (for example https://your-app.vercel.app).

    npx vercel env add NEXT_PUBLIC_NEON_AUTH_URL production
    npx vercel env add NEXT_PUBLIC_NEON_DATA_API_URL production
    npx vercel env add APP_URL production
  4. 4. Deploy to production

    npx vercel --prod
  5. 5. Allow the origin in Neon

    In the Neon Auth console, add https://your-app.vercel.app. Redeploy if you changed APP_URL.

Deploy on Netlify (CLI)

Netlify detects Next.js (App Router). The build command is pnpm build; do not publish the .next folder by hand.

  1. 1. Log in to Netlify

    npx netlify-cli login
  2. 2. Initialize the site in this repo

    Create a new site, pick the team, and set build command: pnpm build. Let Netlify use the Next.js runtime.

    npx netlify init
  3. 3. Environment variables

    npx netlify env:set NEXT_PUBLIC_NEON_AUTH_URL "https://ep-xxxx.neonauth.region.aws.neon.tech/neondb/auth"
    npx netlify env:set NEXT_PUBLIC_NEON_DATA_API_URL "https://ep-xxxx.apirest.region.aws.neon.tech/neondb/rest/v1"
    npx netlify env:set APP_URL "https://your-site.netlify.app"
  4. 4. Production deploy

    npx netlify deploy --build --prod
  5. 5. Allow the origin in Neon

    Add https://your-site.netlify.app in Neon Auth as an allowed origin, same as on Vercel.

After you deploy. Copy the HTTPS URL Vercel or Netlify gives you. Put it in APP_URL, redeploy if needed, and add it in Neon Auth → allowed origins. Without that origin, sign-up and sign-in fail.

FAQ

Is it open source?

Yes. The public repository is https://github.com/pericodes/bill-splitting-app. You can clone it, fork it, and open pull requests.

Do I need an account to use it?

No. You can continue as a guest with a name. That profile stays in the browser. If you register later, you keep your groups.

What do I need to self-host?

A Neon project (Postgres + Data API + Auth) and a Next.js host: Vercel or Netlify. Free tiers cover personal use.

Why is Prisma development-only?

In production the app does not open a TCP connection to Postgres; it uses Neon Data API. Prisma and DEV_DATABASE_URL are for applying the schema from your machine.

Vercel or Netlify?

Both work. Vercel is the native Next.js environment and is usually the shortest path. Netlify works with its Next.js runtime and the same env vars.