Coder Social home page Coder Social logo

ditto190 / react-agent Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eylonmiz/react-agent

0.0 0.0 0.0 5.31 MB

The open-source React.js Autonomous LLM Agent

Home Page: https://reactagent.io/

License: MIT License

JavaScript 0.77% TypeScript 83.14% CSS 15.86% HTML 0.23%

react-agent's Introduction

ReactAgent - The open-source React.js Autonomous LLM Agent

Logo


Watch Demo »

Website · Watch Demo · Demo Code Example · Docs · Discord

MIT License Number of GitHub stars Discord is Live Docs are updated Product Hunt

ReactAgent.-.The.open-source.React.js.LLM.Agent.-.Demo.mp4

📖 Introduction

ReactAgent is an experimental autonomous agent that uses GPT-4 language model to generate and compose React components from user stories. It is built with React, TailwindCSS, Typescript, Radix UI, Shandcn UI, and OpenAI API.

🚀 Features

  • Generate React Components from user stories
  • Compose React Components from existing components
  • Use a local design system to generate React Components
  • Use React, TailwindCSS, Typescript, Radix UI, Shadcn UI
  • Built with Atomic Design Principles

😮 Example

Example

🌈 Quickstart

  1. Clone repository
git clone [email protected]:eylonmiz/react-agent.git
  1. Change to the project directory
cd react-agent
  1. Get an OpenAI API Key
  2. Set OPENAI_SECRET_KEY in backend/main .env file (see .env.example) or run the script below
echo OPENAI_SECRET_KEY="INSERT_YOUR_OPENAI_SECRET_KEY_VALUE_HERE" >> backend/main/.env
  1. Install dependencies
yarn install
  1. Run Backend Script - This script generates the components
yarn backend:dev
  1. Run Frontend App to see your components in action
yarn frontend:dev
  1. Open frontend/main/src/GenReactApp.tsx
Read the instructions and change the example component to the component you generated
  1. Read Project Customization Section
Read the Project Customization Section to learn how to customize and operate the project

📚 Documentation

PRD / User Story to code

Feature Flow

Component Generation Flow

Component Generator

🛠️ Project Customization

  1. Customize workflow:
    • file: backend/main/react-agent/generateComponents.ts
    • description: Can control the flow of the generation process, run step by step or full flow.
  2. Render Application
    • file: frontend/main/src/GenReactApp.tsx
    • description: Render the generated application, see examples in the file.
      • use JsonSkeleton to render the skeleton of the page
      • use demo.tsx files to render the demo page
  3. Generate React Components
    • folder: create a folder under LOCAL_COMPONENTS_DIR (default frontend/main/src/react-agent) (see .env.example file)
    • description: Generate a user-story.md file under the folder, make it as detailed as possible.
    • change CONTAINER_PATH in generateComponents.ts to the folder name
    • run the backend script to generate the React Components.
  4. Customize Folder Structure (see .env.example file)
    • UI_COMPONENTS_DIR - Where your UI components are located
    • DEMO_COMPONENTS_DIR - Where your UI components demo files are located
    • LOCAL_COMPONENTS_DIR - Where your generated components are located

📦 Next Steps

  • Edit existing components
  • Test Components after generating
  • Wireframe image to skeleton code
  • Remote design system to generate React Components
  • Use of external libraries
  • Component logic control (state, props, context, effects, api calls, etc.)

⚠️ Limitations

  • The generated code is not production-ready and should be used for prototyping purposes only.
  • Only works well with GPT4, GPT-3.5 is not supported ATM, so make sure you have GPT4 enabled in your OpenAI account.
  • The output may come with a few bugs and errors, so it is recommended to review and test the code before using it in a production environment, or even running it in a development environment.
  • The first step of the generation process is to convert the user story into a JSON file. This step is not perfect and may result in some inaccuracies or missing information, consider changing the JSON file manually if necessary.
  • Advised to run it step by step, and review the generated code after each step.

🛡 Disclaimer

This project, ReactAgent, is an experimental application and is provided "as-is" without any warranty, express or implied. By using this software, you agree to assume all risks associated with its use, including but not limited to data loss, system failure, or any other issues that may arise.

The developers and contributors of this project do not accept any responsibility or liability for any losses, damages, or other consequences that may occur as a result of using this software. You are solely responsible for any decisions and actions taken based on the information provided by ReactAgent.

Please note that the use of the GPT-4 language model can be expensive due to its token usage. By utilizing this project, you acknowledge that you are responsible for monitoring and managing your own token usage and the associated costs. It is highly recommended to check your OpenAI API usage regularly and set up any necessary limits or alerts to prevent unexpected charges.

As an autonomous experiment, ReactAgent may generate content or take actions that are not in line with real-world business practices or legal requirements. It is your responsibility to ensure that any actions or decisions made based on the output of this software comply with all applicable laws, regulations, and ethical standards. The developers and contributors of this project shall not be held responsible for any consequences arising from the use of this software.

By using ReactAgent, you agree to indemnify, defend, and hold harmless the developers, contributors, and any affiliated parties from and against any and all claims, damages, losses, liabilities, costs, and expenses (including reasonable attorneys' fees) arising from your use of this software or your violation of these terms.

👨‍💻 Contribution

💪 By the community, for the community

Powered by reactagent.io

  • Co-created by @eylonmiz and @leetwito

react-agent's People

Contributors

eylonmiz avatar adrianlamdev avatar areibman avatar datrixcompany avatar eltociear avatar leetwito 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.