How arkdutt/pbs-wi-1 works
Project type and purpose
• This is a full-stack Augmented Reality (AR) web application (“Forward Rewind AR Web App”) built with a React front end and a small Python back end. Its purpose is to provide an immersive, interactive virtual tour guide experience using image-based AR markers and multimedia content.
File structure
• Top-level directories/files:
• backend/ – Python code (server.py, qr.py) plus a qr_codes folder
• public/ – Static HTML entry point (index.html) and manifest/robots configs
• src/ – React application source (components, assets, styles)
• package.json & package-lock.json – Node.js dependencies and scripts
• requirements.txt – Python dependencies
• Key patterns:
• Client-server split: frontend (React + MindAR + A-Frame) vs. backend (Flask or similar)
• Frontend organized by reusable UI components, global styles, and assets
• Backend focuses on QR code generation and (presumably) serving those codes or related API endpoints
README for additional insights
• Confirms tech stack: React, A-Frame, MindAR for AR; Python for QR code generation
• Describes user flows: camera access → scan marker → load AR model + audio + captions
• No database—content is static assets and QR images
• Development run: “npm start” for front end; Python server likely run separately
a. Main components
1. User Device & Browser
2. React Frontend
– UI Components (BackButton, Card, MindARViewer, etc.)
– MindAR + A-Frame AR engine
– Static assets (models, audio, captions)
3. Python Backend
– qr.py: generates QR code images
– server.py: exposes REST endpoints (e.g., GET /qr-codes/:id)
– Static QR folder (backend/qr_codes)
4. External Resources
– Device’s Camera API
– PBS Wisconsin content repository (future external CMS or asset store)
b. Relationships & data flow
• On app load, React app is served via Node dev server (npm start) from public/index.html
• React components request AR assets from local asset folder or from the Python backend for dynamic QR images
• User grants camera access; camera feed → MindARViewer component → image-tracking algorithm
• On marker detection, MindAR pulls corresponding AR model, audio, caption JSON from static assets
• QR code generation requests (if dynamic) flow from frontend → /api/qr endpoint → server.py → qr.py → new image → backend/qr_codes → served back
c. Architectural patterns & design principles
• Client‐Server Separation: Clear split of concerns between React UI & Python API
• Component‐Based UI: Reusable React components encapsulate AR viewer, navigation, popups
• Static Asset Hosting: All AR models, audio, and captions co‐located under src/assets
• No persistent database: QR codes and AR content are file-based, simplifying deployment
d. Key technologies/frameworks
• React (create-react-app conventions under src/)
• MindAR + A-Frame for browser‐based AR / image tracking
• Node.js (npm) for dev server & build tooling
• Python (Flask or similar) for backend endpoints & QR code generation