Build an HR system
How to build an HR system with AI
To build an HR system, describe who it is for and what they do in it, and let Forge64 plan and generate the app. An HR system of record with effective-dated employment history, org structure, leave and timesheets, an applicant tracking pipeline, onboarding/offboarding checklists, and a controlled payroll-run workflow with versioned rule packs, dual approval, payslip generation and an export file, with pay data treated as highly sensitive. The core parts of a first version are companies, legal employers and departments, hr roles and field-level visibility, effective-dated employment record, versioned statutory and policy tables and leave and time tracking.
Last checked
What the first version needs
These are the parts a HR system needs before it is useful. Each one is something the plan covers.
- Companies, legal employers and departments: Keep legal employers, departments and cost centers apart with an org chart over them.
- HR roles and field-level visibility: Employees see themselves, managers see their reports, HR sees records, payroll sees pay, nobody sees everything by default.
- Effective-dated employment record: Know what was true on any date: title, manager, salary, location, status.
- Versioned statutory and policy tables: Tax brackets, leave accrual rules and holiday calendars change by date and jurisdiction.
- Leave and time tracking: Request, approve and account for time off and worked time.
- Approval chains: Route leave, timesheets, expenses and pay changes to the right approver.
- Payroll dual control: The person who prepares a payroll run cannot approve or release it, and pay changes need a second person.
- Payroll run workflow: Compute pay from inputs with traceable rules and produce payslips and a payment file.
- Payslips and statements: Give each employee a clear, private payslip and year-end statements.
Parts you can add in the first version
- Applicant tracking: Run a hiring pipeline from posting to offer without losing candidates.
- Onboarding and offboarding checklists: Make sure every new hire and leaver gets the same steps done on time.
- Payroll exports and reports: Hand data to banks, tax providers and accountants.
The data it stores
Each table below becomes part of the Postgres database that belongs to your app.
- employees: national id, DOB and legal name are encrypted at column level; terminated records are retained per policy, not deleted.
- employments: append only; ranges per employee must not overlap (exclusion constraint on daterange); a correction inserts a new row with a reason.
- compensation_records: kind: base|allowance|bonus|equity_grant; period: hour|month|year; CHECK (approved_by is distinct from created_by); only payroll and HR roles can read.
- leave_requests: days stored in hundredths; status: pending|approved|rejected|cancelled; approval writes a leave_ledger row; overlapping approved requests are rejected.
- leave_ledger: insert only accrual ledger; balance is the sum of deltas as of a date, with a cached balance proved nightly.
- time_entries: kind: regular|overtime|break|travel; locked once the timesheet is approved.
- payroll_runs: status: draft|calculated|in_review|approved|released|reversed; CHECK (approved_by is distinct from prepared_by); released runs are immutable, corrections are off-cycle runs.
- payroll_items: lines_json lists each earning and deduction with the rule id that produced it, so any number is explainable; anomaly_flags records changes versus the previous run above threshold.
- rule_pack_versions: kind: tax|social|leave_accrual|holidays; definition is data, interpreted by the calculation engine; changes require two approvers and a test-vector run.
Pages and endpoints
| Route | Who can use it | What it does |
|---|---|---|
| /people | authed | directory and org chart, field visibility by role. |
| /people/[id] | authed | employee profile with effective-dated history; compensation tab restricted and access-logged. |
| /time-off | authed | request, balances and team calendar. |
| /timesheets | authed | weekly time entry and submission. |
| /recruiting | authed | openings and candidate pipeline board. |
| /payroll/runs | authed | run list, calculation review with anomaly flags, approval and release. |
| /me/payslips | authed | own payslips and annual summaries only. |
| /careers | public | public job board and application form with rate limiting. |
| /api/payroll/runs | authed | create or recalculate a run; Idempotency-Key required; payroll role. |
| /api/payroll/runs/[id]/release | authed | release after two distinct approvals; step-up auth. |
| /api/applications | public | submit an application with resume upload; bot and size limits. |
What to leave out of version one
- No filing of payroll taxes or statutory returns; export files only.
- No movement of money; the payment file is executed by the operator's bank.
- No editing of released payroll runs; off-cycle corrections only.
- No automated hiring or firing decisions.
- No monitoring of employees' devices, keystrokes or private communications.
- Offer letters and contract signature: plan for it, build it later.
How Forge64 builds it
Forge64 matches your description to one of 25 reference architectures, writes the plan and data model into the project, generates the app, and runs a quality gate over the code before you see it. Each app gets its own Postgres database and sign-in with no per-user fee. Hosting on Forge Cloud and Forge Payments are rolling out.
This is a reference design for the category, not a promise that every item is generated today. Built-ins such as background jobs, file uploads and search are rolling out; email sent from your app is coming soon, so anything here that needs it is something you add yourself for now.
FAQ
- What does an HR system need first?
- Companies, legal employers and departments, hr roles and field-level visibility, effective-dated employment record, versioned statutory and policy tables, leave and time tracking and approval chains. The plan for a HR system covers all of these before it generates code.
- What should I leave out of the first version of an HR system?
- No filing of payroll taxes or statutory returns; export files only. No movement of money; the payment file is executed by the operator's bank. No editing of released payroll runs; off-cycle corrections only.
- Which products define the HR system category?
- Well-known examples include BambooHR, Gusto, Rippling, Workday and Personio. Use them to decide which features your users expect, then describe your own version.
Build your app with Forge64
One prompt to a running app with auth, database, hosting and payments. Start free, no credit card required.
Start building for free