This Rails application allows users to create and manage task lists with the help of OpenAI's GPT model. The app provides a simple and intuitive interface for creating lists manually or generating them automatically using AI.
- AI-Powered List Generation: Enter a list name (e.g., "Grocery store list") and the app will use OpenAI to generate a relevant list of tasks
- Manual List Creation: Create lists and tasks manually
- List Management: View, edit, and delete lists and their associated tasks
- Responsive Design: Clean, modern UI built with Tailwind CSS
- Framework: Ruby on Rails 8.0
- Database: PostgreSQL
- Frontend: Tailwind CSS, Hotwire (Turbo + Stimulus)
- AI Integration: OpenAI GPT-3.5 Turbo via ruby-openai gem
- Ruby 3.x
- Rails 8.0.x
- PostgreSQL
- OpenAI API key
-
Clone the repository:
git clone [email protected]:caiofct/TaskApp.git cd TaskApp
-
Install dependencies:
bundle install
-
Set up the database:
rails db:create db:migrate
-
Configure your OpenAI API key:
EDITOR="vim" rails credentials:edit
Add your OpenAI API key to the credentials file:
openai: api_key: your_openai_api_key_here
-
Start the server:
rails server
-
Visit
http://localhost:3000
in your browser
- On the homepage, find the "Generate List with AI" form
- Enter a descriptive list name (e.g., "Weekend camping trip", "Office supplies", "Birthday party planning")
- Click "Generate with AI"
- The app will create a new list with AI-generated tasks based on your input
- Create new lists using the "New List" button
- Add tasks to existing lists
- Mark tasks as complete by checking them
- Edit or delete tasks as needed
The application uses the OpenAI GPT-3.5 Turbo model to generate task lists. When a user submits a list name:
- The app sends a request to the OpenAI API with a prompt asking for tasks related to the list name
- The API returns a JSON array of task names
- The app creates a new list with the provided name and populates it with the generated tasks
- The user can then view and manage the generated list like any other list in the system
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.