Open source gardening
Tags: gardening, rails, vue, openlayers
Published: 2020-12-09 22:14:02

Hi gardeners and developers!

I plan to start a garden and, as I'm a total newbie in the domain, I thought that an application should help in the process...

## I can haz some app to...
- be able to draw or place elements (trees, patches, living _things_) on a drawing of my garden
- be able to plan actions on the different elements
- have a TODO list

So I started to write an app to do all these things.

## Here comes Garden Party

And now, something came out of a few weeks of lock-down coding™: **Garden Party**. A _Ruby on Rails_ application with some _VueJS_ and _OpenLayers_. And a documented API.

The project is small for now but OpenSource, under the MIT license.

Feel free to use, create your own instance and/or contribute; constructive reviews are welcome.

## A few things to note:

- Interface is in french; an English translation is ready, I _only_ have to implement a button to switch languages (and the associated action);
- Content is in french, as are the development seeds. Some database rework is needed to support translated content. Additionally, I think that gardening is kind of region-related: people from [not-growing-kiwis-area] don't grow kiwis... Issues are here to discuss about this :)
- API authentication is cookie-based :/
- I'm bad on UI/UX things
- I have a lot of ideas for new features

## Links
- Online instance: [garden-party.experimentslabs.com](https://garden-party.experimentslabs.com)
- Sources: [garden-party on Gitlab](https://gitlab.com/experimentslabs/garden-party)

## Technical notes

If you're developing a Rails+VueJS application, these few points may give you some ideas for your projects:

A [rake task](https://gitlab.com/experimentslabs/garden-party/-/blob/master/lib/tasks/js.rake) [generates](https://gitlab.com/experimentslabs/garden-party/-/blob/master/lib/classes/front_generator.rb)
- JavaScript "models", used by VueX to add some sugar to entities
- VueX modules based on models

This really helps, as writing VueX stores is a repetitive chore to write (a bit less when it's [dynamically created](https://experimentslabs.com/articles/vuex-modulator-part-1-generating-vuex-modules)).

There are [custom _scaffolding_ generators](https://gitlab.com/experimentslabs/garden-party/-/tree/master/lib/templates)
- for API controllers.
- for admin area controllers and views.

Swagger documentation is generated during RSpec tests (it validates API outputs and builds the [swagger reference file](https://garden-party.experimentslabs.com/swagger.json)).

The test suite is RSpec + Cucumber + linters and Brakeman; I'm working on Jest tonight to write some components tests.

## Screenshots

**"Map" view** where you place things (Picture is a render from SweetHome3D)
![Screenshot_2020-12-09 Garden Party](https://dev-to-uploads.s3.amazonaws.com/i/2plfdtqj6wdgg88qac6w.png)

**Inventory view, with a quick look of the placed resources**
![Screenshot_2020-12-09 Garden Party(1)](https://dev-to-uploads.s3.amazonaws.com/i/yx4c39ow88wfmuaqxy0z.png)

**Todo list**
![Screenshot_2020-12-09 Garden Party(2)](https://dev-to-uploads.s3.amazonaws.com/i/r1x67ukyxeckr4ql26g1.png)

**It works with OpenStreetMap... maps**
![Screenshot_2020-12-09 Garden Party(3)](https://dev-to-uploads.s3.amazonaws.com/i/ct78acgrwmzcljy9y41t.png)

**Library**
![Screenshot_2020-12-09 Garden Party(5)](https://dev-to-uploads.s3.amazonaws.com/i/ahu4rpwarumg9n8o3pn5.png)
 
Thank you for getting to the end of this post!

_For all the incorrect English formulations, I'm also open to comments to fix them_