The cleanest way to track shared expenses with your roommates.
Split bills, settle debts, and live in peace — with full Nepali Rupee (NPR) & Bikram Sambat (BS) support.
| Feature | Description |
|---|---|
| 🔐 Authentication | Email/password & Google OAuth via Supabase Auth |
| 🏘️ Multiple Rooms | Create or join multiple rooms — manage different groups of friends |
| 💸 Expense Splitting | Add shared or personal expenses, split equally among members |
| ⚖️ Balance Tracking | Automatically calculates who owes whom |
| ✅ Settle Up | Mark debts as paid with one click |
| 🇳🇵 NPR / BS Support | Display amounts in Nepali Rupees and dates in Bikram Sambat — switchable per session |
| 📋 Activity Logs | Full history of all expenses and settlements |
| 🔗 Invite Codes | Share a unique code to invite roommates to your room |
| ⚡ Real-time | Supabase Realtime enabled for expenses and settlements |
- Framework: Next.js 16 (App Router, Server Actions)
- Backend / Database: Supabase (PostgreSQL + Auth + Realtime)
- Styling: Tailwind CSS v4 + shadcn/ui
- Language: TypeScript
- Nepali Date:
@sbmdkl/nepali-date-converter
git clone https://github.com/Susant07-star/Shared_Expense_System.git
cd Shared_Expense_System/roommate-expense-appnpm installCreate a .env.local file in the project root:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_keyYou can find these in your Supabase project under Settings → API.
Copy the SQL from supabase_schema.sql and run it in your Supabase project's SQL Editor.
This sets up:
- All tables (
users,rooms,room_members,expenses,expense_splits,settlements,activity_logs) - Row Level Security (RLS) policies
- Triggers for auto-creating user profiles
- RPC functions for invite code lookup
- Realtime publication
In your Supabase dashboard → Authentication → Providers → Google, enable Google and add your OAuth credentials. Set the callback URL to:
https://your-project.supabase.co/auth/v1/callback
npm run devOpen http://localhost:3000 in your browser.
Run the checks from the app directory before deploying:
npm run lint
npm run buildThe app uses local system font fallbacks rather than fetching fonts from Google during a build. This keeps builds reproducible and avoids delaying the first render when external font requests are unavailable.
src/
├── app/
│ ├── (auth)/ # Login & Signup pages + server actions
│ │ ├── login/
│ │ └── signup/
│ ├── auth/callback/ # OAuth callback handler
│ └── dashboard/ # Protected dashboard pages
│ ├── activity/ # Activity log
│ ├── expenses/ # Full expense history
│ ├── members/ # Room members list
│ └── settings/ # Room settings
├── components/
│ ├── dashboard-view.tsx # Main dashboard UI (client component)
│ └── shared/
│ └── dashboard-nav.tsx # Sidebar with room switcher
└── lib/
├── balances.ts # Balance calculation logic
├── nepali.ts # NPR/BS date & currency formatting
└── supabase/ # Supabase client helpers
auth.users (Supabase)
│
▼
public.users ──────────── public.room_members ──── public.rooms
│
┌────────────┴────────────┐
▼ ▼
public.expenses public.settlements
│
▼
public.expense_splits
public.activity_logs (linked to rooms + users)
This app supports Nepali Rupees (NPR) and Bikram Sambat (BS) dates as the primary display format.
- All amounts are stored internally in USD and converted on display
- All dates are stored in UTC and converted to BS using
@sbmdkl/nepali-date-converter— no hardcoded calendar tables - Users can switch between NPR/BS and USD/AD via the currency dropdown in the dashboard
- All database tables have Row Level Security (RLS) enabled
- Users can only read/write data for rooms they are members of
.env.localis excluded from version control via.gitignore- Auth tokens are managed securely via Supabase SSR cookies
This project is open source under the MIT License.