Grove HRMS
A full-stack HR management system with server-side role-based access and a single audited, transactional write path.
- Next.js
- TypeScript
- PostgreSQL
- Prisma
- Tailwind CSS
- Playwright
The problem
Grove is a complete HR platform for a company of about 100 people, from clocking in to running payroll, with separate experiences for employees, managers, HR and admins. The hard part is trust: each person may see and change only what their role and scope allow, and every change has to leave a record.
Architecture
How a change moves through Grove HRMS
Browser
- React 19 forms (React Hook Form)
Next.js 16 on Vercel
- proxy.ts: cookie redirects only
- Server components: pages and queries
- Server actions: createAction
- Route handlers: CSV, PDF, files, cron
createAction, every time
- Authenticate the session
- Validate with Zod
- Check role, scope and record
One Postgres transaction
- The change
- Audit entries
- Notifications
Supabase
- Postgres via Prisma 7, row level security with no policies
- Private storage bucket
Key decisions
- The database has one door.
- Every table has row level security on with no policies, so Supabase’s public API cannot reach it. Only the server connects, and it checks permissions in code.
- Every check is on the server.
- The proxy only redirects people without a session cookie. Pages, actions and route handlers each call requireUser or requirePermission, and queries filter by what the person may see.
- One way to change data.
- createAction runs the same steps every time, and a change, its audit entries and its notifications commit together or not at all.
- Business rules are plain functions.
- Leave balances, payroll, review visibility, CSV checks and reminders are pure, unit-tested functions shared by the UI previews and the server.
Proof
Every number opens its source. Every claim links to the code.
- tables
- scoped permissions
- tests
- seeded demo employees
Roles, scopes and permissions
The single path for every mutation
The 45-table data model
Every-screen accessibility sweep
Typecheck, lint, unit and Playwright on every push
What it doesn’t do yet
- Payroll is simulated and says so on every screen; it is not for running real payroll.
- Email is not sent: password-reset messages are queued in a table, and a real deployment needs a mail provider.
- The demo is shared: everyone uses the same four accounts and company, and it resets every night at 02:00 IST.
- Signed-in pages are slower on weak phones, because they wait for the session and live data.