PeopleBase

People data, and who gets to see it.

PeopleBase is a small HRIS in Flask: records and job history, pay, time off with a team calendar, onboarding, performance reviews, documents, policies and an audit log of changes and sensitive reads. Employees, managers and HR sign in, and the server decides on every request what each of them may open.

The PeopleBase dashboard signed in as an HR admin: 11 people at work across 5 departments, headcount bars by department, upcoming work anniversaries and who is out today.
The HR dashboard with the built-in demo company. Everyone in it is made up.

The security model

A role grants a capability. The reporting line decides how far it reaches. One module, access.py, makes every decision.

What Riley, a manager, can open An org chart. Morgan is at the top with three reports: Riley, Harper and Emerson. Casey and Jordan report to Riley. Rowan reports to Harper. Riley's own box is marked as their own record, Casey and Jordan are marked as within reach, and Morgan, Harper, Emerson and Rowan are out of reach. MorganManager RileyManager, signed in HarperManager EmersonHR admin CaseyEmployee JordanEmployee RowanEmployee
  • Own recordProfile, pay, leave balances, time off and checklist.
  • Within reachDirect and indirect reports: profile, time off and checklists, and the say on their time off. Never their pay.
  • Out of reachPeers, other teams and their own manager: a name in the directory and org chart, nothing more. Riley asking for Rowan's record gets the same 404 as a record that does not exist.
RoleSeesCan change
EmployeeOwn record, pay, leave balances and checklist; the directory and org chartOwn time-off requests, own policy acknowledgements, own password
ManagerThe same, plus the records, time off and checklists of direct and indirect reports, without payApprove or deny reports' time off; tick their checklist tasks
HR adminEverything, including pay, people who left, reports and the audit logRecords, departments, accounts and roles, policies

How a request is checked

Every request passes the same gates, in this order, before a route does anything.

  1. SessionThe signed cookie must match an active account and its current nonce, and be under 12 hours old. Otherwise: the sign-in page.
  2. CSRFEvery POST needs the per-session token, sign-in and sign-out included. Otherwise: 400.
  3. RoleHR-only actions answer 403 to everyone else, whatever id is in the URL.
  4. ReachThe record is loaded, then checked against the caller's reporting tree. Out of reach: 404.
  5. AuditA change and its audit entry are saved in one transaction. The log refuses edits and deletes.

What it looks like

Captured from the running app with the demo data, in light or dark to match your system.

A manager's time-off queue with two pending requests from their reports, each with Approve and Deny buttons. One notes that it is 2 working days more vacation than the person will have accrued by then.
Approval queue. A manager sees requests from their reporting tree only, with a note when one runs past the leave balance.
An employee profile seen by HR: employment details with salary, direct reports and a compensation history showing a hire and a promotion.
Employee profile. Pay and its history show for HR and the employee, never for the manager.
The org chart: the chief operating officer at the top with design, operations, people and engineering leads beneath and their reports under them.
Org chart. Built from one manager field per person. Loops and self-management are refused.
The audit log: rows for a sign-in, a directory CSV export, a completed checklist task and a pay change showing the old and new title and salary.
Audit log. Who changed what, with old and new values, and who looked at someone else's record. HR can read it; nobody can edit it.
A manager's view of one review: the person's self review rated 4 of 5 and the manager's review rated 5 of 5, each a short paragraph, in a cycle that is still open.
Performance reviews. A self review, then the direct manager's. Each half is written once, and the person reads the manager's only after HR closes the cycle.
The team calendar for November 2026 signed in as HR, a month grid with leave shown as names and the kind of leave on the days people are out.
Team calendar. Each person sees their own team. Colleagues show as out without the kind of leave; HR sees everyone.
The documents page for one person signed in as HR: three PDF files with category, who each is shared with, date added and size, with Download and Delete links and an upload form below.
Documents. PDF, PNG and JPEG on a record, each shared with HR only, the person, or the person and their managers.
An onboarding checklist with an owner and due date on each task, two overdue tasks flagged in red, followed by a documents panel and a job history table.
Checklists with owners. Each task has an owner and a due date, overdue tasks are flagged, and employees can tick the ones that are theirs.
A job history table with two rows, Engineer then Senior Engineer, each with department, manager and reason, above the separate compensation history.
Job history. Title, department and manager over time, kept apart from pay so managers can read one and not the other.

What it keeps track of

The everyday records a people team at a small company needs.

People and reporting lines
Records with department, manager, status, start date and last day, a searchable directory and the org chart.
Pay history
Every title or salary change with its effective date and reason, and a CSV export that spreadsheets cannot run as formulas.
Time off and leave balances
Requests, approval up the reporting line, and balances per leave type that accrue monthly in working days.
Onboarding and offboarding
A checklist for each new hire and each leaver, with an owner and a due date on every task. Marking someone as left turns off their account.
Job history
Every title, department and manager change with its date and reason, filled from the pay history when you upgrade.
Team calendar
A month view of leave. Colleagues see who is out; the kind of leave is for the person, their managers and HR.
Performance reviews
Cycles opened by HR, a self review and a direct manager review, released when the cycle closes. Skip-level managers do not read them.
Documents
Contracts, letters and certificates, shared with HR only, the person, or the person and their managers. Checked by content, stored outside the web root.
Policy acknowledgements
Published text never changes. A revision is a new version, and everyone is asked again.
Headcount and attrition
Twelve months of hires, leavers and headcount, with a CSV cut to the viewer's own reporting tree.

706

tests run on every pull request, on Python 3.11, 3.12, 3.13 and 3.14.

  • 27 abuse cases, each with a testChanging ids in URLs, forged form fields, session replay, password guessing, export scope and more, written down before the code.
  • Every route declares who may call itOne test holds the route-by-role table and fails when a route is added without an entry.
  • Argon2id passwords and a lockout that leaks nothingFive failures lock an email for 15 minutes, whether or not it has an account.
  • Migrations tested against old databasesThree earlier schema shapes upgrade to one, checked on SQLite and PostgreSQL.
  • The basics, keptCSRF on every form, a Content-Security-Policy without inline script, no-store pages and a 64 KiB request limit.

Run it locally

Python 3.11 or newer. The demo flag loads made-up people named "Example" and prints three sign-ins with a password generated for that run.

git clone https://github.com/patrickking67/peoplebase.git && cd peoplebase
python3 -m venv .venv && .venv/bin/pip install -r requirements-dev.txt
./scripts/dev.sh --demo                # http://127.0.0.1:4104

./scripts/check.sh                     # lint, tests and repo checks