Lohnio is a free, self-hosted web tool for monthly payroll processing of household helpers and caregivers in Switzerland. Enter the hours – Lohnio automatically calculates gross pay, deductions, and net pay, and generates a professional PDF.
Features:
- Payroll slip as PDF (AHV/IV/EO, ALV, holiday allowance, weekend surcharge, 13th month salary)
- Official Swiss wage certificate ESTV Form 11 – filled automatically
- PAIN.001 XML for direct import into e-banking
- Employees submit their own hours via a personal link – no account required
- Annual overview and shared account (e.g. with a partner)
- Works on smartphones (installable as an app)
- What you need
- Step 1: Set up the database
- Step 2: Download the code
- Step 3: Configure the app
- Step 4: Start the app
- Running the app online
- For developers
| What | Purpose | Link |
|---|---|---|
| Node.js | Runs the app | nodejs.org → download LTS version |
| Git | Downloads the code | git-scm.com (often pre-installed on Mac) |
| Database service | Stores data & manages logins | We recommend Supabase – the free plan is sufficient for personal use |
Check if Node.js is installed: Open Terminal (Mac: Cmd+Space → type "Terminal"), then run:
node --version
If a version number appears (e.g. v20.x.x), you're ready.
Lohnio needs a Postgres database with authentication and Row-Level Security. The complete database schema is provided in supabase/migrations/init_schema.sql.
2.1 Create a project
- Sign up at supabase.com and create a new project
- Wait until the project is ready (about 1 minute)
2.2 Apply the schema
- Open the SQL Editor in the Supabase dashboard
- Paste the entire contents of
supabase/migrations/init_schema.sql - Click Run – all tables, security rules, and functions are created automatically
2.3 Set the allowed redirect URL
Go to Authentication → URL Configuration and add:
http://localhost:9999
http://localhost:9999/**
2.4 Note your credentials
You will need these in the next step:
- The Project URL (e.g.
https://xxxx.supabase.co) - The anon / public key (found under Project Settings → API)
Open a terminal and run:
git clone https://github.com/your-username/lohnio.git
cd lohnio
npm install
npm installdownloads all dependencies. This takes about 1–2 minutes.
Copy the example configuration file:
Mac / Linux:
cp .env.local.example .env.localWindows:
copy .env.local.example .env.localOpen .env.local in a text editor and fill in the credentials from Step 2.4:
NEXT_PUBLIC_SUPABASE_URL=https://xxxx.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
Save the file.
npm run devAfter about 10–20 seconds you will see:
✓ Ready on http://localhost:9999
Open your browser and go to http://localhost:9999 – Lohnio is running.
On first visit, create an account (Sign up) and you're ready to go.
The app only runs while the terminal is open. For permanent access → Step 6.
For permanent access from any device, Lohnio can be deployed to any hosting provider that supports Next.js.
Recommended: Vercel – free plan, direct GitHub integration, no server configuration needed.
- Push the repo to GitHub
- Sign in at vercel.com → New Project → select your repo → Deploy
- Add the environment variables in the Vercel project settings (see table below)
- In Supabase → Authentication → URL Configuration, add your Vercel domain as an allowed URL
Environment variables:
| Variable | Where to find it |
|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Supabase → Project Settings → API |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
Supabase → Project Settings → API |
SUPABASE_SERVICE_ROLE_KEY |
Supabase → Project Settings → API → service_role (admin page only) |
NEXT_PUBLIC_ADMIN_EMAIL |
Your email address (admin page only) |
Build and start commands (for self-hosted deployments):
npm run build
next start # port 3000Install as an app on your phone:
Navigate to the app URL in your browser → "Add to Home Screen".
- Framework: Next.js 16 (App Router) + TypeScript
- Styling: TailwindCSS v4 + Shadcn UI
- Data & Auth: Supabase (Postgres, RLS, Realtime)
- PDF: jsPDF (payroll slip) + pdf-lib (ESTV Form 11)
lohnio/
├── app/ # Next.js routes
│ ├── payroll/ # Payroll processing
│ ├── employees/ # Employee management
│ ├── yearly/ # Annual overview + wage certificate
│ ├── stunden/ # Public hour submission (no login)
│ ├── settings/ # Settings, account sharing
│ └── auth/ # Login, signup
├── lib/
│ ├── data/schema.ts # TypeScript types
│ ├── hooks/ # React hooks
│ ├── supabase/ # DB clients (browser, server, admin)
│ └── utils/ # Calculations, PDF, PAIN.001, etc.
├── supabase/migrations/ # init_schema.sql (one-time setup)
└── public/ # ESTV wage certificate form (PDF)
npm run dev # Development server on port 9999
npm run build # Production build
npm run start # Production server on port 3000
npm run lint # ESLint- Early returns for readability
- No unnecessary abstractions
- Accessibility: skip link, ARIA, semantic HTML
- TypeScript strict mode
MIT License – free to use, adapt, and extend.