How sanjitvijay/nutrinav works
Project Type and Purpose
• NutriNav is an all-in-one platform designed to track nutritional information from campus dining halls. It enables users to add foods (automatically or manually) and monitor calories and macros.
• The project is built as a full-stack application, with a React frontend (using TailwindCSS and DaisyUI for components) and a separate backend (Node.js and Express.js) that handles functions like authentication (powered by Supabase Auth), web parsing (Cheerios), and scheduling (Render Cron Scheduler).
File Structure
• The file tree provided is for the frontend portion:
• Top-level files include package.json, package-lock.json, and configuration files like tailwind.config.js.
• The public directory contains static assets (index.html, manifest, robots.txt).
• The src directory includes the React application:
• App components (e.g., App.js, various CSS and test files).
• Assets and reusable components located in “src/components” such as navigation bars, custom dropdowns, auth modules, and content display components.
• Context providers in “src/context” (AuthProvider, UserInfoProvider, etc.) managing shared state.
• Various pages for different functionalities (Dashboard, SignIn, SignUp, ScannerPage, etc.).
• Utility files like supabaseClient.js denote integration with Supabase for authentication/data handling.
• These indicate a component-based architecture for the frontend with clear separation of concerns by pages, shared components (UI elements), and context state management.
Architectural Points from the README
• The README outlines both the frontend and backend tech stacks, inviting us to consider components like:
• Frontend: React with TailwindCSS, DaisyUI, and Figma designs.
• Backend: Node.js and Express.js paired with a PostgreSQL database.
• External integrations: Supabase Auth and additional parsing and scheduling services.
a. Main Components:
• Frontend (React Application)
• UI Components: Navigation bars, dropdowns, auth-related components, food log displays.
• Pages: Dashboard, AddFood, CalorieCalc, ManualEntryForm, ScannerPage, etc.
• Context Providers: AuthProvider and UserInfoProvider for global state, including user authentication and information.
• Backend Services (separate repository as per README)
• Node.js/Express.js API layer for business logic.
• Authentication & Authorization via Supabase Auth.
• Data Processing: Web parser (Cheerios) and scheduled tasks (Render Cron Scheduler).
• Database:
• PostgreSQL for persistent storage.
• External Services:
• Integration with third-party libraries/services such as Google Auth and possibly future AI recommendation modules.
b. Relationships and Interactions:
• The Frontend communicates with the Backend through defined API endpoints.
• The Backend handles authentication (using Supabase Auth) and communicates with the PostgreSQL database.
• The Frontend interacts with external libraries (e.g., for Google Authentication or data visualization).
• Any scheduled processing (e.g., cron jobs on the backend) interacts with the database to update records.
c. Architectural Patterns and Design Principles:
• Component-based architecture in the frontend (React’s modular design).
• Separation of concerns: Clear boundaries between UI, business logic, and data storage.
• Use of context providers in React for shared application state (global auth and user info).
• RESTful API design in the backend.
• Scalability aspects through modular backend services (parsing, authentication, scheduling).
d. Relevant Technologies and Frameworks:
• Frontend: React.js, TailwindCSS, DaisyUI.
• Backend: Node.js, Express.js, Cheerios, Supabase Auth, Render Cron Scheduler.
• Database: PostgreSQL.
• Additional: Figma for design prototypes and possible integration of Google authentication.