This project demonstrates using Gemini's generative AI model (gemini-1.5-flash
) to create scaffolded project guides for React applications based on various project ideas.
Project Goal:
This project automates generating detailed project guides for students learning React by building various applications.
Technology Stack:
- JavaScript (Node.js)
@google/generative-ai
library- fs (file system) module
How it Works:
- The script loads a pre-defined JSON template containing sections for a scaffolded React project guide.
- It iterates through a list of project ideas.
- For each idea, a prompt is crafted that includes the JSON template and the specific project idea.
- The script uses the
@google/generative-ai
library to call the Gemini model and generate content based on the prompt. - The generated text, which represents the detailed scaffolded project guide for the specific idea, is written to a separate markdown file named after the project idea (with underscores replacing spaces).
Running the Script:
- Make sure you have Node.js and npm installed.
- Clone this repository.
- Install the required dependency:
npm install @google/generative-ai
- Set up your API key for accessing Gemini (refer to official documentation for details).
- Run the script:
node generateProjects.js
This will generate markdown files in the projects
directory, each containing a scaffolded project guide for a specific idea from the provided list.
Note:
- You will need to replace the placeholder content in the
sampleProjectScaffold.txt
file with your desired structure for the project guide. - This script is a basic example and can be further customized to fit your specific needs.
Additional Resources:
- Google Generative AI Documentation: https://developers.google.com/focus/ai-development
- @google/generative-ai library: https://github.com/GoogleCloudPlatform/generative-ai