How taylor-allen/macro-fetch works
Project type and purpose
• This is a full-stack web application built with Next.js (App Router).
• It delivers server-rendered React pages, serves static assets, and exposes a JSON API at /api/food.
• Key user flows:
• User lands on / and interacts with a search form (client component).
• Form submits to the server (via fetch to /api/food).
• Results page (/results) is SSR’d on the server using data from the API.
File structure
• Top‐level “.next” folder: compiled output (SSR bundles, static assets, route manifests).
• src/app/ directory:
• layout.js, page.js – server components for each route.
• api/food/route.js – server code implementing the food lookup API.
• components/ – client and server React components (e.g., form.js, foodCard.js, resultsList.js, navigation.js).
• globals.css – global styles.
• Config files: next.config.mjs, jsconfig.json, postcss.config.mjs, eslint.config.mjs.
• public/ – static assets (images, manifest, favicon).
Insights from README
• Bootstrapped with create-next-app.
• Uses next/font for optimized font loading.
• Intended for deployment on Vercel (but works anywhere Node.js can run).