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.













