How to Build an HR Leave Management App: Requests, Approvals and Balances
How to build a leave management app: leave types, allowances, request and approval flow, balances, team calendar and public holidays.
Mythex Team · · 5 min read
A leave management app replaces the spreadsheet and email chains behind "can I take Friday off?". Employees request time off and see their remaining balance; managers approve or decline with the team calendar in view; HR sets leave types, allowances and public holidays and gets a clean record for payroll. To build one you need a data model where balances are calculated from a history of requests and adjustments, a clear approval chain, and rules for part days, weekends and holidays. An AI app builder can produce a working version quickly. The care goes into balance maths, permissions around sensitive leave types, and matching your actual policy.
What the app needs
Data
| Table | Key fields |
|---|---|
| Employees | Name, email, manager, team, location, start date, working pattern (days per week, hours per day), active yes/no |
| Leave types | Name (annual, sick, parental, unpaid, other), paid yes/no, needs approval yes/no, counts against allowance yes/no, sensitive yes/no |
| Allowances | Employee, leave type, year, days allowed, carried over |
| Requests | Employee, leave type, start date, end date, half-day at start or end, days counted, reason, status (pending, approved, declined, cancelled), approver, decided at |
| Adjustments | Employee, leave type, days (+ or −), reason, made by, date |
| Public holidays | Location, date, name |
The key rule: never store a balance you edit by hand. The balance is allowance + carry-over + adjustments − approved days. Every change has a record with a reason, so when someone asks "why do I have 3.5 days left?" you can show them.
Pages
- Employee: my balance per leave type, request form, my requests with status, a calendar of my team.
- Manager: pending requests with the team calendar alongside, approve or decline with a comment, team balances.
- HR/admin: employees, leave types, allowances, public holidays, adjustments, and reports and exports.
Permissions
This is personal data, and some of it is sensitive. Employees see their own requests and, on the team calendar, only that a colleague is "away" — not why. Managers see their direct reports. HR sees everyone. Sick leave and other sensitive types should show only as "away" to anyone except the employee, their manager and HR. Enforce this on the server; see role-based access control. Data protection rules on employee records vary by country, so check yours.
Decisions and trade-offs
Days or hours
Counting in days (with half days) is simplest and fits most office teams. Counting in hours suits part-time and shift workers but makes every calculation more complex. Pick one for the first version, based on how your contracts express allowances.
Allowance up front or accrual
Giving the full yearly allowance on the first day of the leave year is simplest. Accrual — earning a fraction each month — is common in some countries and for new starters, and needs a monthly calculation. Pro-rating for people who join or leave mid-year is needed either way.
Which days count
A request from Thursday to Tuesday should count only working days, excluding weekends and public holidays for that employee's location, and respecting part-time patterns. This is the calculation most likely to be wrong, so test it with real examples.
Approval chain
One approver (the line manager) covers most small companies. Add a backup approver for when the manager is away, and optionally a second step for long absences. Decide what happens to pending requests if a manager leaves.
Carry-over and year end
Decide your leave year, how many unused days carry over, and whether carried days expire. Ask the AI to show carry-over as its own line so the balance stays explainable.
A first prompt that works
Build an internal leave management app for a 45-person company with offices in Manchester (UK) and Dublin (Ireland). Leave types: annual (25 days, full year up front, up to 5 days carry over, expiring 31 March), sick (unlimited, no approval, visible to others only as "away"), unpaid, and other. Leave year runs January to December. Employees request leave with start date, end date and optional half days, and see how many working days it will use — excluding weekends, part-time days off and public holidays for their office. Balances are calculated from allowances, carry-over, adjustments and approved requests, never edited directly. Managers approve or decline their direct reports' requests with a comment, seeing the team calendar at the same time. HR manages employees, leave types, allowances, public holidays and adjustments with a reason, and exports approved leave by month as CSV for payroll. Roles: employee, manager, HR. Save everything in a database. Plain, fast interface.
Build steps
- Start from your written policy. If it isn't written down, write it first — the app can only apply rules you can state.
- Import employees with manager, location and working pattern, usually from a spreadsheet. See turning a spreadsheet into an app.
- Leave types, allowances and public holidays.
- Request form with the working-days calculation, tested against at least ten real cases: across a weekend, a bank holiday, a part-timer, a half day, a year boundary.
- Approval flow and team calendar.
- Logins and roles, with sensitive leave types hidden from colleagues.
- Notifications: email the manager on a new request and the employee on a decision, through your own email provider. See sending emails from your app.
- Reports and exports for payroll.
- Run in parallel with the spreadsheet for one month, compare balances, then switch.
Common mistakes
- Storing a balance number and editing it. You lose the history and every dispute becomes guesswork.
- Counting calendar days instead of working days, or ignoring the employee's office for public holidays.
- Showing everyone why a colleague is off. "Away" is enough on the shared calendar.
- No backup approver. Requests sit for two weeks while the manager is on holiday.
- Letting people cancel approved leave without the manager knowing. Cancellations should notify the approver.
- Hard-coding this year's rules. Keep allowances and holidays as data HR can edit next year.
When a ready-made product is the better choice
If you want leave tied into payroll, contracts, performance reviews and compliance reporting — or you employ people in many countries — HR software that includes time-off management is usually worth it. Those products maintain holiday calendars and statutory rules per country, which is ongoing work you would otherwise own.
A custom app makes sense for small and mid-sized companies with a simple policy that just want to leave the spreadsheet behind, for unusual setups (shift crews, rotating rosters, leave tied to on-call cover), or as part of a wider internal tool alongside onboarding and other requests. See how to build an internal tool for the broader approach.
Building it with Mythex
On Mythex you describe the policy and workflow in chat and the agent builds the app in a live preview, with a Postgres database added when requests need saving. You can invite colleagues into your Mythex workspace to help build and review it, and share the preview with two or three real users before you publish — the internal tool use case in the docs suggests exactly that. Employee logins and notification emails use your own providers; Mythex has no built-in end-user login or email sending. Use Plan mode to agree the balance calculation before any code is written, and /test to click through request and approval.
For a starting prompt, try the approval tracker or team directory templates.
Questions
What features does a leave management app need?
Leave types with yearly allowances, a request form, manager approval, each employee's remaining balance, a team calendar showing who is off, and public holidays per location. Reports and payroll exports come next.
How should leave balances be calculated?
Store every request and every adjustment as a separate record and calculate the balance from them, rather than keeping one number you edit. That way you can always explain a balance and fix mistakes without losing history.
Does a leave app have to follow employment law?
Leave entitlements, carry-over, sick leave rules and record-keeping requirements are set by local law and employment contracts, and vary widely by country. The app should apply your policy, and that policy should be checked by an HR or legal adviser.
When should a company switch from a spreadsheet to a leave app?
Usually when more than one manager approves leave, when people start asking HR for their balance, or when two key people are off at the same time because nobody could see the calendar.