How wickypolineni/vision_ai_js works
Main Components
• User Interface (UI) Layer: Represented by the HTML files (index.html, live/index.html) and styled by CSS files (style.css, live/live.css).
• Application Logic: The JavaScript files (script.js, live/live.js, prompts.js, live/prompts.js) that handle event handling, live mode functionalities, API key management, and interactions with the Google Gemini API.
• External Service: The Google Gemini API, which is integrated to process images in real time and provide analysis (the core “AI behind the scenes”).
• Assets: The images folder (for static assets) and any additional resources the UI uses.
• Deployment/Live Environment Module: The “live” directory indicates a special mode of operation (or a separate build) that might have additional or different behavioral logic.
Relationships and Interactions
• Users interact with the UI through a web browser by visiting index.html or the live mode URL.
• The UI sends user inputs (like image snapshots and API key entries) to the client-side JavaScript.
• The JavaScript, acting as the business logic layer, handles these events and communicates with the external Google Gemini API to fetch image analysis or perform live tracking.
• Responses from the API are then processed in JavaScript and rendered back on the UI.
• For live mode, similar interactions occur but are continuously executed for real-time analysis.
Architectural Patterns and Principles
• Separation of concerns is evident – HTML for structure, CSS for appearance, and JavaScript for behavior.
• A modular approach is used by separating live mode functionality into its own directory, implying some level of separation (or even a possible micro-frontend approach) within the same project.
• The system leverages an external API (Google Gemini API), meaning a clear boundary exists between local processing and external services.
Relevant Technologies
• Frontend: Vanilla JavaScript, HTML, and CSS.
• External Service: Google Gemini API (using keys provided by the user).
• Deployment: Static hosting approach, with separate live and standard modes.