nedzib / human_to_activerecord

An small app based on ChatGPT to translate human language to an ActiveRecord Query inspired by https://www.sqltranslate.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Human to ActiveRecord

Live on Railway

This Rails 7 application demonstrates the use of ChatGPT API to translate human natural language queries into ActiveRecord queries. It is a database-less application using Stimulus Reflex and Cable Ready to provide real-time updates.

The app was inspired by SQLTranslate, which provided the initial idea and inspiration for creating a similar tool that translates natural language queries into ActiveRecord queries.

Features

  • Translates natural language queries to ActiveRecord queries.
  • Real-time updates using Stimulus Reflex and Cable Ready.
  • Minimalistic and database-less architecture.

Requirements

  • Ruby (version 3.1.2)
  • Ruby on Rails (version 7.0.7)

Installation

  1. Clone this repository:
git clone https://github.com/nedzib/human_to_activerecord
cd human_to_activerecord
  1. Install gem dependencies:
bundle install
  1. Setup your chatGPT API key:
    • Create a .env file in the project root.
    • Add your ChatGPT API credentials to the .env file:
CHATGPT_API_KEY=your_api_key_here
  1. Start the Rails server:
rails server
  1. Visit the app at http://localhost:3000
  2. Enjoy!

Contributing

Contributions are welcome! Feel free to open issues or pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

An small app based on ChatGPT to translate human language to an ActiveRecord Query inspired by https://www.sqltranslate.app/


Languages

Language:Ruby 68.4%Language:HTML 19.5%Language:JavaScript 10.3%Language:CSS 1.9%