How ruhanimittal29/clearbite works
Project Type and Purpose
• ClearBite is a full-stack AI-powered application aimed at helping users identify dietary triggers for acne and obtain personalized recommendations.
• The system integrates a React-based frontend, a Flask-based backend API, and an AI model (a fine-tuned Mistral model) that processes user inputs to generate advice.
Analyzing the File Structure
• The “app” directory contains the frontend code—React components, CSS, HTML, and configuration files (including Dockerfile, nginx configuration, and Vite config). This clearly indicates the client-side interface.
• The “model” directory hosts a Jupyter Notebook (ClearBite_Model.ipynb), which represents the work done to fine-tune the AI model.
• The “data” directory holds training and testing datasets, which were essential for the training phase.
• Deployment and container orchestration files (Docker-related files inside “app” and top-level docker-compose YAML files) provide hints about how the system is containerized and deployed.
• Although the file tree does not explicitly show a backend directory with Flask code, the README clarifies that a Flask-based backend API is part of the system. It’s likely this code may reside in a different location or be integrated into one of these directories (or possibly inside the “nwhack” folder), assuming a structure where the backend acts as the intermediary between the front-end and the AI model.
Key Architectural Components
• Frontend: The React application (from the “app” folder) is the user interface, facilitating user interactions and visualization of advice.
• Backend API: Powered by Flask and responsible for handling API requests, connecting the frontend with the AI model, and processing user-submitted dietary details.
• AI Model: The fine-tuned Mistral model (indicated in the README and represented by the notebook in the “model” folder) processes input data to identify dietary triggers.
• Data Storage/Processing: The “data” directory (with training and test datasets) is used during the model’s training phase.
• Containerization & Deployment: With Dockerfiles and compose files present, container-based deployment is applied to manage environment consistency and scalability.
Relationships and Interactions
• User -> Frontend: Users interact with the React UI, which sends HTTP requests.
• Frontend -> Backend: These requests are forwarded by the frontend to the Flask API.
• Backend -> AI Model: The Flask backend processes incoming requests, interacts with the AI model to fetch predictions, and returns results.
• Deployment: Docker containers (defined by Dockerfile, compose.yaml, etc.) help encapsulate the frontend, backend, and possibly model serving components for deployment.
Architectural Patterns and Technologies
• Separation of concerns separating the frontend, backend, and model logic states.
• With the tech-stack details: React JS and CSS for the client, Flask and Python3 for the backend & API, and Mistral for the AI model, with Docker and docker-compose handling container orchestration.