Developing a Mobile App for Hot Desk Rental
Hot desking—employees aren't assigned fixed desks but book seats per day. Seems simple until real scenarios arise: two people book same desk simultaneously, employee arrives unable to find "their" spot, HR can't see actual space utilization. The app solves all this—through interactive office map, booking with race condition protection, and QR check-in.
Interactive Office Map
Floor plan—SVG, not raster. SVG lets you highlight specific desks, show status (free/booked/occupied), scale without quality loss.
iOS: WKWebView with SVG—fastest path, but lose native gestures. Better: parse SVG into CGPath objects, render via CAShapeLayer in native UIView. Gestures—UIPinchGestureRecognizer (zoom) + UIPanGestureRecognizer (pan) via CGAffineTransform. Tap desk—hitTest via CGPath.contains(point).
Android: Canvas + Matrix for transforms. Lower-level but full control. Or AndroidSVG library + TouchImageView for gestures.
Flutter: CustomPainter with Path objects—works well, cross-platform.
Map data: JSON describing each desk—id, desk_code (A-12), floor, zone, amenities (monitor/standing/phone), svg_path_id for SVG binding. Loaded on startup and cached locally.
Real-time desk status: WebSocket event desk.status_changed with desk_id and new status. Client updates color of specific desk without reloading entire map. Polling fallback—every 30 seconds if WS unavailable.
Conflict-Free Booking
Race condition on booking—classic problem. Two users simultaneously see desk free and tap "book".
Server protection: optimistic locking via version field in desk_reservation or SELECT FOR UPDATE on creation. Unique constraint (desk_id, date, time_slot) in PostgreSQL—final safeguard. If booked—API returns 409 Conflict, client shows "just booked" and refreshes map.
Booking structure: desk_id, user_id, date, start_time, end_time, status (confirmed/checked_in/cancelled/no_show). Support recurring bookings (recurrence via rrule).
Time slots: flexible—full day or blocks (9-13, 13-18). Configurable in admin. For coworking—hourly rental.
QR Check-In
Come to work → open app → scan QR on desk → check-in recorded.
QR on each desk: contains desk_id + signature (HMAC-SHA256) to prevent manual generation. QR validity—perpetual (it's physical), but check-in via it only works if user has active booking for this desk today.
Scanning: AVCaptureMetadataOutput (iOS) / ML Kit Barcode (Android). After successful check-in—haptic feedback + confirmation animation + desk status change to occupied on map.
No-show detection: if booking started 30 minutes ago, no check-in—status changes to no_show, desk freed for others. Configurable threshold.
Utilization Analytics
For HR and office manager: utilization percent by zones and floors, peak hours, no-show rate, most popular desks. Export to Excel/CSV.
Heatmap on office plan: color scale green (rarely used) to red (always occupied) from historical data over period. Helps decide rearrangement optimization.
Timeline
Basic app (office map, booking, QR check-in)—4-6 weeks. With multi-floor, analytics, access control/Active Directory integration, recurring bookings—2-3 months. Cost estimated individually.







