Py’otrMuhammad Toheed Sahar

Multi-company attendance system with GPS geofencing and month-end reports

I built an attendance system for a Gulf-region business group: GPS-checked clock-ins, remote-work approvals and month-end Excel reports, running on the client's own PHP and MySQL hosting.

Client
A Gulf-region business group
Year
2025 to 2026
Type
Web apps & SaaS · Featured
Screenshot of Multi-company attendance system with GPS geofencing and month-end reports

The problem

A business group with several companies needed dependable proof of who clocked in, from where and for how long, plus a month-end hours report they could rely on. Staff are split between the office and remote work, and Friday and Saturday follow different rules from the rest of the week.

How I built it

I started with a NestJS and MongoDB API behind a React dashboard, one company per tenant, with role-based access and a GPS capture on every clock-in. That Node service was hard to keep running on the client's shared hosting, so I rebuilt the API in plain PHP on MySQL and migrated the existing records across. The final version checks each clock-in against the company's office radius, sends remote work and exceptions to an approver, and produces an end-of-month Excel file with one sheet per employee showing planned against actual hours. Addresses come from OpenStreetMap, so there are no per-lookup fees.

What got hard

  1. The host would not keep the original backend running.

    Shell commands were disabled on the shared server, so I worked through a run of about twenty patch-and-restart releases. The lasting answer was a pure PHP and MySQL release that the host runs natively, with the old record IDs kept in their own column so history carried over.

  2. A block of attendance records was missing from the production database.

    I rebuilt 11 to 22 January from the earlier database exports, the Excel and XML reports and dashboard screenshots, then loaded it with 112 duplicate-safe insert statements, including night shifts that cross midnight. I then checked specific days, including the overnight shifts, with audit scripts.

  3. Real attendance rules do not fit a simple clock-in button.

    Office staff are blocked outside the company's radius (distance measured against a per-company setting), remote staff are approved automatically, and an office employee who marks remote goes to an approver. Friday and Saturday have their own planned hours, with date-specific overrides, so month-end totals compare actual hours with the right plan for each day.

  4. The public demo had to fit Vercel's free plan.

    The plan caps a project at 12 serverless functions, so I merged the small endpoints into one routed handler, kept the PHP version's token format, and served seeded sample data so anyone can try it safely.

The result

In the 24 January 2026 recovery data set the PHP and MySQL system held 13 user accounts across 2 companies and 553 attendance records. The v2 release (February 2026) includes approvals, geofence rules and the Excel reports, and a demo with sample data is deployed on Vercel.