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

Project Ideas Generator using AI and React

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

🌱 How to start this project?
📝 Instructions:

🌱 How to start this project?

Do not clone this repository because we will 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 handleGenerateIdeas = async (topic) => { 2 const prompt = `Provide me with three project ideas in the field of ${topic}.`; 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 generatedText = data.choices[0].text.trim(); 22 const ideaList = generatedText.split('\n').filter(idea => idea.trim() !== ''); 23 } catch (error) { 24 console.error('Error generating ideas:', error); 25 } 26};

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

Step 5: Display the Generated Project Ideas

Step 6: Bonus - Enhance the User Experience

Bonus Section

Additional Features to Practice and Improve the Project

  1. Save Ideas: Implement functionality to save or bookmark generated ideas for future reference.
  2. Share Ideas: Add a feature to share generated ideas via email or social media.
  3. History: Keep a history of generated ideas so users can revisit them without regenerating.
  4. Custom Prompts: Allow advanced users to input their own custom prompts to the AI.
  5. Styling: Enhance the app's appearance using CSS or styling libraries like Bootstrap or Material-UI.
  6. User Authentication: Implement user accounts so users can save and access their ideas across devices.

Explore different enhancements to make your Project Ideas Generator more interactive and user-friendly!

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

Lesson

Creating React Components - Learn what is and how to create a react component

Exercise

Learn React.js Tutorial and Interactive Exercises