Enhanced Check-in System
The application features an enhanced check-in system that prioritizes ease of use for food truck owners.
Overview
The check-in system allows food truck owners to broadcast their current location to customers. It supports two main flows:
-
Default Flow: GPS-based nearby addresses discovery
-
Secondary Flow: Advanced map picker for custom locations
Default Flow: Nearby Addresses
This is the primary, streamlined check-in experience:
-
User clicks "Check In"
-
GPS location is obtained automatically
-
Radar SDK searches for nearby addresses/places within 500m
-
User selects from 3-5 closest addresses with distance indicators
-
One-click check-in at selected location
Secondary Flow: Advanced Map Picker
For situations where the nearby addresses don’t match the desired location:
-
User clicks "Choose Different Location"
-
Interactive map opens with search functionality
-
User can search for addresses or click on map
-
Optional notes can be added
-
Check-in with selected location
Features
- GPS-based Discovery
-
Automatic location detection using the device’s GPS.
- Distance Indicators
-
Shows how far each address is from the current position (e.g., "50m", "0.2km").
- Address Types
-
Displays location types such as restaurant, park, business, etc.
- Graceful Fallbacks
-
Falls back to map picker if GPS fails or is unavailable.
- Error Handling
-
User-friendly error messages with alternatives when issues occur.
Time Span Options
Check-ins support automatic checkout with configurable durations:
| Option | Description |
|---|---|
1 Hour |
Check out automatically after 1 hour |
2 Hours |
Check out automatically after 2 hours |
4 Hours |
Check out automatically after 4 hours |
8 Hours |
Check out automatically after 8 hours |
All Day |
Check out at end of business day (6 PM) |
Until Time |
Check out at a specific time |
Custom |
Custom duration in minutes |
Checkout Types
Check-ins can end in three ways:
- Manual
-
Owner manually checks out the truck.
- Automatic
-
System automatically checks out when the time span expires.
- Superseded
-
A new check-in replaces the previous active one.
Related Components
-
components/food-trucks/truck-checkin.tsx- Main check-in component -
components/food-trucks/truck-checkin-demo.tsx- Demo/testing component -
components/food-trucks/current-location.tsx- Current location display -
components/food-trucks/location-selector.tsx- Location selection UI -
components/map/location-picker.tsx- Interactive map picker
API Actions
The check-in system uses these server actions from app/actions/food-trucks.ts:
-
checkInTruck- Create a new check-in -
checkOutTruck- Manually check out -
getTruckCurrentLocation- Get current location with priority resolution -
getTruckCheckInHistory- Get check-in history with pagination -
getTruckCheckInStats- Get check-in statistics