ChefHughProject is a React + Vite app that turns your ingredients into recipe ideas. The frontend talks to a secure serverless API on Vercel, so your Hugging Face token stays on the server.
- Install dependencies:
npm install- Create
.env.localfor frontend settings:
VITE_API_BASE_URL=You can also copy .env.example and fill in your values.
- Leave
VITE_API_BASE_URLempty if frontend and backend are served from the same origin. - If running local Vite (
npm run dev) against a deployed backend, set it to your Vercel URL, for example:VITE_API_BASE_URL=https://your-project.vercel.app
- Start the app:
npm run devgit init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/<your-username>/<your-repo>.git
git push -u origin main- In the Vercel dashboard, select Add New Project.
- Import your GitHub repository.
- Keep the framework preset as Vite (auto-detected).
HF_ACCESS_TOKEN: your Hugging Face access token.ALLOWED_ORIGINS: comma-separated list of allowed origins.
Example:
http://localhost:5173,https://your-project.vercel.app
- Deploy from the Vercel UI (or push to
main). - Frontend and
/api/recipeare hosted in the same Vercel project.
- Never put
HF_ACCESS_TOKENin frontend-exposed variables. - Frontend calls
/api/recipe; only the serverless function talks to Hugging Face. - Commit
.env.examplefor contributors, but keep.env.localprivate.