The AI-powered UI components generator web app enables developers to generate Next.js Tailwind CSS UI components with an implementation tutorial.
The generator has an embedded code editor where users can modify the generated code and directly see the results.
The web app leverages the power of Langchain and Tavily AI agents to do web searches in order to generate accurate and up-to-date code snippets and implementation tutorials.
Here are screenshots showing the web app in action.
First, install the packages and dependencies.
npm install
Second, create a file named .env.local on your root directory. Then add your OpenAI and Tavily API keys to the file.
OPENAI_API_KEY="Your OpenAI API key"
TAVILY_API_KEY="Your Tavily API key"
To get the ChatGPT API key, navigate to https://platform.openai.com/api-keys.
To get the Tavily Search API key, navigate to https://app.tavily.com/home
Finally, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
Check out this tutorial on DevTo on how to build the UI Components Generator.