Skip to content
tofanforgePublic

About

Splitwise-style expense sharing: ASP.NET Core API, Ionic Angular web/mobile/desktop apps, real-time updates

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

SplitMate

A Splitwise-style app for sharing expenses with friends and groups, with live updates across devices.

  • Backend: ASP.NET Core 10 Web API · EF Core + SQL Server · ASP.NET Core Identity · JWT + rotating refresh tokens · SignalR
  • Frontend: Ionic 9 + Angular 22 (standalone, signals) — works as a mobile-friendly web app; can be packaged for Android/iOS with Capacitor
  • Hosting (all free): Render (API, Docker) · Azure SQL Database free offer · Netlify (web) · Brevo SMTP (email, optional) · Google sign-in (optional)

Features

Area What works
Accounts Sign up / log in, Google sign-in, forgot & reset password by email, change password, profile + default currency, logout everywhere on password reset, login lockout and rate limiting
Friends Add by email (people without an account get an invite and a placeholder that they claim when they sign up), balances per friend with per-group breakdown, settle up, settle all, reminders, remove friend (only when settled)
Groups Create (Home / Trip / Couple / Other), default currency, add/remove members, join by invite link, leave (only when settled), delete, simplify debts on/off, balances, suggested payments, totals, CSV export
Expenses Split equally, by exact amounts, percentages, shares or +/- adjustments; one or multiple payers; group or non-group; categories; notes; date; repeating expenses (daily → yearly); edit; delete & restore; comments
Payments Record settle-up payments between any two group members, or with a friend
Activity Feed of everything that affects you with "you owe / you get back" impact, unread badge, toasts
Real time Every change is pushed over SignalR (WebSockets) to all affected users; open screens refresh automatically
Money Per-currency balances (no conversion, like Splitwise free), exact cent rounding (largest-remainder)

Project layout

src/
  SplitMate.Domain/          Entities, split calculator, balance/debt-simplification engine (pure, unit tested)
  SplitMate.Application/     DTOs, service interfaces, options, exceptions
  SplitMate.Infrastructure/  EF Core DbContext + migrations, Identity, services, SMTP, recurring-expense worker
  SplitMate.API/             Controllers, JWT auth, SignalR hub, rate limiting, error handling
tests/SplitMate.UnitTests/   Split and balance tests
client/                      Ionic Angular app
Dockerfile, render.yaml      API deployment (Render)
client/netlify.toml          Web deployment (Netlify)

Run locally

Prerequisites: .NET 10 SDK, Node 24+, SQL Server Express (connection string in src/SplitMate.API/appsettings.Development.json).

dotnet run --project src/SplitMate.API --launch-profile http     # API on http://localhost:5271 (Swagger at /swagger), migrates the DB on start
cd client; npm install; npm start                                  # web app on http://localhost:4200

Run the tests:

dotnet test

Without SMTP configured, emails (invites, password reset links) are written to the API log instead of being sent.

Deploy for free

1. Database — Azure SQL Database (free offer)

  1. In the Azure portal create an Azure SQL Database and choose "Apply free offer" (100,000 vCore-seconds + 32 GB per month, serverless; set it to auto-pause when the free limit is reached so you're never charged).
  2. Under the server's Networking, allow Azure services and resources to access this server and add a firewall rule allowing Render's outbound IPs (or 0.0.0.0–255.255.255.255 if you accept that risk; the DB still requires a password).
  3. Copy the ADO.NET connection string (SQL authentication).

2. API — Render

  1. Push this repo to GitHub.
  2. In Render: New → Blueprint, pick the repo; it reads render.yaml.
  3. Fill in the prompted values:
    • ConnectionStrings__DefaultConnection — the Azure SQL string (add Connection Timeout=60; — the free DB pauses when idle).
    • App__ClientUrl and App__AllowedOrigins__0 — your Netlify URL (e.g. https://splitmate.netlify.app).
    • Optional email (Brevo free plan, 300 emails/day): Email__Host=smtp-relay.brevo.com, Email__UserName, Email__Password (SMTP key), Email__FromEmail (a verified sender).
    • Optional Google sign-in: GoogleAuth__ClientId (Google Cloud console → OAuth client ID → Web; add your Netlify URL as an authorized JavaScript origin).
  4. Jwt__Key is generated automatically. Migrations run on startup.
  5. Render's own auto-deploy is off (autoDeploy: false); the CI/CD pipeline deploys only commits that passed the tests. Copy the service's Settings → Deploy Hook URL for the RENDER_DEPLOY_HOOK_URL secret (see CI/CD), or click Manual Deploy yourself.

Free Render services sleep after ~15 minutes without traffic; the first request after that takes up to a minute. The app retries and reconnects automatically.

3. Web app — Netlify

With the CI/CD pipeline (recommended), GitHub Actions builds the site and uploads it to Netlify:

  1. In Netlify: Add new site → Deploy manually and drop any folder (it's replaced by the first CI deploy). Rename the site if you like (e.g. splitmate → https://splitmate.netlify.app).
  2. Copy Site configuration → Site ID for the NETLIFY_SITE_ID secret, and create a token under User settings → Applications → Personal access tokens for NETLIFY_AUTH_TOKEN.
  3. Make sure the Netlify URL is in the API's App__AllowedOrigins__0 and App__ClientUrl.

Without CI/CD you can instead Import from Git with base directory client and an API_URL environment variable; client/netlify.toml holds the build settings.

CI/CD

.github/workflows/ci-cd.yml runs on every pull request and every push to master:

pull request ─► API build + tests ─┐
                Web build ─────────┼─► (push to master only) Deploy API ─► Deploy web ─► Smoke test
                Docker build + run ┘     Render deploy hook,    Netlify API     /health, SPA route,
                                         waits for new commit    upload          env.js, headers
  • CI compiles the API in Release mode, runs the unit tests (results uploaded as an artifact), builds the web app, and builds the API Docker image and starts it to check /health.
  • CD happens only on master and only when every CI job is green. The API deploys first and the job waits until the API's root URL reports the new commit (version), then the exact web bundle CI built is published to Netlify, then a smoke test checks production.
  • Concurrent pushes queue up; a production deploy is never cancelled half-way. Superseded PR runs are cancelled.
  • Dependabot (.github/dependabot.yml) opens weekly grouped update PRs, which go through the same checks.
  • Tags v* build the Android/iOS/Windows/macOS apps and attach them to a GitHub Release (apps.yml).

One-time setup in GitHub → Settings → Secrets and variables → Actions:

Kind Name Value
Variable API_URL Render URL, e.g. https://splitmate-api.onrender.com
Variable WEB_URL Netlify URL, e.g. https://splitmate.netlify.app
Secret RENDER_DEPLOY_HOOK_URL Render service → Settings → Deploy Hook
Secret NETLIFY_AUTH_TOKEN Netlify personal access token
Secret NETLIFY_SITE_ID Netlify site ID

Until the secrets exist, the deploy jobs are skipped with a notice and the pipeline stays green. Recommended: protect master (Settings → Branches → Add rule) and require the API build & tests, Web build and Docker image & smoke test checks, so nothing reaches production without passing.

To release the apps: git tag v1.0.0; git push origin v1.0.0.

Apps for every platform

One codebase (client/) ships everywhere. Every version talks to the same API, so changes show up live on all devices.

Platform How it's packaged Where to build it
Any browser Web app on Netlify anywhere
Windows, macOS, Android, iOS, ChromeOS Installable web app (PWA): open the site, then Install app (Chrome/Edge) or Share → Add to Home Screen (iPhone Safari) nothing to build
Windows Electron installer + portable .exe (client/electron) Windows PC or GitHub Actions
macOS Electron .dmg (Intel + Apple Silicon) Mac or GitHub Actions
Android Capacitor app (client/android) → .apk Android Studio or GitHub Actions
iOS / iPadOS Capacitor app (client/ios) Mac with Xcode (signing needs an Apple account)

All app builds need the URL of your deployed API (and optionally the web URL for invite links):

$env:API_URL = "https://splitmate-api.onrender.com"; $env:WEB_URL = "https://splitmate.netlify.app"

Windows desktop (from client/): npm run build:desktop, then cd electron; npm install; npm run dist:win → electron/release/SplitMate Setup 1.0.0.exe. Use npm run desktop to run it without packaging.

macOS desktop (on a Mac): same as above with npm run dist:mac → .dmg. The build is unsigned, so the first time, right-click the app and choose Open.

Android: install Android Studio, then npm run build:mobile and npm run android and press ▶ to run on a phone or emulator. To get an installable .apk use Build → Build APK(s). Publishing to Google Play needs a one-time $25 developer account.

iOS: on a Mac with Xcode, npm run build:mobile and npm run ios. With a free Apple ID you can install on your own iPhone (it must be re-installed every 7 days). Distributing through TestFlight or the App Store needs the paid Apple Developer Program ($99/year). The no-cost way to put SplitMate on iPhones is the PWA (Add to Home Screen).

Build everything in the cloud (free): push the repo to GitHub, set repository variables API_URL and WEB_URL, and run the Build apps workflow (.github/workflows/apps.yml) from the Actions tab. It produces the Android APK, Windows installer, macOS DMG and an iOS simulator build as downloadable artifacts. Pushing a tag like v1.0.0 also attaches them to a GitHub Release.

Notes:

  • Packaged apps need the API on HTTPS (Android blocks plain HTTP). Use the Render URL, not localhost.
  • "Continue with Google" is only offered in the browser/PWA version, because Google blocks its sign-in inside embedded app windows. The apps use email and password.
  • To change the logo, edit client/scripts/make-icons.mjs and run npm run icons.

Configuration reference (API)

Key Purpose
ConnectionStrings:DefaultConnection SQL Server / Azure SQL connection string
Jwt:Key ≥ 32 character signing secret (required)
Jwt:AccessTokenMinutes, Jwt:RefreshTokenDays Token lifetimes (30 min / 60 days)
App:ClientUrl Web app URL used in email links
App:AllowedOrigins CORS origins allowed to call the API
App:ApplyMigrationsOnStartup Apply EF migrations when the API starts
Email:* SMTP settings; leave Host empty to log emails instead
GoogleAuth:ClientId Enables "Continue with Google"

Known limitations

  • Like Splitwise's free tier: no currency conversion, receipt photos or charts.
  • Signing up with an email that someone invited takes over that invited (placeholder) account without first verifying the email address. Google sign-in and password reset do verify it.

About

Splitwise-style expense sharing: ASP.NET Core API, Ionic Angular web/mobile/desktop apps, real-time updates

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages