Skip to content

aridepai17/SERVD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

180 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Servd - Your AI-Powered Kitchen Assistant

Next.js Strapi Clerk Razorpay Gemini AI Tailwind CSS

Turn your leftovers into masterpieces

Servd App Screenshot

Features β€’ Tech Stack β€’ Getting Started β€’ Architecture β€’ Contributing


What is Servd?

Servd is a modern, AI-powered web application that transforms how you cook meals at home. Simply snap a photo of your fridge or pantry, and our intelligent AI chef will:

  • πŸ” Identify ingredients using Google Gemini Vision AI
  • 🍳 Generate personalized recipes based on what you have
  • πŸ“š Suggest recipes from a database of thousands of dishes
  • πŸ’° Save money by reducing food waste
  • πŸ“– Build your digital cookbook by saving favorite recipes
  • πŸ” Offer premium features through secure subscriptions

The Problem: According to the USDA, approximately 30-40% of the food supply in the United States goes to waste. One of the main contributors is food spoilage due to poor meal planning and not utilizing ingredients effectively.

The Solution: Servd helps you see your pantry through fresh eyes, suggesting delicious recipes that maximize the ingredients you already have.


Key Features

Smart Pantry Management

  • Photo-Based Scanning: Upload an image of your fridge/pantry and AI automatically identifies ingredients
  • Manual Entry: Add items by typing name and quantity
  • Organization: Keep track of expiration dates and quantities
  • Real-time Sync: All data stored securely in the cloud

AI-Powered Recipe Generation

  • Instant Recipes: Enter any dish name and get a complete, detailed recipe
  • Personalized Cooking: AI considers your skill level and available ingredients
  • Dietary Filters: Customize based on cuisine preferences, cooking time, and dietary needs
  • Smart Substitutions: Automatically suggests ingredient alternatives

Recipe Discovery & Management

  • Browse by Category: Breakfast, Lunch, Dinner, Snacks, Desserts
  • Explore World Cuisines: Italian, Chinese, Mexican, Indian, Thai, and more
  • Recipe of the Day: Fresh inspiration delivered daily
  • Save & Organize: Build your personal cookbook with saved favorites
  • Export to PDF: Print or share recipes with family

Secure User Accounts

  • Clerk Authentication: Seamless sign-up/sign-in with email, Google, or social accounts
  • User Profiles: Manage your preferences and subscription
  • Protected Routes: Premium features secured behind authentication

Subscription & Payments

  • Razorpay Integration: Secure payment processing for subscriptions
  • Tiered Access: Free tier with limits, Pro tier for unlimited access
  • Subscription Management: View, upgrade, or cancel subscriptions
  • Secure Callbacks: HMAC signature verification for payment security

Security & Performance

  • Arcjet Protection: Rate limiting and bot detection
  • Timing-Safe Comparisons: Secure signature verification
  • Edge Caching: Optimized for fast loading times

πŸ› οΈ Technology Stack

Frontend

Technology Purpose
Next.js 15 React framework for production-grade applications
React 19 UI library for building interactive interfaces
Tailwind CSS 4 Utility-first CSS framework for styling
Clerk Authentication and user management
Lucide React Beautiful, consistent icon library
Radix UI Accessible UI component primitives
SWR React hook library for data fetching
Sonner Beautiful, accessible toast notifications

Backend

Technology Purpose
Strapi 5 Headless CMS and API backend
PostgreSQL Primary database (configurable)
PostgreSQL Relational database for structured data

AI & External Services

Service Purpose
Google Gemini AI-powered recipe generation and image recognition
TheMealDB External recipe database for browsing
Unsplash High-quality recipe images

Payments & Security

Service Purpose
Razorpay Payment gateway for subscriptions
Arcjet Rate limiting, bot protection, and WAF

πŸ“ Project Structure

SERVD/
β”œβ”€β”€ frontend/                 # Next.js frontend application
β”‚   β”œβ”€β”€ app/                  # App Router pages and API routes
β”‚   β”‚   β”œβ”€β”€ (auth)/          # Authentication pages (sign-in, sign-up)
β”‚   β”‚   β”œβ”€β”€ (main)/          # Main application pages
β”‚   β”‚   β”‚   β”œβ”€β”€ dashboard/   # Home dashboard
β”‚   β”‚   β”‚   β”œβ”€β”€ recipes/     # Recipe discovery & saved recipes
β”‚   β”‚   β”‚   β”œβ”€β”€ pantry/      # Pantry management
β”‚   β”‚   β”‚   └── recipe/      # Individual recipe view
β”‚   β”‚   β”œβ”€β”€ api/             # API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ subscription/ # Razorpay subscription handling
β”‚   β”‚   β”‚   └── webhooks/    # Webhook handlers
β”‚   β”‚   └── subscription/    # Subscription management pages
β”‚   β”œβ”€β”€ components/           # Reusable React components
β”‚   β”‚   β”œβ”€β”€ ui/              # Base UI components
β”‚   β”‚   β”œβ”€β”€ Header.jsx       # Navigation header
β”‚   β”‚   β”œβ”€β”€ RecipeCard.jsx   # Recipe display cards
β”‚   β”‚   β”œβ”€β”€ PricingModal.jsx # Subscription pricing modal
β”‚   β”‚   β”œβ”€β”€ HowToCookModal.jsx # AI recipe search modal
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ actions/             # Server actions for data mutations
β”‚   β”‚   β”œβ”€β”€ mealdb.actions.js # MealDB API integration
β”‚   β”‚   β”œβ”€β”€ recipe.actions.js # Recipe CRUD operations
β”‚   β”‚   └── pantry.actions.js # Pantry item management
β”‚   β”œβ”€β”€ lib/                 # Utility functions and configurations
β”‚   β”‚   β”œβ”€β”€ arcjet.js        # Rate limiting rules
β”‚   β”‚   β”œβ”€β”€ checkUser.js     # User authentication helper
β”‚   β”‚   └── data.js          # Static data (emojis, flags, etc.)
β”‚   └── hooks/               # Custom React hooks
β”‚
β”œβ”€β”€ backend/                  # Strapi backend application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/             # Custom API endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ recipe/      # Recipe content type
β”‚   β”‚   β”‚   β”œβ”€β”€ pantry-item/ # Pantry item content type
β”‚   β”‚   β”‚   └── saved-recipe/# Saved recipe relations
β”‚   β”‚   β”œβ”€β”€ extensions/      # Plugin extensions
β”‚   β”‚   └── index.js          # Backend entry point
β”‚   β”œβ”€β”€ config/              # Configuration files
β”‚   β”‚   β”œβ”€β”€ database.js      # Database configuration
β”‚   β”‚   β”œβ”€β”€ server.js        # Server settings
β”‚   β”‚   └── plugins.js       # Plugin configuration
β”‚   └── database/            # Database migrations
β”‚
β”œβ”€β”€ .env.example             # Environment variables template
└── README.md                # This file

πŸ—οΈ Architecture

Architecture Diagram

High-Level Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        User's Browser                           β”‚
β”‚                                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                    Next.js Frontend                      β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚   β”‚
β”‚  β”‚  β”‚ Landing  β”‚  β”‚ Dashboardβ”‚  β”‚  Pantry  β”‚  β”‚ Recipes  β”‚  β”‚   β”‚
β”‚  β”‚  β”‚   Page   β”‚  β”‚          β”‚  β”‚  Manager β”‚  β”‚          β”‚  β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                              β”‚                                  β”‚
β”‚           Clerk Auth         β”‚                                  β”‚
β”‚           (OAuth/Email)      β”‚                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Next.js API Routes                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  /api/subscription/create  β”‚  Razorpay Payment Links      β”‚  β”‚
β”‚  β”‚  /api/subscription/callbackβ”‚  Payment verification        β”‚  β”‚
β”‚  β”‚  /api/subscription/verify  β”‚  Subscription activation     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                                 β”‚
β”‚              Google Gemini AI (Recipe Generation)               β”‚
β”‚              TheMealDB API (Recipe Discovery)                   β”‚
β”‚              Unsplash API (Recipe Images)                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      Strapi Backend                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”‚
β”‚  β”‚  Users   β”‚  β”‚ Recipes  β”‚  β”‚ Pantry   β”‚  β”‚ Saved    β”‚         β”‚
β”‚  β”‚          β”‚  β”‚          β”‚  β”‚ Items    β”‚  β”‚ Recipes  β”‚         β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚
β”‚                                                                 β”‚
β”‚                        PostgreSQL DB                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow - Recipe Generation

User Input (Photo/Text)
        β”‚
        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Clerk Auth      β”‚ ← Verify user identity & subscription tier
β”‚ Authentication  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Arcjet Rate     β”‚ ← Check usage limits (10 scans/month free)
β”‚ Limit Check    β”‚   (1000/day for Pro)
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Google Gemini   β”‚ ← AI vision for image recognition
β”‚ Vision API      β”‚   AI text for recipe generation
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Gemini AI       β”‚ ← Generate structured recipe JSON
β”‚ Recipe Gen      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Strapi Backend  β”‚ ← Save generated recipes
β”‚ (PostgreSQL)    β”‚   Link to user account
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
         β”‚
    Display to User

Subscription Flow

User Clicks "Upgrade"
        β”‚
        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Create Razorpay β”‚ ← Generate Payment Link
β”‚ Payment Link    β”‚   Customer ID lookup/create
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
    User Completes Payment on Razorpay
        β”‚
        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Razorpay        β”‚ ← POST callback with payment info
β”‚ Callback        β”‚   Signature verification (HMAC-SHA256)
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Verify Payment  β”‚ ← Fetch payment from Razorpay API
β”‚ Status          β”‚   Validate amount & customer
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Update Strapi   β”‚ ← Set subscriptionTier = "pro"
β”‚ User Record     β”‚   Store payment references
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
    Redirect to Success Page

Installation

Prerequisites

Before you begin, ensure you have installed:

  • Node.js 20.x or higher (check with node --version)
  • npm 6.x or higher (check with npm --version)
  • PostgreSQL 14.x or higher (for production) OR
  • SQLite (for development, included with Strapi)

Environment Setup

  1. Clone the repository

    git clone https://github.com/aridepai17/SERVD.git
    cd SERVD
  2. Set up environment variables

    Copy the example environment file and fill in your values:

    cp backend/.env.example backend/.env

    Required environment variables:

    # Frontend (.env.local in frontend/ directory)
    NEXT_PUBLIC_APP_URL=http://localhost:3000
    NEXT_PUBLIC_STRAPI_URL=http://localhost:1337
    STRAPI_API_TOKEN=your-strapi-api-token
    GEMINI_API_KEY=your-google-gemini-api-key
    RAZORPAY_KEY_ID=your-razorpay-key-id
    RAZORPAY_KEY_SECRET=your-razorpay-key-secret
    RAZORPAY_PLAN_ID=your-razorpay-plan-id
    ARCJET_KEY=your-arcjet-key
    NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your-clerk-pub-key
    CLERK_SECRET_KEY=your-clerk-secret-key
    UNSPLASH_ACCESS_KEY=your-unsplash-access-key
    
    # Backend (backend/.env)
    HOST=0.0.0.0
    PORT=1337
    APP_KEYS=your-app-keys
    API_TOKEN_SALT=your-api-token-salt
    ADMIN_JWT_SECRET=your-admin-jwt-secret
    TRANSFER_TOKEN_SALT=your-transfer-token-salt
    JWT_SECRET=your-jwt-secret
    DATABASE_CLIENT=sqlite # or postgres for production
    DATABASE_FILENAME=.tmp/data.db # for SQLite
    # For PostgreSQL:
    # DATABASE_URL=postgresql://user:password@localhost:5432/servd
  3. Get API Keys

    Service Sign Up At Purpose
    Clerk clerk.com Authentication
    Razorpay razorpay.com Payment processing
    Google Gemini aistudio.google.com AI recipe generation
    Arcjet arcjet.com Rate limiting & security
    Unsplash unsplash.com/developers Recipe images

Development Setup

  1. Start the backend (Strapi)

    cd backend
    npm run develop

    This will:

    • Install dependencies
    • Create the database
    • Start the Strapi admin panel at http://localhost:1337/admin
    • Create your admin account when prompted
  2. Start the frontend (Next.js)

    cd frontend
    npm run dev

    Access the app at http://localhost:3000

Production Deployment

For production deployment:

  1. Use PostgreSQL instead of SQLite

  2. Build the Strapi admin panel

    cd backend
    npm run build
    npm run start
  3. Build the Next.js application

    cd frontend
    npm run build
    npm start

Usage Guide

For Home Cooks

  1. Getting Started

  2. Scanning Your Pantry

    • Go to "My Pantry" page
    • Click "Add to Pantry"
    • Upload a photo of your fridge contents
    • AI identifies ingredients automatically
    • Save items to your pantry
  3. Finding Recipes

    • Use the search bar to find any dish
    • Browse by category (Breakfast, Dinner, etc.)
    • Explore world cuisines
    • Check "Recipe of the Day" for inspiration
  4. Getting AI Recipe Suggestions

    • Go to "My Pantry"
    • Click "What Can I Cook Today?"
    • AI suggests recipes matching your ingredients
    • Shows match percentage and missing items
  5. Upgrading to Pro

    • Click the "Free Plan" badge in the header
    • Select "Head Chef Pro" plan
    • Complete secure payment via Razorpay
    • Enjoy unlimited pantry scans and AI recipes

For Developers

Adding a New Feature

  1. Create a new API route

    // frontend/app/api/your-feature/route.js
    import { NextResponse } from "next/server";
    
    export async function GET(request) {
      // Your logic here
      return NextResponse.json({ data: "..." });
    }
  2. Create a server action

    // frontend/actions/your-action.js
    "use server";
    
    export async function yourAction(formData) {
      // Your logic here
      return { success: true, data: "..." };
    }
  3. Add a Strapi content type

    cd backend
    npm run strapi generate content-type

Modifying the UI

The project uses Tailwind CSS. Key design tokens:

  • Primary color: Orange-600 (#ea580c)
  • Background: Stone-50 (#fafaf9)
  • Text: Stone-900 (#1c1917)

Security Features

Authentication & Authorization

  • Clerk Integration: Secure OAuth2 authentication
  • Server-Side Verification: All API routes verify user identity
  • Role-Based Access: Protected routes based on subscription tier

Payment Security

  • HMAC Signature Verification: All Razorpay callbacks verified
  • Timing-Safe Comparison: Prevents timing attacks
  • Customer ID Validation: Ensure payments belong to correct user
  • Environment Secrets: All keys stored securely in environment variables

Rate Limiting & Abuse Prevention

  • Arcjet Integration: Token bucket rate limiting
  • Free Tier: 10 pantry scans/month, 5 AI recipes/month
  • Pro Tier: 1000 requests/day
  • Bot Detection: WAF protection against malicious requests

Data Protection

  • API Tokens: Strapi tokens never exposed to client
  • Input Validation: All user inputs validated server-side
  • SQL Injection Prevention: Parameterized queries via Strapi ORM

API Reference

Frontend API Routes

Endpoint Method Description
/api/subscription/create POST Create Razorpay Payment Link
/api/subscription/callback POST/GET Handle Razorpay payment callback
/api/subscription/verify POST Verify and activate subscription
/api/webhooks/razorpay POST Handle Razorpay webhook events

Strapi API Endpoints

Endpoint Methods Description
/api/recipes GET, POST Recipe CRUD operations
/api/pantry-items GET, POST, PUT, DELETE Pantry management
/api/saved-recipes GET, POST, DELETE User's saved recipes
/api/users GET, PUT, POST User profile management

Server Actions

Action Parameters Description
getOrGenerateRecipe(formData) recipeName Get existing or generate new recipe
saveRecipeToCollection(formData) recipeId Save recipe to favorites
getPantryItems() - Fetch user's pantry items
scanPantryImage(formData) image file AI ingredient recognition
saveToPantry(formData) ingredients array Save scanned items
addPantryItemManually(formData) name, quantity Add single item

Testing

Currently, manual testing is performed:

  1. Unit Testing: Jest configuration available
  2. Integration Testing: Manual API testing with Postman/curl
  3. E2E Testing: Playwright can be configured

To add automated tests:

# Install testing dependencies
npm install -D jest @testing-library/react @testing-library/user-event

# Run tests
npm test

Deployment Options

Vercel (Frontend)

Deploy with Vercel

  1. Connect your GitHub repository
  2. Set environment variables in Vercel dashboard
  3. Deploy automatically on push

Strapi Cloud

Deploy to Strapi Cloud

  1. Connect your GitHub repository
  2. Configure environment variables
  3. Deploy with one click

Docker

# Build and run with Docker Compose
docker-compose up -d

Roadmap

Version 2.0 (Planned)

  • Shopping List: Auto-generate shopping lists from recipes
  • Meal Planning: Weekly meal planning calendar
  • Social Features: Share recipes with friends, follow cooks
  • Voice Commands: Cook hands-free with voice assistant
  • Mobile App: Native iOS and Android apps
  • Nutritional Tracking: Calorie and macro tracking
  • Dietary Restrictions: Keto, Paleo, Vegetarian, Vegan filters
  • Video Recipes: Embedded cooking videos
  • Kitchen Timer: Built-in timers for each step
  • Multi-Lingual: Support for multiple languages

Version 3.0 (Vision)

  • AR Integration: Point camera at ingredients for suggestions
  • Smart Appliances: Connect with smart ovens, refrigerators
  • Grocery Delivery: One-click ordering of missing ingredients
  • Chef Chatbot: Conversational AI for cooking advice
  • Recipe Scanner: Scan physical cookbook recipes
  • Food Expiry Prediction: AI prediction of food freshness
  • Cost Analysis: Recipe cost calculator
  • Carbon Footprint: Environmental impact of meals

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Ways to Contribute

  • πŸ› Report bugs by opening an issue
  • πŸ’‘ Suggest features by opening a feature request
  • πŸ“ Improve documentation by submitting a PR
  • πŸ”§ Fix bugs by submitting a PR
  • 🎨 Improve UI/UX by submitting design suggestions
  • 🌍 Translate the app into your language

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.


Acknowledgments

  • TheMealDB for providing an amazing free recipe API
  • Unsplash for beautiful, free-to-use photography
  • Google for making Gemini AI accessible
  • Open Source Community for the incredible tools we build upon
  • Our Contributors who make Servd better every day

Support


Made with ❀️ for home cooks everywhere

Website β€’ GitHub

About

An AI-powered kitchen assistant that transforms how you cook at home. Snap a photo of your fridge, and Google Gemini Vision AI identifies ingredients while generating personalized recipes tailored to what you have. Browse thousands of dishes by cuisine and category, build your digital cookbook, and reduce food waste.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors