How Commons is built.
A plain account of the parts, so you know what you would be running. Commons is free and open source (MIT).
The parts
- A Next.js web app, written in TypeScript. It works as a phone-first website.
- A Postgres database on Supabase. Database migrations build a fresh one when you deploy.
- Supabase sign-in, with a password or an emailed link, and Supabase storage for photos.
- Optional email through Resend.
- A daily job on Vercel that keeps the database awake and, if email is on, retries invitation emails and sends held message notices.
How a trip is kept
A trip is a set of records: people, a plan, polls, costs and photos. Each trip has its own members, and only members can read it. Money amounts are stored in minor units, such as cents, with their currency.
Commons records who owes whom. It does not send payments.
Messages with Commons
Each traveler gets a private thread with Commons in the app. A message that would change something, like a cost, waits for the traveler to confirm. Texting over SMS is an optional extra that you turn on with your own Twilio number.
Optional services
Email runs only if you add Resend; without it, people sign in with a password. AI help for writing polls runs only if you add an OpenAI key. Analytics runs only if you add a PostHog key. Texting runs only if you add Twilio credentials. With none of them, the rest works the same.
Reading and changing it
Everything is in one repository. A trip template describes the questions, polls and plan sections a new trip starts with, so you can add your own kind of group. The repository explains how.