Self-paced

Explore our extensive collection of courses designed to help you master various subjects and skills. Whether you're a beginner or an advanced learner, there's something here for everyone.

Bootcamp

Learn live

Join us for our free workshops, webinars, and other events to learn more about our programs and get started on your journey to becoming a developer.

Upcoming live events

Learning library

For all the self-taught geeks out there, here is our content library with most of the learning materials we have produced throughout the years.

It makes sense to start learning by reading and watching videos about fundamentals and how things work.

Search from all Lessons


LoginGet Started

Register to 4Geeks

← Back to Projects

Logo generator using AI

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

🌱 How to start this project

Do not clone this repository because we are going to be using a different template.

We recommend opening the react template using a provisioning tool like Codespaces (recommended) or Gitpod. Alternatively, you can clone the GitHub repository on your local computer using the git clone command.

This is the repository you need to open or clone:

https://github.com/4GeeksAcademy/react-hello

⚠ You will need to have Node.js installed if you do it locally, but all of that is already installed on Codespaces or Gitpod.

📝 Instructions

Step 1: Set Up the Project

Step 2: Get Access to ChatGPT's API

Step 3: Create an Input Form

Step 4: Connect to ChatGPT's API

Example:

1const handleGenerateLogo = async ({ companyName, industry, style }) => { 2 const prompt = `Create a detailed description of a logo for a company named "${companyName}", operating in the "${industry}" industry. The logo should have a "${style}" style.`; 3 4 try { 5 const response = await fetch('https://api.openai.com/v1/engines/text-davinci-003/completions', { 6 method: 'POST', 7 headers: { 8 'Authorization': `Bearer YOUR_OPENAI_API_KEY`, 9 'Content-Type': 'application/json', 10 }, 11 body: JSON.stringify({ 12 prompt: prompt, 13 max_tokens: 150, 14 n: 1, 15 stop: null, 16 temperature: 0.7, 17 }), 18 }); 19 20 const data = await response.json(); 21 const description = data.choices[0].text.trim(); 22 setLogoDescription(description); 23 } catch (error) { 24 console.error('Error generating logo description:', error); 25 } 26};

Note: Remember to replace 'YOUR_OPENAI_API_KEY' with your actual OpenAI API key.

Step 5: Display the Generated Logo Description

Step 6: Bonus - Visual Representation

Bonus Section

Additional Features to Practice and Improve the Project

  1. Logo Variations: Allow users to generate multiple logo descriptions with different styles or themes by modifying the prompt.

  2. Styling: Enhance your app's appearance using CSS or styling libraries like Bootstrap or Material-UI.

  3. Save Descriptions: Implement functionality to save or download the generated logo descriptions for future reference.

  4. User Accounts: Add a user authentication system so users can save their logo ideas and access them later.

  5. Error Handling: Add robust error handling to manage API errors, network issues, or invalid inputs gracefully.

  6. Responsive Design: Ensure your app looks good on various screen sizes by implementing responsive design practices.

Explore different enhancements to make your logo generator app more interactive and visually appealing!

Signup and get access to similar projects

We will use it to give you access to your account.
Already have an account? Login here.

By signing up, you agree to the Terms and conditions and Privacy policy.

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Signup and get access to similar projects

We will use it to give you access to your account.
Already have an account? Login here.

By signing up, you agree to the Terms and conditions and Privacy policy.

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Supplementary Material

In order to prepare better for completing this exercises, we suggest the following materials

Lesson

Learn React Here : React Js Tutorial

Exercise

Learn React.js Tutorial and Interactive Exercises

Lesson

React Hooks Explained