How deeppcodes/labellens works
Overall Project Type & Purpose
• LabelLens is built as a full-stack application designed to help users look up and understand ingredients in skincare, cosmetics, and medicine.
• It leverages real-time research by using Retrieval Augmented Generation (RAG) with Google Gemini on GCP, while its vector database (Weaviate) stores the ingredient data.
• The system eliminates bias by avoiding brand partnerships and relying on vetted databases.
Main Components
a. Frontend:
• Built in React (components, pages, assets, and styles) and styled with Tailwind CSS.
• The entry point is visible via index.html and files in the src/ directory (e.g., App.jsx, components, pages).
b. Backend:
• A Node.js server (server.js) acts as the API layer and routes incoming requests.
• Likely handles communication with both the frontend and external services.
c. External AI & Research Service:
• Google Gemini and associated GCP components (Docker, Kubernetes) handling the real-time AI analysis using RAG.
d. Data Storage – Vector Database:
• Weaviate is used for vector search capabilities. There are backup directories (weaviate_backup) indicating Weaviate’s role in preserving the data related to ingredients (e.g., adverse events, cosmeticingredient, drug).
e. Supporting Infrastructure & Configurations:
• Dockerfile.txt for containerization setups.
• Vite configuration files (vite.config.js, tailwind.config.ts) to manage development/build processes.
• ESLint and other configuration files in the root ensure code quality.
Relationships and Data Flow
• A user accesses the frontend (React application) via a browser.
• The frontend communicates with the Node.js backend (via API calls, likely managed in server.js).
• The backend processes requests and can optionally:
• Query the Weaviate vector database for ingredient information using RAG queries.
• Reach out to the external AI service (Google Gemini) hosted on GCP using containerization (Docker/Kubernetes) for enhanced, real-time research.
• The data sources (CSV files under src/assets) could be used for static reference or initial data seeding in the database.
• Backups for Weaviate indicate additional strategies for data persistence and recovery.
Architectural Patterns & Design Principles
• Separation of Concerns: Clear separation between frontend and backend responsibilities.
• API Gateway Pattern: The Node.js server acts as a central router for frontend requests and external integrations.
• Microservices or External Service Integration: The use of container orchestration (via Docker/Kubernetes) and external AI services emphasizes decoupled, modular design.
• Data Flow & Dependency Inversion: The backend decouples the UI from heavy processing (AI and vector search) by interfacing with external services.
• Use clear labels for each layer and indicate the deployment context (GCP cloud via Docker/Kubernetes).
• That all major components are captured, even if briefly: from static files in the repository (which support the web UI) to third-party AI and vector database components.