- About Leaf Ledger
- Deployed Site
- Learning Goals
- Setup
- Tech Stack
- Database Schema
- API Requests
- APIs Used
Leaf Ledger is a tool for planning your garden and finding information about how to care for the plants in your garden.
OpenAI's API is used for all gardening information. With the amount of data being requested for each plant the request runs as a background job using Redis/Sidekiq and a flash message will appear when the data is ready (usually within 10 seconds).
Plant data does not tend to change so as users request new plants the response from OpenAI(ChatGPT) will be stored in the database for faster retrieval on future calls.
An extension that will come shortly after the above is implemented will be to add OpenAI(DALL-E) generated images for the plants as well. Using AWS s3 for image storage.
The backend is deployed here
- Consume OpenAI API to get more experience with AI and chatGPT
- Self teach and implement a React.js front end
- Continued practice of CI/CD and Rails best practices
- Use AWS s3 for image storage
This app uses Rails 7.0.5.1 and Ruby 3.2.2
- Fork and clone this repository
cd
into root directory- Run
bundle install
- Run
bundle exec figaro install
- In
app/config/application.yml
add your API keyYou can sign up for a OpenAI API key hereOPENAI_API_KEY: <API KEY GOES HERE>
- Run
rails db:{drop,create,migrate}
to setup the databases
- To run the test suite: Run
bundle exec rspec
- Ruby 3.2.2
- Rails 7.0.5.1
- Create a user_plant (aka add a plant to a user's garden)
- Edit a user_plant
- Get a user_plant
- Get all of a user's user_plants
- Delete a user_plant
Things you may want to cover:
-
Ruby version
-
System dependencies
-
Configuration
-
Database creation
-
Database initialization
-
How to run the test suite
-
Services (job queues, cache servers, search engines, etc.)
-
Deployment instructions
-
...