EasyChefAI is a React single-page application designed to assist users in deciding what to cook. Users can input their own ingredients and categories, and the application generates a recipe using the OpenAI API. The resulting recipe is presented in a user-friendly manner, accompanied by visually appealing images generated using OpenAI's ChatGPT and DALL-E 3.
-
User Data Management:
- The app remembers the user's name and can store user data through a
UserContext
.
- The app remembers the user's name and can store user data through a
-
OpenAI API Integration:
- Utilizes a custom hook (
useOpenAIRecipe.js
) to handle requests for both image and text generation based on user input.
- Utilizes a custom hook (
-
Theme Management:
- Includes a button to toggle between dark and light mode.
- Recognizes the theme of the user's device and applies it to the site.
-
Animations:
- Incorporates soft animations for a more engaging user experience.
Check out the deployed site: EasyChefAI Demo
To set up the project, follow these steps:
- Clone the repository.
- Navigate to the project directory.
- Install dependencies using
npm install
. - Run the development server with
npm run dev
.
EasyChefAI
.
├── README.md
├── index.html
├── package-lock.json
├── package.json
├── public - mostly images and icons
├── src
│ ├── App.jsx
│ ├── AppRoutes.jsx
│ ├── assets
│ ├── components
│ ├── context
│ ├── hooks
│ ├── index.jsx
│ ├── pages
│ ├── services
│ └── styles
└── vite.config.js
- src: Contains the main source code.
- components: Reusable UI components.
- **context: Contexts used within the app.
- hooks: Custom hooks, including the essential useOpenAIRecipe.js.
- pages: Components for each page.
- services: API-related code, including OpenAI-related functions.
- styles: Styling files.
- public: Stores mostly images and icons.
- React: A JavaScript library for building user interfaces.
- React DOM: React package for working with the Document Object Model.
- React Router DOM: Declarative routing for React.js applications.
- Vite: A build tool for fast and efficient development of modern web projects.
- Dotenv: Loads environment variables from a .env file into process.env.
- HTML React Parser: Parses HTML into React elements.
- Jsdom: A JavaScript implementation of the DOM and HTML standards.
- OpenAI: Package for accessing the OpenAI API, integrating ChatGPT and DALL-E 3.
- ESLint: Pluggable linter tool for identifying and fixing problems in JavaScript code.
- Prettier: Opinionated code formatter for maintaining consistent coding style.
- Vite React Plugin: Vite plugin for integrating React into Vite projects.