A full-stack tech blog built with NextJS, Tailwind, Gemini and PostgreSQL.
You can find a live version HERE
- Oauth2 login with Google and Github
- Analyze ingredients and generate recipes
- Save and share recipes
- Profile page
- Responsive design
- PWA support for Android, IOS and Desktop
- Node.js (v18+ recommended)
- npm or yarn
- PostgreSQL instance (local or cloud)
- Github and Google Client ID and Secret
- Pexels API key
git clone https://github.com/redesu/cook-lens
cd cook-lenscp .env.example .env # Create your .env file
npm install
npm run dev # or: npm startWarning
Make sure your PostgreSQL instance is running! Check the schematic script in the last step.
Environment Variables (.env):
NEXT_PUBLIC_API_UR=your_api_url
NEXTAUTH_URL=your_nextauth_url
NEXTAUTH_SECRET=your_nextauth_secret
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
DB_HOST=your_db_host
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_NAME=your_db_name
DB_PORT=your_db_port
PEXELS_API_KEY=your_pexels_api_key
GEMINI_KEY=your_gemini_api_key
The database uses the following schematic
Create the database schema using the script in schema.sql in the project root folder.
- Visit http://localhost:3000 to use the app.
- Login using Google or Github to start generating recipes.
See app/api for all available endpoints.
-
POST /api/ai/analyze-image– Analyze image and return ingredients -
POST /api/ai/generate-recipes– Generate recipes based on ingredients provided -
POST /api/auth– NextAuth callback -
POST /api/recipes– Create a new recipe (auth required) -
GET /api/recipes/:id– Get a recipe by id (auth required) -
POST /api/saved_recipe– Save a recipe (auth required) -
GET /api/saved_recipe– Get a random saved recipe -
GET /api/saved_recipe/:id– Get a saved recipe by id -
GET /api/user/:id– Get user info, saved recipes and generated recipes (auth required)
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.







