Draw a mockup and generate html for it
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Go to file
Sawyer Hood 9058da6ed9 Upgrade nextjs 3 years ago
.github/workflows Add a github action to lint and build (#30) 3 years ago
app Update to gpt-4o 3 years ago
components Don't close modal when you click in it 3 years ago
lib Initial Commit 3 years ago
public Initial commit from Create Next App 3 years ago
.eslintrc.json Initial commit from Create Next App 3 years ago
.gitignore Initial commit from Create Next App 3 years ago
LICENSE Create LICENSE 3 years ago
README.md Update README 3 years ago
demo.gif Update readme 3 years ago
next.config.js Initial commit from Create Next App 3 years ago
package-lock.json Upgrade nextjs 3 years ago
package.json Upgrade nextjs 3 years ago
postcss.config.js Initial commit from Create Next App 3 years ago
tailwind.config.ts Initial commit from Create Next App 3 years ago
tsconfig.json Initial commit from Create Next App 3 years ago

README.md

draw-a-ui

This is an app that uses tldraw and the gpt-4-vision api to generate html based on a wireframe you draw.

I'm currently working on a hosted version of draw-a-ui. You can join the waitlist at draw-a-ui.com. The core of it will always be open source and available here.

A demo of the app

This works by just taking the current canvas SVG, converting it to a PNG, and sending that png to gpt-4-vision with instructions to return a single html file with tailwind.

Disclaimer: This is a demo and is not intended for production use. It doesn't have any auth so you will go broke if you deploy it.

Getting Started

This is a Next.js app. To get started run the following commands in the root directory of the project. You will need an OpenAI API key with access to the GPT-4 Vision API.

Note this uses Next.js 14 and requires a version of node greater than 18.17. Read more here.

echo "OPENAI_API_KEY=sk-your-key" > .env.local
npm install
npm run dev

Open http://localhost:3000 with your browser to see the result.