Known Vulnerabilities Github CI codecov Ruby Style Guide

Leaf Ledger logo

Table of Contents

About Leaf Ledger

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.

Deployed Site

The backend is deployed here

Learning Goals

  • 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

Setup

This app uses Rails 7.0.5.1 and Ruby 3.2.2

  1. Fork and clone this repository
  2. cd into root directory
  3. Run bundle install
  4. Run bundle exec figaro install
  5. In app/config/application.yml add your API key
    OPENAI_API_KEY: <API KEY GOES HERE>
    
    You can sign up for a OpenAI API key here
  6. Run rails db:{drop,create,migrate} to setup the databases
  • To run the test suite: Run bundle exec rspec

Tech Stack

  • Ruby 3.2.2
  • Rails 7.0.5.1

Database Schema

datbase diagram

API Endpoints

Plants

Users

UserPlants

APIs Used

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

  • ...