A comprehensive Next.js web application for managing AR treasure hunt events, featuring volunteer dashboards and treasure setup interfaces.
- Real-time Team Management: View and manage registered teams with live database sync
- Score Tracking: Monitor AR game scores and physical challenge scores
- Tabular Physical Scoring: Detailed scoring system with volunteer attribution and benchmarks
- Hunt Control: Password-protected start/end hunt functionality
- Team Progress: Track clue completion and session status
- Admin Controls: Reset all teams and manage hunt state
New Feature for Frontman Setup
- Image Capture: WebRTC camera integration for capturing treasure marker images
- ARCore Validation: Automatic image quality validation using
arcoreimg - GPS Integration: Capture precise coordinates for each treasure location
- Server Upload: Automatic upload to configured server endpoint
- Interactive Clue Builder: Rich interface for creating treasure hunt clues
- Physical Challenge Setup: Optional physical game configuration with secret codes
- Progress Tracking: Monitor treasure hiding progress with counter
- Web-config.JSON Generation: Automatic configuration file creation for Unity AR app
Edit config.ts to change your development server:
export const config = {
server: {
// π CHANGE THIS to your ngrok or development server URL
baseUrl: 'https://your-new-url.ngrok-free.app',
endpoints: {
uploadImage: '/upload-treasure-image',
uploadWebConfig: '/upload-web-config'
},
headers: {
'ngrok-skip-browser-warning': 'true',
}
},
arcore: {
// Minimum score required for image validation (0-100)
minValidationScore: 75,
command: 'arcoreimg'
},
app: {
// Default maximum treasures per session
defaultMaxTreasures: 5,
debugMode: true
}
};- π Update Server URL: Change
baseUrlinconfig.tsto your server - π Run Dev Server:
npm run dev - πΈ Test Camera: Navigate to "Hide Treasures" and test functionality
- ποΈ Deploy:
npm run build && npm startfor production
- Framework: Next.js 13 with TypeScript
- Database: Firebase Realtime Database
- Authentication: Firebase Anonymous Auth
- File Upload: Formidable for multipart form handling
- Image Processing: ARCore Image Evaluation (
arcoreimg) - Styling: CSS-in-JS with styled-jsx
- Configuration: Centralized config system
- Node.js 16+
arcoreimg(Google ARCore Image Tool)- Development server (ngrok, localhost, etc.)
-
Install Dependencies:
npm install
-
Configure Server URL:
- Open
config.tsin root directory - Update
server.baseUrlwith your server URL
baseUrl: 'https://your-server.ngrok-free.app' - Open
-
Configure Firebase:
- Update Firebase config in
lib/firebase.ts - Ensure Realtime Database rules allow read/write access
- Update Firebase config in
-
ARCore Setup:
- Install Google ARCore SDK Tools
- Ensure
arcoreimgis in system PATH - Adjust validation threshold in
config.tsif needed
-
Server Setup:
- Configure your server to accept:
POST /upload-treasure-image(multipart image upload)POST /upload-web-config(JSON configuration)
- Configure your server to accept:
# Start development server
npm run dev
# Build for production
npm run build
npm start
# Lint code
npm run lint| Setting | Description | Default |
|---|---|---|
server.baseUrl |
Main server URL | ngrok URL |
arcore.minValidationScore |
Image quality threshold (1-100) | 75 |
app.defaultMaxTreasures |
Max treasures per session | 5 |
app.debugMode |
Enable console logging | true |
- Method: POST (multipart/form-data)
- Purpose: Validates images with ARCore and uploads to server
- Fields:
image,imageName,latitude,longitude - Returns:
{ success, score, uploadUrl }
- Method: POST (JSON)
- Purpose: Updates Web-config.JSON with treasure data
- Body:
{ treasures: TreasureData[] } - Returns:
{ success, configPath, treasureCount }
interface TreasureData {
imageName: string;
fileName: string;
physicalSizeInMeters: number;
clueIndex: number;
clueName: string;
spawnOffset: { x: number; y: number; z: number };
spawnRotation: { x: number; y: number; z: number };
clueText: string;
latitude: number;
longitude: number;
hasPhysicalGame: boolean;
physicalGameInstruction: string;
physicalGameSecretCode: string;
}- Access main dashboard (
/) - Monitor team progress and scores
- Use tabular scoring for physical challenges
- Control hunt start/end with password protection
- Configure: Update server URL in
config.ts - Navigate to "Hide Treasures" from admin controls
- Grant GPS and camera permissions
- Capture high-quality images of treasure locations
- System validates images with ARCore (>75 score required)
- Create engaging clues for each treasure
- Configure optional physical challenges
- System generates
Web-config.JSONfor Unity AR app
β Good Images:
- Rich visual features (signs, artwork, detailed textures)
- High contrast between light and dark areas
- Sharp focus with clear edges and corners
- Unique patterns and distinctive elements
β Avoid:
- Blank walls or featureless surfaces
- Repetitive patterns (brick, carpet)
- Reflective or shiny surfaces
- Blurry or low-contrast images
βββ config.ts # π Configuration file
βββ pages/
β βββ index.tsx # Main volunteer dashboard
β βββ hide-treasures.tsx # Frontman treasure setup
β βββ api/
β βββ validate-and-upload-image.ts
β βββ update-web-config.ts
βββ components/
β βββ Layout.tsx # Shared layout component
βββ lib/
β βββ firebase.ts # Firebase configuration
β βββ firestore.ts # Database operations
βββ public/
βββ Web-config.JSON # Generated treasure configuration
- Admin actions require password authentication (
ananthJEE2@) - Firebase uses anonymous authentication for basic access
- ARCore validation prevents low-quality tracking images
- GPS permissions required for accurate treasure positioning
- Server URL configured in single location for security
- Wrong Server URL: Update
config.tswith correct server URL - API Endpoints: Ensure server accepts the configured endpoints
- Headers: Modify
config.server.headersfor your server requirements
- Ensure
arcoreimgis accessible in PATH - Check image quality if validation fails
- Adjust
config.arcore.minValidationScoreif needed
- Confirm server URL is correct in
config.ts - Check network connectivity
- Verify server accepts multipart uploads
- Grant browser camera permissions
- Use HTTPS for production deployment
- Test on modern browsers with WebRTC support
Version: 1.3 - Added Hide Treasures Interface + Configuration System
Last Updated: 2025-01-25