How garvit-nag/reciperover-production works
Recognize the Project Purpose and Components
• RecipeRover is a full-stack application for recipe management and discovery.
• Its core elements include a Next.js-based frontend with React and Tailwind CSS, a Python backend building the API and business logic, and MongoDB as the database.
• Deployment is split: the frontend is deployed on Vercel and the backend is hosted on Hugging Face Spaces.
Main Components
• Frontend:
• Next.js Application: Found under the “src” directory with pages such as “about”, “contact”, “dashboard”, “recipes”, and “recommendations”.
• UI Components: Both under “src/components” and “components/ui” for repeated widgets (e.g., Navbar, cards, loaders etc.).
• Static Assets: “public” directory encompasses static files.
• Backend:
• API Server: The backend folder (specifically “backend/app”) houses the API routing (e.g., api/routes.py) and startup (main.py).
• Services and Business Logic: Within “backend/app/services” (e.g., extraction, image search, recommendation) and “backend/app/utils” (data loading, preprocessing, recommendation utils, scrapers, similarity_calculation).
• Models: In “backend/app/models” which defines recipe-related data structures.
• Database:
• MongoDB: Integration is visible in “src/lib/mongodb.ts” with configuration details for the database.
• Deployment:
• Frontend on Vercel.
• Backend deployed on Hugging Face Spaces.
• Supporting Files:
• Configuration files (e.g., tailwind.config.ts, tsconfig.json, .eslintrc.json) underline environment and build dependencies.
• Package and dependency management: “package.json”, “requirements.txt” for Node.js and Python respectively.
Relationships and Data Flow
• Frontend interacts with the backend API endpoints to perform operations such as searching recipes, handling ingredient management, and querying recommendations.
• The backend consumes incoming API requests, processes them through various service layers (e.g., extraction, image query, recommendation) and accesses the database (MongoDB) for storing and retrieving data.
• Utility modules like scrapers perform external data extraction which then feeds into the recommendation and image search functionalities.
• Deployment nodes influence the routing and scalability – with Vercel handling the frontend's performance optimization and Hugging Face Spaces managing the backend’s execution environment.
Architectural Patterns and Design Principles
• Layered Architecture: Clear separation between presentation (Next.js pages/components), business logic (Python backend services), and data access (MongoDB).
• Micro-modularity: Within the backend, services are organized by distinct functionalities (data preprocessing, feature engineering, and various scraping tasks).
• Clear API contracts: Frontend calls RESTful API endpoints provided by the backend (as seen in “backend/app/api/routes.py” and in “src/app/api” for frontend-side interactions).
• Maintainability and Extensibility: Separation of concerns in file organization (e.g., splitting scraping into multiple files) ensures clear boundaries.
Including Specifics
• Clear labels for each component with notations such as “API Routes”, “Service Modules”, and “Database Connector”.
• User actions → Frontend pages/ components.
• Frontend API calls → Backend API endpoints.
• Data flow → Backend service interactions with the Database.