Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/react-declarative/chatgpt-form-builder

Generate and preview large React components with ChatGPT
https://github.com/react-declarative/chatgpt-form-builder

chatgpt chatgpt-api code-generation gpt4all mui nextjs openai react reactjs tailwindcss

Last synced: about 2 months ago
JSON representation

Generate and preview large React components with ChatGPT

Awesome Lists containing this project

README

        

# ⚛️ ChatGPT React Generator

> The ChatGPT app which write a JSX form for [React-Vite](https://vitejs.dev/) application

![gpt](./docs/gpt.png)

A ChatGPT powered React Code Generator. Specify what kind of React form you want to build and directly get the code and a live preview.

## Contribute

> [!IMPORTANT]
> Made by using [react-declarative](https://github.com/react-declarative/react-declarative) to solve your problems. **⭐Star** and **💻Fork** It on github will be appreciated

## How It's Work

1. The [postinstall.mjs](./scripts/postinstall.mjs) file download `Nous-Hermes-2-Mistral-7B` [LLM](https://en.wikipedia.org/wiki/Large_language_model)

2. The [index.mjs](./index.mjs) file generate RAW `./tmp.txt` according to the [SYSTEM_PROMPT](./assets/SYSTEM_PROMPT.txt) and the [USER_PROMPT](./assets/USER_PROMPT.txt)

3. The [index.mjs](./index.mjs) transform markdown in `./tmp.txt` to jsx in `./src/out/index.jsx` according to the [TRANSFORM_PROMPT](./assets/TRANSFORM_PROMPT.txt)

4. The Vite server start the UI on `http://localhost:3000`

## Usage

1. Run `npm install`

2. Edit the [USER_PROMPT](./assets/USER_PROMPT.txt)

3. Run `npm start` to generate the code. Will take a couple of minutes if running on CPU. GPU require at least 16Gb embedded RAM

4. Run `npm run test` to launch the code