Skip to content
GrowstuffPublic

About

Open data project for small-scale food growers, written in rails

Topics

Resources

Code of conduct

Contributing

Stars

478 stars

Watchers

20 watching

Forks

Latest commit

 

History

13,552 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌱 Growstuff

Build status

Welcome to the Growstuff project.

You can find our app at https://www.growstuff.org

Growstuff is an open source/open data project for food gardeners. We crowdsource information on what our members are growing and harvesting, aggregate it, and make it available as open data via our API.

Growstuff was founded in 2012 and has been built by dozens of contributors. We are an inclusive, welcoming project, and encourage participation from people of all backgrounds and skill levels.

Want to contribute?

Don't ask to ask, the best way to get started is to fork the project, start a codespace and get hacking. Dive on in and submit your PRs!

Vibe Coding is more than okay, just make sure you indicate if you have done so and ensure there are tests.

Important links

  • Issues (features we're working on, known bugs, etc)
  • Wiki (general documentation, etc.)

For coders

Growstuff is built in Ruby on Rails and also uses JavaScript for frontend features. We welcome contributions -- see CONTRIBUTING for details.

  • To set up your development environment, see Getting started.
  • You may also be interested in our API.

Running Rails natively against Dockerized services

If you'd rather run rails server directly on your machine (instead of inside the web container) while still using Docker for Postgres, here's the full setup:

  1. Get the pinned Ruby and Node versions. mise.toml pins both (matching .ruby-version and the Node 24 used in CI). If you use mise, just run:

    mise install

    rbenv/asdf/nvm users can read the versions from mise.toml (or .ruby-version) and install them the usual way instead.

  2. Start the backing services (Postgres, skipping the web container):

    docker compose up -d db
  3. Make the db hostname resolve on your host machine. config/database.yml points at host db, which only exists inside the Compose network. Add this line to /etc/hosts so both Docker and native runs work against the same config:

    127.0.0.1 db
    
  4. Install gems:

    bundle install
  5. Set up your local config. The app reads settings like GROWSTUFF_SITE_NAME from a git-ignored .env file (via dotenv-rails). Copy the example to get started:

    cp env-example .env
  6. Install Yarn and JS dependencies. Yarn isn't bundled with Node — enable it via Node's built-in Corepack, then install:

    corepack enable
    yarn install
  7. Create and load the database:

    bundle exec rails db:create db:schema:load
  8. Start the app:

    bin/dev

    bin/dev uses Procfile.dev (via Foreman, Overmind, or Hivemind) to run the Rails server together with asset compilation watchers (yarn build:watch and yarn build:css:watch). Assets are automatically compiled on changes, so manually precompiling assets (rails assets:precompile) is not required in development.

Sign in with Bluesky

The "Continue with Bluesky" button only appears once the app has a signing key. Bluesky has no client ID or secret to register: our client ID is the URL of /oauth/client-metadata.json, and requests to Bluesky are signed with an ES256 key.

  1. Generate a key:

    bundle exec rake atproto:generate_key
  2. Set the output as GROWSTUFF_ATPROTO_PRIVATE_KEY (in .env locally, or heroku config:set in production). Use a different key for each environment and never commit it.

Without the key the button is hidden and the metadata URL returns 404.

Trying it locally

Bluesky refuses localhost as a callback address and has to fetch the metadata URL itself, so it only works through a public HTTPS tunnel such as ngrok. The free plan is enough.

  1. Start a tunnel to the Rails port:

    ngrok http 3000

    Note the https://….ngrok-free.dev address it prints.

  2. Rails blocks hosts it doesn't know about, so allow the tunnel's hostname (no https://) when you start the server. Put it in .env or your shell rather than in config/environments/development.rb:

    RAILS_DEVELOPMENT_HOSTS=your-name.ngrok-free.dev bin/dev
  3. Open the app at the tunnel's address, not localhost. The client ID and callback URL are built from the address in your browser. ngrok's free plan shows a "Visit Site" page the first time; click through it.

  4. Check /oauth/client-metadata.json loads at that address, then use Sign in with Bluesky on the home page.

If it fails, the generic message hides the reason; look for (bluesky) Authentication failure! in the server output.

Sign in with GitHub

  1. Register a GitHub OAuth App under Settings → Developer settings → OAuth Apps.

  2. Set its authorization callback URL to https://your-growstuff-host/members/auth/github/callback (or http://localhost:3000/members/auth/github/callback for local development).

  3. Set GROWSTUFF_GITHUB_CLIENT_ID and GROWSTUFF_GITHUB_CLIENT_SECRET in the environment or your local .env, then restart the app. Never commit the secret.

    With Docker Compose, put these settings in the project-root .env or export them in your shell, then recreate the web container with docker compose up -d web. Compose forwards both settings to the container; docker compose restart alone does not apply changed environment settings.

GitHub sign-in is hidden unless both settings are present. Use a separate OAuth App for each environment. GitHub provides your public identity for sign-in; we do not store GitHub access tokens or request repository access. After signing up, Growstuff asks you to add an optional email address for notifications and planting reminders, rather than importing an address from GitHub. Existing members should connect GitHub from Settings → Apps before using it to sign in; accounts are not automatically matched by public GitHub email.

If the option is missing, check configuration inside the running app without printing credentials:

bundle exec rails runner 'puts "GitHub sign-in enabled: #{OmniAuth::Strategies::GrowstuffGithub.enabled?}"'

For Docker Compose, prefix that command with docker compose exec web. A false result means at least one credential is missing or blank in the app's environment.

For Home Automation enthusiasts

https://github.com/Growstuff/homeassistant-growstuff/

For designers, writers, researchers, data wranglers, and other contributors

There are heaps of ways to get involved and contribute no matter what your skills and interests.

You might like to check out:

Here on Github, you might find these useful:

Feel free to comment on any of the issues on Github.

Contact

For more information about this project, contact [email protected].

Security Issues: If you find an authorization bypass or data breach, please contact our maintainers directly at [email protected].

About

Open data project for small-scale food growers, written in rails

Topics

Resources

Code of conduct

Contributing

Stars

478 stars

Watchers

20 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages