Smart Attendance App — Mobile API
Geofenced Check-ins, Selfie Verification, Shifts & Leave Management

Backend for a workforce attendance app. Employees check in and out from their phone only when they are inside an approved location, with a selfie captured at check-in. Managers see live attendance, late arrivals and leave requests, and HR exports monthly reports.
Architecture & System Design
Each office or site is stored with a centre point and radius. On check-in the API validates the device's coordinates against the employee's assigned sites using a distance calculation, stores the selfie in object storage, and links the record to the employee's shift so lateness and overtime are computed on the server.
- Server-side geofence checks so location rules can't be bypassed from the client
- Shift-aware records calculate late arrivals, early exits and overtime automatically
- Selfies stored in private object storage with signed URLs for managers
- Leave requests flow through manager approval with push notifications at each step
Engineering Challenges
Trustworthy Location Checks
Attendance is only meaningful if staff are actually on site, but phone GPS can be inaccurate indoors.
Validated coordinates on the server with a configurable radius per site and stored the reported accuracy with each check-in, so borderline cases can be reviewed instead of silently rejected.
Check-ins are enforced against real site boundaries while still handling weak indoor GPS fairly.
Night Shifts Crossing Midnight
Shifts like 10 PM–6 AM span two calendar days, which broke simple per-day attendance logic.
Modelled attendance against the shift window instead of the calendar date, so a check-out after midnight closes the shift it belongs to.
Overnight shifts calculate hours worked correctly without special-case reports.
Core Features
Geofenced Check-in/out
Check-in is accepted only inside an assigned site's radius, with location and accuracy recorded.
Clean Code
1public function isInside(Site $site, float $lat, float $lng): bool2{3 $earthRadius = 6371000; // metres45 $dLat = deg2rad($lat - $site->lat);6 $dLng = deg2rad($lng - $site->lng);78 $a = sin($dLat / 2) ** 29 + cos(deg2rad($site->lat)) * cos(deg2rad($lat)) * sin($dLng / 2) ** 2;1011 $distance = 2 * $earthRadius * asin(sqrt($a));1213 return $distance <= $site->radius_m;14}Want something like this for your business?
I design and build full stack products end to end. Tell me about your idea and I'll get back to you with a plan.