Skip to content

Redesu/cook-lens

Repository files navigation

Main page

A full-stack tech blog built with NextJS, Tailwind, Gemini and PostgreSQL.

You can find a live version HERE


Features

  • Oauth2 login with Google and Github Login Screenshot
  • Analyze ingredients and generate recipes Generating Recipes Gif
  • Save and share recipes Saving Recipe Gif
  • Profile page Profile Screenshot
  • Responsive design Responsive Screenshot
  • PWA support for Android, IOS and Desktop PWA Screenshot

Prerequisites

  • Node.js (v18+ recommended)
  • npm or yarn
  • PostgreSQL instance (local or cloud)
  • Github and Google Client ID and Secret
  • Pexels API key

Getting Started

1. Clone the repository

git clone https://github.com/redesu/cook-lens
cd cook-lens

2. Setup

cp .env.example .env   # Create your .env file

npm install
npm run dev            # or: npm start

Warning

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

3. Create the Schematic in your PostgreSQL instance

The database uses the following schematic Schema ERD

Create the database schema using the script in schema.sql in the project root folder.


Usage


API Endpoints

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)


Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.


License

MIT

About

This project uses Gemini to generate recipes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors