Bitsmiths Studio · HR technology
Onboarding, leave, medical claims, overtime and payroll for Bitsmiths Studio.
Category
SaaS
Year
2026
Capabilities
Cloud & Automation, Full-Stack
Industry
HR technology


The problem
People operations were scattered across email, chat and paper: onboarding by email, leave and overtime in messages, medical claims on paper, and payroll assembled by hand each month from all of it. Nothing reconciled, and nothing was auditable.
Our approach
One system where every request is a row with a status. Employees submit; admins approve; approved leave, medical and overtime then sweep into a monthly payroll run that computes payslips and locks them.
Inside the product
More than one screen.
3 more screens from Bitsmiths HRM, captured at device size.

Leave requests
Requests routed to the lead and admin, with balances that update on approval.

Payroll cycle
The monthly register with overtime and deductions, approved in two steps.

Payslip
Earnings, deductions and the audit trail of who generated, reviewed and paid it.
On the phone

Home

Leave requests

Payroll cycle

Payslip
How it is built
Architecture
Next.js 15 App Router with next-safe-action server actions over Supabase, using Postgres, Auth, Storage and pg_cron. Business logic lives in the database: leave and medical balances, payroll calculation and locking are Postgres functions, guarded by row-level security. Roles mirror into the JWT via trigger so middleware can route on them. Resend sends 12 React Email templates, and a monthly cron job opens each payroll period.
Key features
Challenges & solutions
Where it got hard.
Challenge
Employees could not see their own locked payslips. The visibility policy subqueried an admin-only table, and that subquery runs with the caller’s privileges, so it silently returned nothing.
Solution
Moved the check into a SECURITY DEFINER helper that answers only "is this run locked?", so the policy resolves without exposing the company-wide payroll totals on that table.
Challenge
Approved medical and overtime could be double-counted, paid once in the run that swept them and again in the next.
Solution
Locking a run stamps each approved item with that run id in the same transaction, so every item feeds exactly one payroll and late approvals roll forward instead of duplicating.
Challenge
Admin overrides on a payslip, such as days worked, overtime multiplier and custom adjustments, were wiped whenever payroll was recalculated.
Solution
Made calculation idempotent: it upserts derived figures while preserving admin-entered overrides, so a recalc can be run safely at any point before the period locks.
Results
What shipping it changed.
Stack
Frontend
- Next.js
- React
- TypeScript
Styling
- TailwindCSS
Backend
- Supabase
- PostgreSQL
- Zod
Data Fetching
- TanStack
Email
- Resend
Scheduling
- pg_cron
Let's talk
We can usually tell within one call whether the approach above transfers to your problem, and what would need to change.