# Build an Attendance App in Lovable

- Tool: Lovable Prompts
- Last updated: June 2026

## TL;DR

Paste the starter prompt below into Lovable Build mode and get a clock-in/clock-out attendance app with QR code check-in, server-side geo-fence validation, a UNIQUE constraint that blocks duplicate same-day check-ins, and an admin log with CSV export. Full build fits in one day with around 60-120 credits on a Pro plan.

## Frequently asked questions

### Can I run this on the Free Lovable plan?

You can start on Free for the first few prompts, but the full build including the check_in RPC and Edge Functions will likely exceed the 30-credit monthly cap. The starter prompt alone runs 30-50 credits. Plan on Pro $25/mo from the start. After the build is stable and you stop iterating, you can drop back to Free — you won't need daily credits once it's deployed.

### How do I prevent buddy-punching?

Three controls work together. First, the UNIQUE constraint on (user_id, event_id, date) blocks the simplest case — two people using the same account to check in twice, or one person tapping Check In twice accidentally. Second, the short-lived QR token (15-minute expiry, rotated by generate-qr-token) means a screenshot of the QR code becomes useless after 15 minutes. Third, the geo-fence check inside the check_in RPC rejects check-ins from outside the venue radius. The combination of QR + geo is much harder to defeat than either alone — someone would need to be physically present at the venue AND have the current QR code. A determined adversary with two devices and GPS spoofing can still defeat this, but that's a much higher bar than most small-business attendance fraud.

### What if my venue has bad GPS reception?

Increase the radius_m for that event in /admin/events. Indoor GPS accuracy varies from 50m (open atrium) to 500m (underground, thick concrete). The check_in RPC factors check_in_accuracy_m into the comparison — it checks if (distance - accuracy) <= radius, giving the user credit for GPS uncertainty. Set radius_m to 200-400m for most office buildings and 400-600m for warehouses or basements. If GPS is completely unreliable at your venue (e.g. a basement or a building with GPS-blocking film on windows), you can disable geo-fence per event by setting location_lat to NULL — the check_in RPC skips the haversine check when location_lat IS NULL.

### Can I export to payroll software like Gusto, Xero, or ADP?

The export-csv follow-up generates a CSV with employee_code, full_name, check-in/out times in local timezone, and decimal hours worked. All major payroll platforms (Gusto, Xero, ADP, QuickBooks) accept CSV imports. The column names in the export match what these platforms typically expect for time-entry imports. For automated sync (rather than manual CSV upload), you'd need to write to the payroll platform's API from a scheduled Edge Function — that is a custom integration, not covered in this kit.

### What about offline check-in when WiFi is down?

This kit requires an internet connection for check-in — the Edge Function call and geo validation happen server-side. There is no offline mode. If your venue has unreliable WiFi, consider a few options: ensure attendees use cellular data (4G/5G) rather than WiFi for check-in; deploy a local WiFi access point that connects to the internet via cellular backup; or for truly offline scenarios (remote sites, basements), use a different approach such as NFC card taps logged locally and synced when connectivity is restored — that is a hardware integration outside this kit's scope.

### Can I use barcode badge scans instead of QR codes?

Yes, with minor changes. Replace the QR token with a barcode value stored in profiles.employee_code (already in the schema). The admin scans the barcode with a USB barcode scanner (which types the code into a focused input), and the check-in form auto-submits when the input receives a barcode value. You'd replace the check_in RPC's token validation with an employee_code lookup instead. The geo-fence check can remain or be disabled depending on whether your venue requires it.

### Can RapidDev build a custom attendance system for my fleet of locations?

If your build outgrows this prompt kit and you need custom architecture, RapidDev builds production-grade Lovable apps at $13K-$25K — book a free 30-minute consultation at rapidevelopers.com.

---

Source: https://www.rapidevelopers.com/lovable-prompts/lovable-prompts-for-building-attendance-app
© RapidDev — https://www.rapidevelopers.com/lovable-prompts/lovable-prompts-for-building-attendance-app
