Github Repository: https://github.com/sid-rudani/smart-kitchen-inventory/
A lightweight Next.js app to manage kitchen inventory, suggest recipes, and track item consumption using Supabase for auth and storage.
This repository contains a small Next.js (App Router + TypeScript) project. The app uses Supabase for authentication and storage. The original project integrates with a locally-run LLM via Ollama (the author used the llama3.1 model). This README explains how to set up the project and the local Ollama model.
app/- Next.js pages and API routes (app router)components/- React UI pieces used across the apputils/supabase/client.ts- Supabase client factory (reads public env vars)utils/supabase/- Supabase-related helpers
- macOS (instructions use macOS where appropriate)
- Node.js (v18+ recommended)
- pnpm (recommended) or npm/yarn
- Git
Install pnpm (if you don't have it):
npm install -g pnpm- Clone the repo
git clone <this-repo-url>
cd smart-kitchen-inventory- Install dependencies
pnpm install- Environment variables
Create a .env.local file at the project root. At minimum the app expects the Supabase public URL and anon key (these are used by the client code in utils/supabase/client.ts):
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-public-anon-key
# Optional: set the Ollama HTTP API address (if you run Ollama locally)
OLLAMA_API_URL=http://127.0.0.1:11434Notes:
- Create a Supabase project and copy the Project URL and anon/public API key into the two vars above.
- The code uses
createBrowserClient(process.env.NEXT_PUBLIC_SUPABASE_URL, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY)(seeutils/supabase/client.ts).
- Run the app
pnpm run devOpen http://localhost:3000 in your browser.
The original project used a locally-run Ollama model (the author used llama3.1). If you want to run the same setup locally, follow these steps.
- Install Ollama (macOS example)
# Homebrew (recommended on macOS):
brew install ollama
# Or follow the platform-specific instructions at https://ollama.com- Pull the model (use the model name you need;
llama3.1is what the author used):
ollama pull llama3.1- Start Ollama's HTTP server so your app can send inference requests (default port is 11434):
ollama serve- Confirm/override the API URL
By default Ollama listens on http://127.0.0.1:11434. If you need to override that location for the app, set OLLAMA_API_URL in .env.local.
Important: The project's codebase does not require Ollama to run the Next.js UI — however, features that call the LLM will fail or be disabled if Ollama is not available. Make sure Ollama is running and the model is pulled before trying AI-powered features.
Available npm scripts (from package.json):
pnpm run dev— start Next.js in development modepnpm run build— build for productionpnpm run start— run production buildpnpm run lint— run eslint
- Supabase: If you get auth or DB errors, verify
NEXT_PUBLIC_SUPABASE_URLandNEXT_PUBLIC_SUPABASE_ANON_KEYin.env.localand confirm your Supabase tables exist. - Ollama: If the LLM features return errors, confirm:
- Ollama is installed and running (
ollama serve). - The model (e.g.
llama3.1) is pulled:ollama listwill show available models. OLLAMA_API_URLis set (if not using the defaulthttp://127.0.0.1:11434).
- Ollama is installed and running (
- Ports: Next.js default is 3000. Ollama default is 11434. Adjust if those ports conflict.
- Supabase client factory is small and intentionally reads public env vars from
process.envso the client can be used inside the browser (seeutils/supabase/client.ts). - If you want to wire a remote LLM provider instead of Ollama, add the provider credentials and update the server-side route(s) that call the LLM.
If you'd like, I can also:
- Add an example
.env.examplefile with placeholders - Add a small script or README section showing a quick curl example for the app's LLM API call (once you tell me which internal route or integration you use)
If anything needs more detail (for example: exact LLM endpoint usage inside this repo or an .env.example file), tell me and I will add it.
A lightweight Next.js app to manage kitchen inventory, suggest recipes, and track item consumption using Supabase for auth and storage.
- Framework: Next.js 16 (App Router)
- Language: TypeScript + React 19
- UI: Tailwind CSS + shadcn/ui components + Radix + Lucide icons
- Backend: Supabase (auth + database)
- Package manager: pnpm (pnpm-lock.yaml present)
- Sign up / log in (Supabase auth)
- Add, list and consume items in inventory
- Recipe suggestions based on inventory
- Dashboard view for inventory and suggestions
- API routes under
app/apifor items and recipes
- Node.js (v20+ recommended)
- pnpm installed globally (or use
npm/corepack):
pnpm install -g pnpmCreate a .env.local in the project root with these variables (Supabase):
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=public-anon-keyNotes:
- The app uses
@supabase/ssrand server-side helpers — both public URL and anon key are read fromprocess.env.
From the project root:
pnpm install
pnpm devpnpm build
pnpm startTaken from package.json:
pnpm dev— run Next.js in development modepnpm build— build for productionpnpm start— run built apppnpm lint— run ESLint
app/— Next.js App Router routes, UI pages and server API endpointsapp/api/items— API routes for CRUD on itemsapp/api/recipes— recipe suggestion APIsapp/auth— signup/login pagesapp/dashboard— main dashboard page
components/— UI components and shadcn wrapperscomponents/ui/— design system primitives and componentsutils/supabase/client.ts— Supabase client factory (browser)lib/utils.ts— assorted helpers used across the app
The code uses @supabase/ssr helpers for server and @supabase/ssr/@supabase/supabase-js on the client. The createClient helper expects the two env variables listed above. For server-side auth, the app uses cookie helpers via Next's cookies() and createServerClient.