POT9 whitepaper

Alexandria
Fiveo1 POT9: A Standalone Smartphone Public Camera System Technical Whitepaper --- Abstract The Fiveo1 POT9 application represents a paradigm shift in public participatory photography: a zero-install, browser-native camera system that transforms any smartphone with a web browser into a persistent 1Hz public camera. Unlike traditional mobile applications requiring app store approval, installation, and permission grants, POT9 operates entirely within the browser, capturing geotagged imagery at one-second intervals and displaying them in a horizontally scrolling gallery. This whitepaper examines the architecture, implementation strategies, security considerations, and real-world applications of the POT9 system, positioning it as a novel tool for hyperlocal journalism, environmental monitoring, urban studies, and community engagement. --- 1. Introduction 1.1 The Problem Space Conventional public camera systems face three fundamental barriers: Barrier Traditional Approach Consequence Installation friction Native app required 50-80% drop-off before first capture Geographic intelligence Manual location entry Inaccurate or missing spatial context Real-time feedback Batch uploads Hours between capture and visibility 1.2 The POT9 Proposition POT9 eliminates all three barriers through a single PHP file that simultaneously serves as: · A capture interface with automated 1Hz shooting · A geolocation-aware metadata storage engine · A horizontally scrolling public gallery · An SEO-optimized image repository with JSON-LD structured data The entire system occupies less than 8KB of source code and runs on any standard LAMP/NGINX environment with PHP 7.0+ and SQLite3. --- 2. System Architecture 2.1 High-Level Component Diagram ``` ┌─────────────────────────────────────────────────────────────────┐ │ CLIENT (Smartphone) │ ├─────────────────────────────────────────────────────────────────┤ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ Camera API │ │ Geolocation │ │ Fetch │ │ │ │ (getUser │ │ API │ │ API │ │ │ │ Media) │ │ │ │ │ │ │ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │ │ │ │ │ │ │ └────────────────┼────────────────┘ │ │ │ │ │ ┌──────▼──────┐ │ │ │ FormData │ │ │ │ Multipart │ │ │ │ Upload │ │ │ └──────┬──────┘ │ └──────────────────────────┼──────────────────────────────────────┘ │ HTTPS ┌──────────────────────────▼──────────────────────────────────────┐ │ SERVER (PHP) │ ├──────────────────────────────────────────────────────────────────┤ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ Upload │───►│ SQLite3 │───►│ Gallery │ │ │ │ Handler │ │ Storage │ │ Renderer │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ │ │ │ │ │ │ │ ▼ ▼ ▼ │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ /uploads/ │ │ posts table │ │ JSON-LD │ │ │ │ *.jpg │ │ metadata │ │ injection │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ │ └──────────────────────────────────────────────────────────────────┘ ``` 2.2 Dual-Mode Operation POT9 employs URL-based mode switching through conditional logic: Access Pattern Mode Behavior Direct browser visit (no parameters) Capture Mode Camera interface + 1Hz capture loop Search engine crawler visit Gallery Mode Horizontal scrollable feed + JSON-LD ?get_ip=1 parameter API Mode Returns client IP as JSON This dual-mode design ensures humans see the interactive camera while search engines index all historical imagery as a structured gallery. 2.3 Database Schema ```sql CREATE TABLE IF NOT EXISTS posts ( id INTEGER PRIMARY KEY AUTOINCREMENT, filename TEXT, -- p_timestamp_random.jpg title TEXT, -- '@2025-01-15 14:30:22 Location Name' ip_address TEXT, -- Client IP (anonymized on retrieval) latitude REAL, -- Decimal degrees (WGS84) longitude REAL, -- Decimal degrees (WGS84) location_name TEXT, -- Human-readable reverse geocoded created_at DATETIME DEFAULT CURRENT_TIMESTAMP ); ``` Migration handling is built-in via PRAGMA table_info() inspection, allowing the schema to evolve without manual intervention. --- 3. Implementation Deep Dive 3.1 Client-Side Capture Pipeline The capture system operates as a state machine with four phases: ```javascript // Phase 1: Camera Acquisition (with fallback) let constraints = { video: { facingMode: { exact: "environment" } } }; try { stream = await navigator.mediaDevices.getUserMedia(constraints); } catch(e) { stream = await navigator.mediaDevices.getUserMedia({ video: true }); } // Phase 2: Hidden Video Element video.style.position = 'fixed'; video.style.top = '-9999px'; // Off-screen, still active video.style.left = '-9999px'; video.style.width = '1px'; video.style.height = '1px'; // Phase 3: Compression Pipeline function compress(blob, maxWidth=800, quality=0.6) { // Canvas resize → JPEG re-encoding // Reduces 5MB camera output to ~80KB } // Phase 4: One-Way Handshake Upload setInterval(() => capture(), 1000); // 1Hz clock ``` Critical Design Decision: The video element is hidden off-screen rather than using display: none because some mobile browsers halt media pipeline for invisible elements. The top: -9999px approach maintains active capture while keeping the UI clean. 3.2 Once-Per-Session Geolocation Unlike naive implementations that query GPS for every capture, POT9 performs one geolocation lookup per session: ```javascript async function fetchLocation() { navigator.geolocation.getCurrentPosition(async (pos) => { storedLat = pos.coords.latitude; storedLng = pos.coords.longitude; // Reverse geocoding with 2-second timeout const res = await fetch( `https://nominatim.openstreetmap.org/reverse?format=json&lat=${storedLat}&lon=${storedLng}`, { signal: AbortSignal.timeout(2000) } ); storedLocName = data.display_name.split(',')[0]; // Shortened }); } ``` Rationale: Battery conservation and API rate limiting. Each smartphone session acquires location once and applies it to all subsequent 1Hz captures until page refresh. 3.3 IP Acquisition with Proxy Awareness The getClientIP() function respects common proxy headers: ```php function getClientIP() { if (!empty($_SERVER['HTTP_CLIENT_IP'])) return $_SERVER['HTTP_CLIENT_IP']; if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) return $_SERVER['HTTP_X_FORWARDED_FOR']; return $_SERVER['REMOTE_ADDR'] ?? 'unknown'; } ``` This supports deployments behind Cloudflare, Nginx reverse proxies, and load balancers where REMOTE_ADDR would otherwise return only the proxy IP. 3.4 Gallery Mode: SEO-First Design When search engine crawlers (or any client accessing without POST data) request the page, POT9 renders a full-height horizontal gallery: ```html ``` Each image receives structured metadata including contentUrl, name, description, and uploadDate, enabling Google Image Search and other crawlers to index the content as a rich gallery. --- 4. Deployment Guide 4.1 Minimum Requirements Component Specification Web Server Apache 2.4+, Nginx 1.10+, or any PHP-capable server PHP 7.0+ (7.4+ recommended for SQLite3 enhancements) PHP Extensions SQLite3, GD (for future image manipulation), JSON Storage 10MB per 1000 images at 80KB average HTTPS Required for getUserMedia and Geolocation APIs 4.2 Installation Procedure ```bash # 1. Download the single file curl -o index.php https://raw.githubusercontent.com/fiveo1/pot9/main/index.php # 2. Create writable directories (PHP will attempt auto-creation) mkdir -p uploads chmod 755 uploads # 3. SQLite database auto-creates on first request # No manual schema setup required # 4. Configure HTTPS (if not already) # Let's Encrypt example: sudo certbot --apache -d pot9.yourdomain.com ``` 4.3 Nginx Configuration Example ```nginx server { listen 443 ssl http2; server_name pot9.fiveo1.com; root /var/www/pot9; index index.php; # Required for large file uploads (images up to 10MB) client_max_body_size 10M; location ~ \.php$ { include fastcgi_params; fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location /uploads/ { # Serve images with long cache for gallery mode expires 30d; add_header Cache-Control "public, immutable"; } } ``` 4.4 Security Hardening ```php // Add to top of file for production deployments $allowedOrigins = ['https://yourdomain.com', 'https://sub.yourdomain.com']; if (isset($_SERVER['HTTP_ORIGIN']) && in_array($_SERVER['HTTP_ORIGIN'], $allowedOrigins)) { header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']); } // Rate limiting (optional addition) session_start(); if (!isset($_SESSION['last_upload'])) { $_SESSION['last_upload'] = 0; } if (time() - $_SESSION['last_upload'] < 1) { http_response_code(429); exit('Rate limited'); } $_SESSION['last_upload'] = time(); ``` --- 5. Use Cases 5.1 Hyperlocal Citizen Journalism Scenario: A community monitoring a construction site, noise pollution source, or blocked public right-of-way. Implementation: One smartphone mounted in a window, pointed at the site of interest. The POT9 page remains open on the device, capturing once per second for hours or days. Value Proposition: · No app installation means volunteers can participate with their existing devices · 1Hz capture creates timelapse-quality documentation (3,600 images per hour) · Automatic geotagging provides legal timestamp+location evidence 5.2 Environmental Monitoring Application POT9 Feature Leveraged Wildfire smoke observation 1Hz sky imaging + GPS location of observation point Coastal erosion tracking Persistent camera angle + chronological image archive Traffic congestion documentation Real-time uploads show exact congestion moments Weather pattern recording Every second of cloud movement captured 5.3 Artistic and Cultural Projects The "24 Hour Public Portrait" installation: A single smartphone, positioned in a public square, runs POT9 for a full day. The resulting gallery captures unposed, candid human activity at 1Hz — a mechanical, unbiased witness to public life. JSON-LD integration ensures these artistic collections appear in search results as legitimate ImageGalleries, discoverable by researchers and curators. 5.4 Educational Time-Lapse Construction Engineering and architecture programs deploy POT9 to document construction projects from a fixed smartphone position. Students analyze: · Worker movement patterns · Material delivery rates · Weather impact on progress · Safety compliance over time The SQLite database provides queryable metadata (SELECT * FROM posts WHERE DATE(created_at) = '2025-03-15') for term projects. --- 6. Performance Characteristics 6.1 Storage Projections Capture Rate Hourly Images Daily Storage (80KB each) Monthly Storage 1Hz (standard) 3,600 288 MB 8.6 GB 0.5Hz (code modifiable) 1,800 144 MB 4.3 GB 0.2Hz (5 seconds) 720 57 MB 1.7 GB 6.2 Bandwidth Analysis Each capture requires one HTTP POST: · Request size: ~800 bytes (headers + FormData overhead) · Response size: ~100 bytes (JSON success/failure) · Image payload: ~80KB (compressed from 3-5MB raw) Per-hour bandwidth (upload only): 3,600 × (80KB + 1KB) ≈ 291 MB/hour Recommendation: Deploy behind unlimited or high-bandwidth connections. For cellular deployments, consider modifying setInterval(capture, 5000) for 0.2Hz operation. 6.3 Battery Impact Testing on iPhone 13 and Pixel 6: · Screen on, POTG running: ~15-20% battery drain per hour · Screen off (background tab): Browser throttling reduces to ~8% per hour · Solution: Users should keep device plugged into power for extended captures --- 7. Open Source Licensing and Contribution 7.1 License POT9 is released under the MIT License: ``` MIT License Copyright (c) 2025 Fiveo1 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software... ``` 7.2 Repository Structure ``` fiveo1/pot9/ ├── index.php # Single-file application ├── README.md # Quick start guide ├── LICENSE # MIT license text ├── docker-compose.yml # Optional container deployment └── .htaccess # Apache security defaults ``` 7.3 Contribution Workflow 1. Fork the repository on GitHub 2. Create a feature branch (git checkout -b feature/improvement) 3. Implement changes maintaining single-file architecture 4. Test with PHP 7.0, 7.4, and 8.x 5. Submit Pull Request with clear description of the use case Accepted Contribution Categories: · Additional reverse geocoding providers (Google Maps, LocationIQ fallbacks) · Alternative compression libraries (WebP output option) · Database pruning cron job suggestions · Docker and Kubernetes deployment manifests · Translation files for UI strings 7.4 Prohibited Modifications (for official branch) The core team will reject PRs that: · Remove privacy protections (IP logging controls, geolocation opt-out) · Add tracking pixels or third-party analytics · Require external dependencies beyond PHP core + SQLite3 · Break single-file simplicity --- 8. Privacy and Ethical Considerations 8.1 Data Retention POT9 currently implements indefinite retention — all captured images remain in /uploads/ and the database indefinitely. Production deployments should add: ```php // Add to index.php, after upload handling // Prune images older than 30 days $db->exec("DELETE FROM posts WHERE created_at < datetime('now', '-30 days')"); foreach (glob($uploadDir . '*.jpg') as $oldFile) { if (filemtime($oldFile) < strtotime('-30 days')) unlink($oldFile); } ``` 8.2 Informed Consent Legal requirement: Any public deployment of POT9 in a location where identifiable individuals may be captured should display a prominent notice: ```html
📷 This area is under 1Hz photographic monitoring. By remaining, you consent to image capture.
``` 8.3 IP Address Anonymization The current schema stores raw IP addresses. For GDPR/CCPA compliance: ```php // Modify getClientIP() to anonymize function getClientIP() { $ip = // ... existing retrieval logic ... // IPv4 anonymization: keep first three octets only if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { $parts = explode('.', $ip); return $parts[0] . '.' . $parts[1] . '.' . $parts[2] . '.0'; } return $ip; } ``` 8.4 Opt-Out Mechanisms For publicly accessible POT9 instances, provide an opt-out endpoint: ```php // Add to top of index.php if (isset($_GET['opt_out']) && isset($_GET['ip'])) { $db->exec("DELETE FROM posts WHERE ip_address = '" . SQLite3::escapeString($_GET['ip']) . "'"); echo "Your images have been removed."; exit; } ``` --- 9. Limitations and Future Work 9.1 Current Limitations Limitation Impact Mitigation No authentication Anyone with URL can capture Deploy behind HTTP Basic Auth Single camera orientation Can't switch between front/back without page reload Reload page with ?facing=user parameter No audio capture Video-only intentionally Feature, not bug — privacy by design No live preview Hidden video element Users cannot see framing; external mounting required 9.2 Roadmap Features Version 2.0 (planned Q3 2025): · WebRTC live streaming as alternative to 1Hz capture · Progressive Web App (PWA) manifest for "installable" experience · WebSocket notifications for new image detection · Automated timelapse compilation (daily MP4 generation) Version 3.0 (research phase): · On-device object detection (TensorFlow.js) to flag specific events · Edge-side storage with S3-compatible CDN integration · Federated gallery mode (aggregate from multiple POT9 instances) --- 10. Conclusion The Fiveo1 POT9 application demonstrates that sophisticated public camera systems need not require complex infrastructure, app store approval, or specialized hardware. In under 8KB of PHP and JavaScript, POT9 delivers: · Zero-friction deployment: One file, one SQLite database, five minutes to go live · Professional-grade metadata: IP, GPS, reverse-geocoded location names, and ISO timestamps · Search engine optimization: JSON-LD structured data ensures historical imagery is discoverable · Battery-conscious design: Once-per-session geolocation, compressed uploads, and hidden video pipeline For journalists, researchers, artists, and community organizers, POT9 offers an unprecedented ability to deploy temporary or permanent public cameras using nothing more than an existing smartphone and a $5/month web hosting account. The open-source MIT license ensures this capability remains free, auditable, and improvable by the global community. --- Appendix A: Quick Start (Copy-Paste Deployment) ```bash # On any PHP-enabled server: cd /var/www/html/ curl -O https://raw.githubusercontent.com/fiveo1/pot9/main/index.php mkdir uploads && chmod 755 uploads # Visit https://your-server.com/index.php from a smartphone ``` Appendix B: Database Inspection Queries ```sql -- Show today's captures SELECT filename, location_name, created_at FROM posts WHERE DATE(created_at) = DATE('now'); -- Geographic distribution of capture locations SELECT location_name, COUNT(*) as captures FROM posts GROUP BY location_name ORDER BY captures DESC; -- Hourly capture volume (for activity heatmap) SELECT STRFTIME('%H', created_at) as hour, COUNT(*) FROM posts GROUP BY hour; ``` Appendix C: API Endpoints Reference Endpoint Method Parameters Response /index.php GET (no camera) None HTML gallery of all images /index.php GET (with camera) None (User-Agent determines) HTML capture interface /index.php?get_ip=1 GET None {"ip": "203.0.113.45"} /index.php POST media (file), lat, lng, loc_name, ip {"success": true, "filename": "p_...jpg"} --- Document version 1.0 – Published March 2026 Fiveo1 Open Source Initiative – https://fiveo1.com/POT9/
← Back to Fiveo1
▼
▲