Skip to content
Loading
All projects

Kormi: HR & Payroll System

An HR system for growing Bangladeshi teams, in English and Bangla: people, attendance, leave, payroll, chat and a notice board, with a dashboard for each of five roles. A Laravel 12 REST API with a Next.js front end.

Live demo (opens in new tab)

Type
Personal project
Role
Design, front end and back end
Apps
Web app (installable on phones) · REST API · queue worker · WebSocket server
Front end
Next.js · React · TypeScript · Tailwind CSS · shadcn/ui · Radix UI · TanStack Table · Motion · Lottie · Zod · Laravel Echo
Back end
Laravel 12 · PHP 8.3 · Sanctum · spatie/laravel-permission · PostgreSQL 18 · Redis · Horizon · Reverb · DomPDF
Delivery
Docker Compose · nginx · Supervisor · GitHub Actions · Playwright · Vercel · Render · Neon
roles
5
API tests
700+
decision records
69
commits
176
kormi-hrms.vercel.app/dashboard
Kormi's HR dashboard in the evening: 16 of 48 people came in today, HR's own day with a Check in button at 10:31 pm, and a Waiting on you list of 17 with 9 leave requests and 4 weekend overtime claims, above today's figures of 0 late, 9 leave requests waiting for a decision and 48 people working here.Open Kormi (opens in new tab)
Try itlive demo
  • Sign in (opens in new tab)

    One-click demo account for each of the five roles, so you can switch and compare. The demo server sleeps when idle, so the first sign-in can take up to a minute.

Context

Kormi (কর্মী, Bangla for “worker”) is an HR system built for how growing Bangladeshi companies work: a Sunday-to-Thursday week, salaries in taka counted in lakh and crore, government holidays that move with the moon, and staff who would rather read Bangla. I built it on my own time to show the backend as much as the screens: a Laravel API shaped like production code, with the front end in Next.js.

The demo company has 51 people across six departments and three offices, with recent attendance and leave, a year of paid payroll, live chats and notices, so every screen has believable data from the first sign-in. Last month is left unpaid on purpose, so you can run payroll yourself.

What I built

A Laravel 12 REST API under /api/v1 (124 routes) and a Next.js app that consumes it. Controllers stay thin: a form request validates, an action holds the business rule, and an API resource shapes the response. Errors share one JSON shape, and business conflicts come back as 409 with a stable code that the UI translates into either language.

Side effects run off the request. Events and listeners send notifications, refresh the dashboard cache and broadcast to the live board, and payroll runs on its own queue under Horizon. The browser never sees the API token: Next.js keeps it in an HttpOnly cookie and adds it on the server, WebSocket channel auth included.

Roles & access

Five roles, and what each can do is data, not code. The Super Admin opens Roles & access and turns permissions on or off for Admin, HR, Team Lead and Employee, and everyone holding that role gets the change on their next click. Seniority decides who may edit whom, and the Super Admin always keeps everything, so nobody can be locked out.

Every API route has a policy, and a test walks the route table so none can be missed. Whoever leads a department becomes its Team Lead and sees only that team: its people without pay, its live board, and its leave and overtime to approve. Each role lands on its own dashboard, which leads with what is waiting on that person.

Real time

The attendance board updates over WebSockets (Laravel Reverb) as people check in. Private channels are authorized by the same policy as the REST endpoint, so a Team Lead's connection only ever carries their own team. Leave requests and decisions, bills, overtime and checklist tasks reach the bell the moment they happen.

Chat (one-to-ones and groups, with files) runs over the same channels, so it added tables and endpoints, not infrastructure. Each person files their own inbox into Favourites and sections, an @mention notifies only people in that conversation, and a colleague's card shows where they are today from attendance rather than a status someone has to remember to set.

People

An org chart is drawn from reporting lines, any number of levels deep, with find-me, expand-all and full screen. Probation has an end date, a reminder and a one-step confirmation. Every change to someone's job, department, office or pay is written as a history record in the same transaction as the change. Private documents are reminded before they expire, and CVs are uploaded by their owner and downloaded only by people operations. Joining and leaving checklists copy the company's steps into tasks owned by roles, so the work follows the org chart rather than a name.

Payroll

Pay is basic plus house rent, medical and conveyance. A day's pay is gross divided by the month's working days, and each absence or unpaid-leave day deducts one. All the arithmetic runs in integer poisha, so nothing is lost to rounding.

Running payroll dispatches one job per employee as a batch, with progress shown live, and each payslip becomes a PDF. The jobs are idempotent and safe to retry, a month is never paid twice, and approved weekend overtime and bill claims are each paid exactly once. Bills are paid back outside gross, as money returned rather than earned.

Details that matter

Public holidays live in one table that HR maintains, and only the office clock reads it, so moving a moon-sighted Eid date changes attendance, leave day counts, payroll and overtime at once. Who's off is one calendar with three depths of detail, so a colleague's medical leave stays private. Search (Ctrl K) reaches any page or person, limited to what each person could already see. Every list is one data table driven by the URL, with paging and sorting on the server. Reports are CSV registers behind the same permissions as their screens.

Two looks, Classic and Monsoon, each with a light and a dark palette, and English or Bangla: all four choices are rendered on the server, so there's no flash on load. On a phone, Kormi installs as an app with a tab bar, large titles and sheets that rise from the bottom.

Quality & delivery

Pest feature tests cover every endpoint, the 403s included: more than 700 test cases, which CI runs against PostgreSQL 18 and Redis 7, with Pint, Larastan at level 8, and the Next.js lint, type check and build. Query-count tests catch N+1 queries before they ship. Seventeen Playwright tests sign in as each role in a real browser. Sharing one session lookup per page load cut a page from twelve API calls to four. Every architecture decision is written up as an ADR with its context and reasons: 69 so far, across 176 small conventional commits.

Locally the whole stack starts with one docker compose up. Production runs behind nginx with TLS. The live demo is a single container on Render with Neon Postgres, and the web app is on Vercel.

Screens

The attendance board's Everyone tab for Monday, 2 November: 45 of 48 expected came in, with 38 on time, 7 late, 1 on leave and 2 absent, and a bar chart of check-ins in 15-minute windows around the 10:00 am opening.
The attendance board. Rows arrive over WebSockets as people check in.
HR's leave requests, 9 waiting for a decision: Kawser Ahmed's one-day sick leave starting today and annual leave starting tomorrow, each with Decline and Approve, and longer requests from Nusrat Jahan and Ishrat Hasan drawn as a line from first day to last, one with 2 days off skipped.
Leave waiting for a decision, each request read as a route from first day to last.
The paid October 2026 payroll run: 48 payslips, ৳98,75,000 gross, ৳2,52,118.40 in deductions and ৳96,37,582.10 net, above a table of each person's days paid, gross, deductions and net, with a download button for every payslip.
A payroll run: one queued job per payslip, every slip a PDF.
Messages for a Team Lead: a list with the Kormi launch group, the Engineering group and a one-to-one with Nusrat Jahan, and the Engineering thread of 6 people open beside it, with a composer that says @ mentions someone.
Chat: one-to-ones and groups, with files and @mentions, over the same private channels.
The org chart in full screen, 48 people across 5 levels: the Managing Director with 47 in team at the top, then the heads of Product, Sales, Engineering and Finance and the Chief Operating Officer, each with their team size, and Find someone, Find me and Expand all at the top.
The org chart, built from reporting lines, any number of levels deep.
Employment history on a profile, newest first: joined as a Software Engineer in the Chattogram office on probation in April 2022, confirmed after probation that October, a basic salary change each April with the amounts hidden, and a promotion to Senior Software Engineer in April 2025, each recorded by HR.
Employment history: a record of every change, written with the change.
The notice board with 3 notices up: a pinned annual health check-up for everyone that 4 people have read, a new release freeze for Engineering that no one has read yet with a Got it button, and a quarterly town hall for everyone that 11 people have read.
The notice board: notices for everyone or one team, with a “Got it” HR can count.
Roles & access with 5 roles and 51 people: the Super Admin is always allowed everything so nobody can be locked out, and the Admin role allows 26 of 26 permissions, shown as chips under General, People, Attendance and Leave, with an Edit permissions button.
Roles & access. What each role allows is data the Super Admin edits.
A Team Lead's dashboard: a new notice on the board with a Got it button, their team today with 6 of 13 in and 7 not in yet, 3 leave requests waiting for a decision, and then their own day with a Check in button and November so far.
A Team Lead's dashboard: their team's day, then their own.
The Ctrl K search open over the HR dashboard with “ka” typed, listing six people with their job title and department, and hints for moving, opening and closing.
Ctrl K reaches any page or person, and only what you're allowed to see.
The HR dashboard in Bangla: the menu, dates and labels in Bengali, and every number in Bengali digits, from ১৬ of ৪৮ people in today to ১৭ items waiting for a decision.
বাংলা. Every screen, with Bengali digits and lakh grouping.
An employee's attendance page in the dark theme: their day with a Check in button, and October 2026 as a calendar of on time, late, on leave and weekend days, beside a summary of 18 days in, 1 late, 1 absent, 2 on leave and 4 hours of overtime.
Dark, in the Monsoon look: an employee's month on the calendar.
Three phone screens on a blue background: the Employee dashboard with notices to acknowledge and a tab bar at the bottom, the attendance page in Bangla, and the Engineering group chat in dark mode.
On a phone it runs as an installable app: a tab bar, large titles and sheets.

What's covered

Web app

What each role can do on kormi-hrms.vercel.app. · 8 areas · 37 features

Dashboards

  • Each role's dashboard leads with what's waiting on them
  • HR: today's attendance, leave, headcount and last payroll
  • Team Lead: their team's day, then their own
  • Employee: check in, this month, leave left, latest payslip, next holiday

People

  • Employee directory as a searchable data table
  • Profiles with photo, phone, education and work history
  • CVs and private documents with expiry reminders
  • Employment history of every change
  • Probation with a reminder and one-step confirmation

Organisation

  • Departments with heads
  • Work locations
  • An org chart from reporting lines, any depth, with full screen
  • Joining and leaving checklists owned by roles

Attendance

  • Check in and out on office time, late after the grace period
  • Live board by day
  • Your month as a list or a calendar
  • Weekend overtime claimed and approved
  • Nightly absence sweep

Leave

  • Annual, casual, sick and unpaid with yearly balances
  • Requests read as a route, approved from cards
  • Who's off calendar, with private leave types kept private

Pay

  • Payroll runs with live batch progress
  • PDF payslips
  • My payslips as a year chart and month tiles
  • Bill claims with receipts, paid back once through payroll

Talk

  • One-to-one and group chat with files
  • Favourites and your own sections
  • @mentions
  • A person card with today's whereabouts
  • A notice board with targeted, pinned notices and “Got it” read counts

Everywhere

  • Ctrl K search for pages and people
  • Notifications with sound
  • CSV reports
  • English and Bangla with Bengali digits
  • Classic and Monsoon looks, light or dark
  • Installable on phones
  • One-click demo sign-in for every role

API & infrastructure

What runs behind it. · 6 areas · 24 features

REST API

  • 124 routes under /api/v1, documented endpoint by endpoint
  • Form request, action, API resource
  • One JSON error shape and 409s with stable codes
  • A rate limit sized for a server-rendered client, where a 429 is a pause, not a crash

Auth & authorization

  • Sanctum bearer tokens, held only by the Next.js server in an HttpOnly cookie
  • Roles and permissions as enums on spatie/laravel-permission
  • A policy on every route, with a test that checks the route table
  • Login throttled per account and IP, and timing-safe

Real time

  • Laravel Reverb with private channels
  • Channels authorized by the same policies as the REST endpoints
  • Attendance, notifications and chat on one setup

Queues & scheduling

  • One payslip job per employee in a Bus batch, on its own Horizon supervisor
  • Idempotent, retry-safe jobs; overtime and bills paid exactly once
  • Scheduler for the absence sweep, monthly payroll, and probation and document reminders

Data & performance

  • PostgreSQL with indexes on every foreign key and filter column, added from EXPLAIN
  • Money in integer poisha
  • Redis cache per dashboard section, invalidated by events
  • Query-count tests against N+1
  • Uploads re-encoded, private files behind policies

Testing & delivery

  • 700+ Pest tests, 403s included
  • 17 Playwright end-to-end tests
  • CI on PostgreSQL 18 and Redis 7, with Pint and Larastan level 8
  • Docker images with dev and prod targets, nginx with TLS, Supervisor
  • Web on Vercel, demo on Render with Neon