Bygga
Type the product name from the box. Bygga shows every assembly step in 3D, with the parts, screws and tools for each one, and reads it out loud.
翻译准备中
尚未检测到更新。GitHub 发布版本后会显示在这里。
正在加载完整 README。 以下为已保存的摘录。
An AI-powered kitchen companion built around reducing food waste.
Scan a food item with your camera → a vision model reads its name, category and
expiry date → it lands in a pantry inventory sorted by what expires first → an LLM
turns that inventory into recipe suggestions, a 7-day meal plan, and a
shopping list of only what you're missing.
Everything is personalised: allergies, cooking skill, spice tolerance, diet, cuisine,
household size and cooking style all feed into the prompts.查看完整 README ↗An AI-powered kitchen companion built around reducing food waste.
Scan a food item with your camera → a vision model reads its name, category and expiry date → it lands in a pantry inventory sorted by what expires first → an LLM turns that inventory into recipe suggestions, a 7-day meal plan, and a shopping list of only what you're missing.
Everything is personalised: allergies, cooking skill, spice tolerance, diet, cuisine, household size and cooking style all feed into the prompts.
| Layer | Choice |
|---|---|
| Frontend | React 19 + TypeScript, Vite, React Router (HashRouter) |
| Styling | Tailwind (CDN) with a hand-written animation layer in index.html |
| Backend | Express 5 + TypeScript |
| Database | SQLite via Drizzle ORM (local.db) |
| AI | OpenAI gpt-4o-mini (text + vision) |
| Auth | Google Identity Services + SQLite-backed sessions |
App data (pantry, shopping list, meal plan, profile, favourites) lives in the browser's
localStorage. The database holds users and sessions only — so data is per-browser and
does not sync across devices.
Prerequisites: Node.js 20+
npm install
Create a .env in the project root:
OPENAI_API_KEY=sk-... # required — https://platform.openai.com/api-keys
SESSION_SECRET=any-long-random-string
DATABASE_URL=./local.db
GOOGLE_CLIENT_ID= # optional — see "Google sign-in" below
SKIP_AUTH=true # dev bypass: auto sign-in, skips the login screen
Run the API and the client in two terminals:
npm run dev # Express API on http://localhost:5000
npm run dev:client # Vite client on http://localhost:5173
Open http://localhost:5173. The client proxies /api to port 5000.
For a production-style run, npm run build then npm start serves everything from
port 5000 on its own.
.envis read once at startup — restart the server after editing it.
Optional. With GOOGLE_CLIENT_ID unset the login screen says so and guest mode still works.
http://localhost:5173 and http://localhost:5000.env as GOOGLE_CLIENT_ID, set SKIP_AUTH=false, restartThe browser receives a Google ID token and posts it to /api/auth/google, which verifies
it was issued for this client ID, is unexpired, and has a verified email — then creates a
session. No client secret is involved.
The Express server serves the built frontend itself, so the whole app is one service
on one origin — which keeps session cookies working with no CORS and no cross-site
cookie rules. render.yaml describes it as a Render Blueprint.
Serverless hosts (Vercel/Netlify functions) are a poor fit here:
better-sqlite3needs a real writable disk, and recipe generation takes 12–25s, which is at or past typical function time limits. A static-only deploy gives you the UI with every/api/*call returning 404.
Deploy on Render
render.yaml (Node, npm install && npm run build, npm start, 1 GB disk at /data).OPENAI_API_KEYGOOGLE_CLIENT_ID
SESSION_SECRET is generated for you; DATABASE_URL points at /data/local.db on the
persistent disk so users and sessions survive restarts and deploys.https://smart-pantry.onrender.com).The free plan sleeps after inactivity, so the first request after idle takes ~30s to wake.
| Command | Does |
|---|---|
npm run dev | API server (tsx, port 5000) |
npm run dev:client | Vite dev server (port 5173) |
npm run build | Build the client into dist/ |
npm start | Serve the built app from the API server |
npm run db:push | Push the Drizzle schema to SQLite |
npm run db:studio | Drizzle Studio |
npx tsc --noEmit | Typecheck |
pages/ screens (Dashboard, Scanner, Pantry, Chef, Planner, Settings, …)
components/ reusable UI (NavBar, VideoPlayer, CookingTimer, LockScreen, …)
contexts/ React context providers (allergies, favourites, theme, walkthrough, …)
services/ browser-side services (storage, AI client, notifications, PIN, …)
hooks/ shared hooks
server/ Express API, auth, AI routes, SQLite session store
shared/ Drizzle schema shared by client and server