All projects

Bitsmiths Studio · HR technology

Onboarding, leave, medical claims, overtime and payroll for Bitsmiths Studio.

Private deployment, client project

Category

SaaS

Year

2026

Capabilities

Cloud & Automation, Full-Stack

Industry

HR technology

Bitsmiths HRM on a laptop
Bitsmiths HRM on a phone

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.

Bitsmiths HRM: Leave requests on a laptop

Leave requests

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

Bitsmiths HRM: Payroll cycle on a laptop

Payroll cycle

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

Bitsmiths HRM: Payslip on a laptop

Payslip

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

On the phone

Bitsmiths HRM: Home on a phone

Home

Bitsmiths HRM: Leave requests on a phone

Leave requests

Bitsmiths HRM: Payroll cycle on a phone

Payroll cycle

Bitsmiths HRM: Payslip on a phone

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

Employee dashboard with live balances and latest payslip
Leave, medical and overtime requests with approval trails
Admin approvals queue across every request type
Monthly payroll runs, locked once finalised
Payslips, released to employees only after lock
Payoneer export and a policies document store

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.

5workflows in one tool: onboarding, leave, medical, overtime, payroll.
4enforcement layers guarding admin and employee access.
12automated emails replacing manual status chasing.

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.