Start a project

Staff portal

2026 · Design · Build · Auth

In at 6:30 PM,out at 3:30 AM,one shift.

The private back office of The Best Estimator: one login where fifteen staff run projects, customers and their own attendance.

The team works US hours from Islamabad, so every shift crosses midnight. Most of the engineering went into making time and payroll right.

Year
2026
Role
Design, build, deploy
Stack
Flask · PostgreSQL · plain JS
Access
Internal, staff only
Dashboard: attendance status, active projects, who is in right now and what needs attention
Dashboard · AdminWho is in, what needs attention
01 · Access

One login, four roles.

Every person is one row in one staff table. Each module adds its own rules on top, and the server checks them on every request, so a hidden button is never the only lock.

  • Full

    Dashboard

    /dashboard
  • Every project

    Projects

    /projects
  • Full

    Customers

    /customers
  • Own

    My attendance

    /attendance
  • Full + corrections

    Attendance review

    /attendance/admin
  • Full

    Staff

    /staff
  • Full

    Share a project

    /projects/<id>/generate-link
  • No login

    Client view

    /p/<token>

Admin · every project, every person, every correctionLocked routes answer 403 or 404, not a hidden link

02 · Time

The shift that crosses midnight.

  1. A normal night

    In at 6:30 PM, out at 3:30 AM.

    The office keeps US working hours. Every shift starts on one date and ends on the next, so it is the normal case, not an edge case.

  2. The bug

    Midnight changed the date.

    Check-out looked for today's row. After midnight, today was the 25th; the shift was saved on the 24th. Nobody could check out, and the shift stayed open forever.

  3. The fix

    Ask for the open shift, not the date.

    Check-out now closes whichever shift is still open, whatever the calendar says. The database backs it up: one person can never have two open shifts.

    CREATE UNIQUE INDEX uq_one_open_shift
      ON attendance (staff_user_id)
      WHERE check_out_at IS NULL
        AND NOT missed_checkout;
  4. Windows

    Buttons that only work on time.

    Check-in opens at your own shift start for seven hours; check-out takes over the same minute, so a slip of the thumb can't end a shift early. 1:30 AM on a Saturday is still Friday's shift.

  5. Forgot to check out

    Nobody guesses the hours.

    When the window closes, the shift is flagged, counts as zero hours and shows up for an admin. No check-out time is ever invented, and it never blocks the next night.

Attendance review, dark theme: every employee for the day, with status and an Add entry action
Attendance review · DayEveryone, even who hasn't come in
New project form, dark theme: estimators, payment status and requirements
New projectDark theme
03 · Payroll

Every correction leaves a trail.

Attendance feeds salaries, so only an admin can change a past entry, a reason is required, and the old value is kept. The employee sees the note on their own history.

  • check_out_atnone → 3:31 AM“Forgot to check out, confirmed on call”AdminSep 25 · 10:12 AM
  • check_in_at7:58 PM → 6:31 PM“Power cut at home, checked in late”AdminSep 26 · 9:40 AM
  • createdabsent → 6:30 PM – 3:30 AM“On a site visit, logged by phone”AdminOct 02 · 11:05 AM
  • left_earlyyes → noCleared when check-out moved to shift endSystemOct 06 · 4:18 AM
04 · Sharing

A client sees one project, nothing else.

No client accounts. An admin sends a private link; it shows the project's status and only the updates marked for the client.

portal / p / Xq7vR2mK9pLw4NcT8sYbE1hJ6uZaD3fG0oVkW5iQyMn
Sent to the clientXq7vR2mK9pLw4NcT8sYbE1hJ6uZaD3fG0oVkW5iQyMn
SHA-256 →
Stored in the database9f2c4e81a07b3d65c1e8f4a29b0d7e36a5c18f72e4b9d03a6
  • Only a hash is storedA leaked database can't be turned back into working links.
  • Revoke any timeEach link has an expiry and a revoked flag; a new link replaces the old one.
  • Nothing to discoverThe page has no menu and no other routes, and search engines are told to skip it.
  • No leaks on the way outStrict referrer policy, so the private link never travels to a third party.
05 · Hardening

Every bug, written down.

159Automated tests
48Fixes in the log
15People using it
4Roles, one login
  • #21 · Time zones

    The server lived in UTC.

    Near midnight in Islamabad, a check-in could land on the wrong day. Times are stored in UTC and shown in the company's own zone.

  • #30 · Dates

    A 12:30 AM check-in was saved on the wrong day.

    It now takes the date the shift started, and a dry-run command repairs the rows the old bug had already mis-dated.

  • #32 · Privacy

    Estimators could find client names through search.

    Their search now only matches project names and addresses.

  • #33 · Access

    A deactivated person kept their session.

    Access now ends on their very next click.

  • #34 · Payroll

    The month counted future days as absent.

    Days not yet worked are “Upcoming”, and a shift still running after midnight isn't judged until it ends.

Built with Flask and PostgreSQL, hand-written CSS and plain JavaScript, no build step. Rate-limited login, CSRF on every form, hashed passwords, deployed on Railway.

More projects

All work