{
  "services": [
    {
      "id": "web",
      "name": "RecipeRadar Next.js app",
      "kind": "web",
      "framework": "nextjs",
      "evidence": [
        {
          "file": "design-doc",
          "note": "Stack: Next.js 15 app router on Vercel"
        }
      ]
    }
  ],
  "routes": [
    {
      "id": "page-home",
      "serviceId": "web",
      "method": "GET",
      "path": "/",
      "kind": "page",
      "auth": "public",
      "reads": [
        {
          "dataStoreId": "supabase-postgres",
          "pattern": "list"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "hot",
      "evidence": [
        {
          "file": "design-doc",
          "note": "Pages: landing with featured recipes, SEO play"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "page-dashboard",
      "serviceId": "web",
      "method": "GET",
      "path": "/dashboard",
      "kind": "page",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "supabase-postgres",
          "pattern": "list"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "design-doc",
          "note": "Pages: saved recipes and current meal plan"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "page-recipe",
      "serviceId": "web",
      "method": "GET",
      "path": "/recipes/[id]",
      "kind": "page",
      "auth": "public",
      "reads": [
        {
          "dataStoreId": "supabase-postgres",
          "pattern": "point"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "hot",
      "evidence": [
        {
          "file": "design-doc",
          "note": "Pages: public shareable recipe page, most traffic"
        },
        {
          "file": "design-doc",
          "note": "Notes: images rendered from public bucket"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "page-settings",
      "serviceId": "web",
      "method": "GET",
      "path": "/settings",
      "kind": "page",
      "auth": "authenticated",
      "reads": [],
      "writes": [],
      "externalCallIds": [],
      "work": "light",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "design-doc",
          "note": "Pages: account and billing settings"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "api-recipes-create",
      "serviceId": "web",
      "method": "POST",
      "path": "/api/recipes",
      "kind": "api",
      "auth": "authenticated",
      "reads": [],
      "writes": [
        {
          "dataStoreId": "supabase-postgres"
        },
        {
          "dataStoreId": "supabase-storage"
        }
      ],
      "externalCallIds": [
        "recipe-source-sites",
        "openai"
      ],
      "work": "long-running",
      "llmCalls": [
        {
          "externalCallId": "openai",
          "kind": "chat",
          "modelSource": "unknown",
          "callsPerRequest": 1,
          "inputSize": "medium",
          "streaming": false,
          "frequency": "always",
          "keySource": "platform",
          "evidence": [
            {
              "file": "design-doc",
              "note": "API: small OpenAI call to normalize scraped recipe; no model or cap given"
            }
          ]
        }
      ],
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "design-doc",
          "note": "API: fetch, scrape, normalize, store in one request; 5-10s"
        },
        {
          "file": "design-doc",
          "note": "Notes: images go to Supabase storage (write inferred)"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "api-recipes-list",
      "serviceId": "web",
      "method": "GET",
      "path": "/api/recipes",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "supabase-postgres",
          "pattern": "list"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "design-doc",
          "note": "API: list your recipes newest first; no pagination mentioned"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "api-plan",
      "serviceId": "web",
      "method": "POST",
      "path": "/api/plan",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "supabase-postgres",
          "pattern": "list"
        }
      ],
      "writes": [
        {
          "dataStoreId": "supabase-postgres"
        }
      ],
      "externalCallIds": [
        "openai"
      ],
      "work": "llm",
      "llmCalls": [
        {
          "externalCallId": "openai",
          "kind": "chat",
          "modelSource": "unknown",
          "callsPerRequest": 1,
          "inputSize": "large",
          "streaming": true,
          "frequency": "always",
          "keySource": "platform",
          "evidence": [
            {
              "file": "design-doc",
              "note": "API: GPT plan from all saved recipes, streamed; no model or cap given"
            }
          ]
        }
      ],
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "design-doc",
          "note": "API: generate weekly plan, streams response; plan write inferred from dashboard/cron"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "api-stripe-webhook",
      "serviceId": "web",
      "method": "POST",
      "path": "/api/webhooks/stripe",
      "kind": "webhook",
      "auth": "public",
      "reads": [],
      "writes": [
        {
          "dataStoreId": "supabase-postgres"
        }
      ],
      "externalCallIds": [
        "stripe"
      ],
      "work": "db-bound",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "design-doc",
          "note": "API: Stripe subscription lifecycle webhook; signature check not stated"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-weekly-plan-email",
      "serviceId": "web",
      "method": "GET",
      "path": "/api/cron/weekly-plan-email",
      "kind": "scheduled",
      "auth": "unknown",
      "reads": [
        {
          "dataStoreId": "supabase-postgres",
          "pattern": "list"
        }
      ],
      "writes": [],
      "externalCallIds": [
        "resend"
      ],
      "work": "long-running",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "design-doc",
          "note": "Jobs: Sunday 6pm vercel.json cron emails everyone their plan; path assumed"
        }
      ],
      "confidence": "low"
    }
  ],
  "dataStores": [
    {
      "id": "supabase-postgres",
      "kind": "postgres",
      "provider": "supabase",
      "orm": "supabase-js",
      "connection": "http-api",
      "evidence": [
        {
          "file": "design-doc",
          "note": "Stack/Notes: Supabase Postgres via supabase-js, RLS, no Prisma"
        }
      ]
    },
    {
      "id": "supabase-storage",
      "kind": "object-storage",
      "provider": "supabase",
      "connection": "http-api",
      "evidence": [
        {
          "file": "design-doc",
          "note": "Notes: recipe images in Supabase storage public bucket"
        }
      ]
    }
  ],
  "jobs": [
    {
      "id": "welcome-email",
      "trigger": "inline",
      "description": "Welcome email sent via Resend inside signup handler after responding, no queue",
      "lossImpact": "high",
      "evidence": [
        {
          "file": "design-doc",
          "note": "Jobs: welcome email called directly in signup handler"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-weekly-plan-email",
      "trigger": "cron",
      "schedule": "0 18 * * 0",
      "description": "Weekly Sunday 6pm email of each user's meal plan",
      "evidence": [
        {
          "file": "design-doc",
          "note": "Jobs: Sunday 6pm vercel.json cron"
        }
      ],
      "confidence": "medium"
    }
  ],
  "externals": [
    {
      "id": "openai",
      "category": "llm",
      "provider": "openai",
      "blocking": true,
      "evidence": [
        {
          "file": "design-doc",
          "note": "Stack: OpenAI for normalization and meal plans"
        }
      ]
    },
    {
      "id": "stripe",
      "category": "payments",
      "provider": "stripe",
      "blocking": false,
      "evidence": [
        {
          "file": "design-doc",
          "note": "Stack: Stripe $8/mo pro subscriptions"
        }
      ]
    },
    {
      "id": "resend",
      "category": "email",
      "provider": "resend",
      "blocking": false,
      "evidence": [
        {
          "file": "design-doc",
          "note": "Stack/Jobs: Resend for welcome and weekly emails"
        }
      ]
    },
    {
      "id": "recipe-source-sites",
      "category": "other",
      "provider": "third-party recipe websites (scraped)",
      "blocking": true,
      "evidence": [
        {
          "file": "design-doc",
          "note": "API: server-side fetch of user-pasted URL in request"
        }
      ]
    },
    {
      "id": "supabase-auth",
      "category": "auth",
      "provider": "supabase",
      "blocking": true,
      "evidence": [
        {
          "file": "design-doc",
          "note": "Stack: Supabase auth with row-level security"
        }
      ]
    }
  ],
  "realtime": [],
  "warnings": [
    "Design doc gives no OpenAI model ids or output token caps; costs cannot be priced precisely.",
    "POST /api/recipes scrapes and calls OpenAI in one request (5-10s); risk of Vercel function timeouts and slow user waits.",
    "Signup handler route is not specified; welcome email is an unqueued inline job and is lost if the function is killed.",
    "Cron route path and timezone are assumed; sending to all users in one invocation may exceed function duration limits.",
    "Stripe webhook signature verification is not mentioned; treated as public.",
    "GET /api/recipes has no pagination and POST /api/plan sends all saved recipes to the model (unbounded input).",
    "Scraping user-supplied URLs server-side raises SSRF concerns.",
    "Whether /api/plan persists the plan is inferred from the dashboard and cron email."
  ],
  "schemaVersion": 1,
  "meta": {
    "source": "design-doc",
    "repo": "sample-design.md",
    "analyzedAt": "2026-11-12T19:49:38.688Z",
    "fileCount": 0,
    "extractorModel": "anthropic/claude-sonnet-5.5",
    "skeramVersion": "1.0.0"
  }
}