Giter Site home page Giter Site logo

htmx-ai's Introduction

htmx-ai

HTMX-AI allows you to create AI generated webdesign by just providing a prompt via the hx-ai attribute.

You can see a live demo here

Youtube Video about how this project was made

You can learn more about how it works and how i made it here

<button hx-ai="Generate a website design for a coffee shop"></button>

You can use hx-target just like you would in any other HTMX application to specify where the response should be inserted.

<button hx-ai="Generate a website design for a coffee shop" hx-target="#design"></button>
<div id="design"></div>

Configuration

HTMX-AI uses the OpenAI APi in the background. You need to provide an API key in the .env file.

OPENAI_API_KEY=your-api-key

To enable the htmx-ai extension on a page you need to initialize it on one parent element like this:

<body hx-ext="ai">

If you want to use anything other than the default api endpoint at htmx-ai.test, you can set a custom endpoint

<body hx-ext="ai" hx-ai-endpoint="https://super-secure-ai-api.com">

Run with reverse proxy

First you need to configure traefik as a reverse proxy. (like described here).

Afterwards you can start the service with the following command:

docker-compose up -d

Run with bun

To install dependencies:

bun install

To run:

bun run server.ts

Disclaimer

DO NOT use untested and unreviewed AI generated content in production. This is a proof of concept and should not be used in production.

htmx-ai's People

Stargazers

Bachkukkik avatar Serkan (E.) Sökmen avatar  avatar HelloBagus avatar  avatar elCico avatar Periklis Papanikolaou avatar Isidore B avatar Philip Levy avatar Aliaksei avatar  avatar Fraug'Dib avatar Siraphop avatar yk avatar ACH avatar Jon Currey avatar Paul Devey avatar Nico Baier avatar EasyDev avatar Clemens avatar Ryan Sorensen avatar deepfates avatar Salman Ahmed avatar Mert Aytemiz avatar  avatar Lukas Mörtl avatar James Wilson avatar AaronShih avatar Cody avatar Sebastian Korotkiewicz avatar HimanshU avatar Tami avatar Dan Lourenço avatar Hüseyin Demirtaş avatar Tobi DEGNON avatar Darren Semotiuk avatar Benjamin Franklin avatar lew avatar Justin Rocket avatar Ashish Hirpara avatar oven avatar  avatar  avatar Pooya Parsa avatar Albin Kocheril Chacko avatar Owen Sawler avatar Waylon Walker avatar  avatar  avatar Asaf Agami avatar Thassio Victor avatar Andrew Rhyand avatar Thomas avatar Greg Wedow avatar Daniel Ruiz avatar PatrickJS avatar Christoph Enne avatar Florian Karner avatar XADE avatar Jack DeVries avatar  avatar Tim Kersey avatar Matthias Weiß avatar  avatar Ali Rathore avatar Felix Frey avatar Aland Osman avatar Gregor Vostrak avatar

Watchers

Yared Getachew avatar Gregor Vostrak avatar  avatar Bufferhead avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.