Photo capture app for Mentra smart glasses with TEE attestation and Supabase storage.
EigenSnap/
├── mentra-app/ # Web app for Mentra glasses
│ ├── index.html # Camera UI
│ ├── app.js # Photo capture logic
│ └── config.js # Configuration
├── backend/ # TEE backend (coming next)
│ └── (will add later)
└── README.md
- Camera access on Mentra glasses
- Photo capture with preview
- Local storage of photo metadata
- Recent photos list
- 50MB max photo size
- JPEG compression
- Simple Express server to receive photos
- Save photos to local filesystem
- Photo metadata tracking
- Cryptographic signing of photos
- Image hash generation
- Timestamp attestation
- TEE address verification
- Supabase storage bucket setup
- Photo upload to Supabase
- Metadata database
- Public photo gallery
Option A: Vercel
- Push this repo to GitHub
- Import to Vercel
- Set root directory:
mentra-app - Deploy
- Copy deployment URL
Option B: Local Testing
- Serve the
mentra-appdirectory:
cd mentra-app
python3 -m http.server 8080- Access at http://localhost:8080
- Go to https://console.mentraglass.com
- Create/edit your app
- Set Server URL to your deployment URL
- Install app on glasses
- Launch EigenSnap on glasses
- Tap "Start Camera"
- Tap "Take Photo"
- Review preview
- Tap "Upload Photo" (saves locally for now)
Current (Phase 1):
- 📸 Camera access with back camera
- 🖼️ Photo capture and preview
- 💾 Local storage of photos
- 📋 Recent photos list
- ✓ Photo metadata (size, format, timestamp)
- ↺ Retake functionality
Coming Soon:
- 🔐 TEE cryptographic attestation
- ☁️ Supabase cloud storage
- 🌐 Public photo gallery
- ✅ Photo verification
- 📊 Photo analytics
Edit mentra-app/config.js:
const APP_CONFIG = {
appName: "EigenSnap",
maxPhotoSize: 50 * 1024 * 1024, // 50MB
photoQuality: 0.92, // JPEG quality
camera: {
facingMode: 'environment', // Back camera
idealWidth: 1920,
idealHeight: 1080
}
};Mentra Glasses (Camera App)
↓
Capture Photo (JPEG, max 50MB)
↓
POST /api/photo
↓
┌─────────────────────────────────────┐
│ TEE Backend │
│ 1. Validate image │
│ 2. Generate hash (SHA-256) │
│ 3. Create attestation │
│ 4. Sign with TEE key │
│ 5. Upload to Supabase │
└─────────────────────────────────────┘
↓
Supabase Storage + Database
• Image file (Storage)
• Metadata (Database):
- photo_id
- image_hash
- tee_signature
- timestamp
- tee_address
- Phase 1: Photo capture UI
- Camera access and preview
- Photo capture and compression
- Local metadata storage
- Phase 2: Basic backend
- Express server
- Photo upload endpoint
- Local file storage
- Phase 3: TEE attestation
- Image hashing
- Cryptographic signing
- Attestation verification
- Phase 4: Supabase integration
- Storage bucket setup
- Database schema
- Photo upload flow
- Public gallery
Mentra App:
- Vanilla JavaScript
- Mentra Camera API
- localStorage for metadata
Backend (Coming):
- Node.js + Express
- Ethers.js (for TEE signing)
- Supabase SDK
Storage (Coming):
- Supabase Storage (images)
- Supabase Database (metadata)
MIT