Case Study

HR & Payroll SaaS for Mid-Market Companies

How we built an HR & payroll SaaS platform serving 85+ companies and 12K employees — with multi-state tax rules, benefits integration, compliance automation, and self-service portals achieving 99.9% payroll accuracy.

Industry
HR Tech / FinTech
Duration
10 Months
Services
Full-Stack · Integrations · Compliance
Markets
United States

HR & Payroll SaaS · Tax & Compliance

85+
Companies
12K
Employees
99.9%
Payroll Accuracy
Multi-State
Tax Support

The Client's Vision

A PEO (Professional Employer Organization) serving mid-market companies was struggling with legacy payroll software that couldn't keep up with multi-state expansion. Their clients employed workers across 40+ states, each with different withholding rules, sick leave mandates, and reporting requirements. Payroll runs took hours of manual verification, and one state tax rule change could break an entire pay cycle.

They needed a modern HR & payroll platform that could handle multi-state tax calculations automatically, integrate with benefits providers (ADP, QuickBooks) and compliance systems (DocuSign for I-9, W-4), provide employees with a self-service portal for pay stubs and tax documents, and maintain a full audit trail for SOC 2 and payroll compliance. The goal was to reduce payroll processing time by 70% while improving accuracy to 99.9%+.

What Was Breaking

Multi-State Tax Rules

Each state has different withholding rates, local tax jurisdictions, and special rules (e.g., reciprocity agreements). Manual updates were error-prone — a single wrong rate could affect hundreds of employees. Rules changed quarterly.

Benefits Integration

Health insurance, 401(k), and other benefits were administered by external providers. Payroll deductions had to sync with ADP, QuickBooks, and carrier feeds. Mismatches caused over/under deductions and employee confusion.

Compliance & Audit Trail

SOC 2 and payroll compliance required immutable audit logs. Who changed an employee's salary? When was a pay run approved? Legacy systems had gaps that auditors flagged. Document retention for 7+ years was manual.

Self-Service Portal

Employees called HR for pay stubs, W-2s, and tax form updates. HR spent 40% of their time on repetitive requests. There was no way for employees to update W-4 or banking info themselves.

The Architecture We Built

We built a multi-tenant SaaS platform with a Next.js admin for HR and finance teams, an employee self-service portal, and a Node.js backend that orchestrates payroll runs, tax calculations, and third-party integrations. Tax rules live in a versioned, state-specific config that we update as regulations change. ADP and QuickBooks integrations sync deductions and ledger entries. DocuSign handles I-9 and W-4 e-signatures. Every mutation is logged with user, timestamp, and before/after state for audit compliance.

System Architecture

HR Admin Portal & Employee Self-Service
Next.js admin for HR admins (employees, pay runs, reports). Employee portal for pay stubs, W-4 updates, direct deposit, and document download
Payroll Engine & Tax Calculator
Node.js services for payroll runs, multi-state tax calculation, and approval workflows. Versioned tax rule engine with state-specific configs
Integrations — ADP, QuickBooks, DocuSign
API integrations for benefits sync, ledger export, and e-signature. Webhook handlers for status updates and reconciliation
PostgreSQL — Employees, Pay Runs & Audit
Companies, employees, pay runs, tax configs, and immutable audit log. Multi-tenant isolation with company-scoped data
Compliance & Document Storage
Secure document storage for pay stubs, W-2s, and signed forms. 7-year retention policy. Role-based access with full audit trail

The tax engine was the most delicate piece. We built a rule engine that evaluates employee work location, residence state, reciprocity agreements, and local jurisdiction codes. Rules are stored as JSON configs with effective dates — when a state updates rates, we add a new version and the engine picks the correct one for each pay period. We run regression tests against known pay scenarios before every release.

Tech Stack

Next.js
Node.js
PostgreSQL
ADP API
QuickBooks API
DocuSign
SOC 2
AWS

How We Delivered It

Phase 1 — Weeks 1–5
Discovery & Tax Rule Design

Audited payroll workflows and pain points. Mapped multi-state tax rules and built initial rule config schema. Defined integration requirements for ADP, QuickBooks, and DocuSign. Designed audit log and compliance model.

Phase 2 — Weeks 6–18
Core Platform & Payroll Engine

Built Next.js admin and employee portal. Implemented Node.js payroll engine with tax calculator. Integrated ADP and QuickBooks for deductions and ledger. Added DocuSign for I-9 and W-4. Deployed multi-tenant PostgreSQL with audit tables.

Phase 3 — Weeks 19–30
Tax Rules & Compliance

Populated tax rules for 40+ states. Built rule versioning and regression test suite. Implemented document storage and 7-year retention. Completed SOC 2 readiness checklist.

Phase 4 — Weeks 31–40
Pilot & Rollout

Piloted with 10 companies and 800 employees. Validated 99.9% payroll accuracy. Phased migration of remaining 75+ companies. Trained HR teams and documented runbooks for tax rule updates.

The Impact

Manual tax updates
Automated 40+ states
Versioned rule engine with regression tests
Payroll processing
70% faster
From hours to minutes per pay run
HR support calls
-55%
Self-service portal for stubs and documents
Audit readiness
SOC 2 aligned
Full audit trail and document retention
“Multi-state payroll used to keep us up at night. One wrong rate and we'd have to issue corrections for hundreds of employees. Now the system handles it automatically — we hit 99.9% accuracy from day one. The self-service portal alone cut our HR support load in half.”
— VP of Operations, PEO

What Made This Work

Payroll is unforgiving. A single miscalculation can affect an employee's taxes, benefits, and trust. The tax engine had to be deterministic, versioned, and testable. We built a regression suite with hundreds of scenarios — employee in State A, works in State B, reciprocity applies — and run it before every deploy. That discipline caught several edge cases before they reached production.

Integrations with ADP, QuickBooks, and DocuSign were critical. Each has different webhook semantics and error handling. We built idempotent sync logic and reconciliation jobs that compare our records with provider data. Mismatches trigger alerts — we'd rather flag a discrepancy than silently propagate an error.

The audit trail was non-negotiable for compliance. Every change to an employee record, tax config, or pay run is logged with user ID, timestamp, and before/after JSON. That gave auditors a complete picture and the client confidence to pass SOC 2. Document retention for 7 years was implemented with lifecycle policies and encrypted storage.

Building an HR or Payroll Platform?

We help HR Tech and FinTech companies build compliant payroll, benefits integration, and self-service portals. Let's talk about your architecture.

Book Strategy CallCase Studies