Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create index.md #1

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ddef364
Birth and movement quick form blog posts #16
mstenta May 15, 2023
061193c
update nodejs version used to build deploy previews
wotnak Aug 9, 2023
8418744
Organizing Farm Data with farmOS Post
symbioquine Aug 9, 2023
5bedbf9
Fix typos in organizing farm data post
symbioquine Sep 16, 2023
645b870
Create index.md
rgcarr May 16, 2023
105a12a
Update index.md
rgcarr May 17, 2023
3dfb83a
Update index.md
rgcarr May 17, 2023
65e5a43
Update posts/2023/installing-farmos-on-ddev-with-composer/index.md
rgcarr May 17, 2023
aeb6796
Update DDEV and install paragraphs
paul121 Nov 3, 2023
a9ee36e
Update installation steps
paul121 Nov 3, 2023
067f1c6
Add usage information
paul121 Nov 3, 2023
3652aa4
Add note on going to production
paul121 Nov 3, 2023
5a51f2f
Add note on docker image limitations
paul121 Nov 3, 2023
9240841
Update for farmOS v3
paul121 Nov 3, 2023
d9d5f06
Make link to development environment docs more unique
paul121 Nov 4, 2023
2206357
Add comma
paul121 Nov 4, 2023
6beb3fc
Change sentence to present tense
paul121 Nov 4, 2023
6b889f9
Describe docker challenges in more concise language
paul121 Nov 4, 2023
97fdc3d
Improve paragraph describing complex use-cases
paul121 Nov 4, 2023
7abd6f4
Add project directory creation
paul121 Nov 4, 2023
78d1cf7
Update posts/2023/installing-farmos-on-ddev-with-composer/index.md
symbioquine Nov 4, 2023
141ff75
Update posts/2023/installing-farmos-on-ddev-with-composer/index.md
symbioquine Nov 4, 2023
8579617
PostgreSQL
paul121 Nov 5, 2023
631e9f1
DDEV
paul121 Nov 5, 2023
8492832
Remove -p argument
paul121 Nov 5, 2023
6886776
Update posts/2023/installing-farmos-on-ddev-with-composer/index.md
paul121 Nov 5, 2023
e1ef8ed
Update posts/2023/installing-farmos-on-ddev-with-composer/index.md
paul121 Nov 5, 2023
2f463a9
Remove ddev launch
paul121 Nov 5, 2023
0128f49
Update going to production
paul121 Nov 5, 2023
da793a8
Add wotknak/ddev-farmos
paul121 Nov 5, 2023
bb62b1b
Update date and authors
paul121 Nov 5, 2023
0b40c7e
Fix text wrap in lists
paul121 Nov 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[build]
publish = "farmOS.org/public/"
command = "npm run build-preview"
environment = { NODE_VERSION = "18" }

[[headers]]
for = "/*"
Expand Down
Binary file added posts/2023/birth-quick-form/birth.mp4
Binary file not shown.
118 changes: 118 additions & 0 deletions posts/2023/birth-quick-form/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
title: Birth Quick Form
date: 2023-05-22
author: Michael Stenta
slug: 2023/birth-quick-form
---

# Birth Quick Form

The farmOS [v2.1.0 release](https://github.com/farmOS/farmOS/releases/tag/2.1.0)
includes a new and improved *Birth Quick Form* for quickly and easily recording
animal births. This feature existed in farmOS v1, and has now been ported to v2.

See the video below for a quick demonstration, and read on for more details.

<video controls>
<source src="./birth.mp4" type="video/mp4">
</video>

Recording the birth of animals in farmOS involves creating a few different
records:

1. A mother Animal asset to represent the animal that is pregnant.
2. A Birth log that represents when/where/how the mother gave birth.
3. One or more Animal assets that represent the newly born children.
4. One or more Observation logs to record the child birth weights (if desired).

Creating all of these records can be tedious, especially during a busy birthing
season!

The Birth Quick Form tries to make this process easier with a single form for
creating the Birth log and all the children Animal assets in one step. The only
requirement is that you have a mother Animal asset record to start.

## Birthdate

The form starts by asking for the date of birth. This defaults to the current
date, so you can record births on the fly when they happen. You can also adjust
this date to record births that happened in the past. This date will be used
for the Birth log's timestamp, as well as in the "Birthdate" field of all the
children assets.

## Child information

Next, the form asks how many children were born. Below this dropdown there will
be sets of questions for each child. Changing the number of children in the
dropdown will add/remove additional sets of child questions automatically.

Within each set of child questions, you can fill in the following information:

- Child name
- Child ID tag information (tag type, tag ID, tag location)
- Sex (male or female)
- Birth weight
- Notes about this child
- Survived birth (yes or no)

You must enter *either* a child name *or* child ID tag information. If a name is
not provided, the tag ID will be used as the child asset's name.

Birth weight can be specified in *lbs* (for US/imperial measurements) or *kg*
(for metric measurements), depending on how your farmOS is configured. If a
birth weight is entered, then an Observation log will be created that references
the child asset with the recorded weight as a quantity on the log.

Notes about the child will be saved to the Notes field of the child Animal
asset itself. There is a separate Notes field for the overall birth of all
children at the bottom of the quick form.

The "Survived birth" checkbox will determine whether or not the child Animal
asset status is set to "Active" or "Archived" when it is created. Assets will
still be created for animals that did not survive birth, but will be immediately
archived so their data is still saved.

## Birth information

Below the child-specific questions are three sections in vertical tabs:

- Lineage
- Group (if the Group module is enabled)
- Notes

Within the Lineage tab there are three fields:

- Birth mother
- Genetic mother
- Genetic father

A new feature of the farmOS v2 Bith Quick Form is the ability to differentiate
the birth mother and genetic mother. The birth mother will be referenced in the
Birth log that is created. The genetic mother will be referenced as a parent of
the children assets that are created.

You must specify *either* the birth mother *or* the genetic mother by
referencing an existing Animal asset. If you haven't created this asset yet, you
can open a new browser tab, create the mother asset, and then go back to the
Birth Quick Form tab to reference it. Start typing the mother asset's name into
the field and select the mother asset you want from the dropdown that appears.

If only one mother is referenced in either field, it is assumed that they are
both the birth mother and genetic mother. So at the very least you only need to
specify one.

If the Group module is enabled, a "Group" tab will be visible under "Lineage".
This allows you to specify which Group asset the children will be made members
of. If this is left blank, the children will become members of the birth
mother's group, if available. Otherwise, no group membership will be assigned.

Finally, a Notes field is provided for the overall birth. This can be used to
record any notes, observations, complications, etc about the birthing process.
These will be saved to the Notes field of the Birth log, as opposed to the Notes
field of individual children assets described above.

## Submit

If everything you entered is valid, when you submit the form you will see a
number of status messages with links to the records that were created, including
the Birth log, child Animal assets, and weight Observation logs.
115 changes: 115 additions & 0 deletions posts/2023/installing-farmos-on-ddev-with-composer/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
---
title: Installing farmOS on DDEV with Composer
date: 2023-11-05
author: rgcarr, Paul Weidner
slug: 2023/installing-farmos-on-ddev-with-composer
---

# DDEV

For the recommended farmOS local development environment using Docker and Docker Compose, see the
[farmOS development environment docs](https://farmos.org/development/environment). That method works great in
supported environments for developing farmOS core and small projects but can
require additional configuration when working on larger projects in different
environments like Colima. For these use-cases installing farmOS in a
[DDEV](https://ddev.com/) environment may be more straightforward.

> DDEV is an open source tool for running local web development environments for PHP, Python and Node.js, ready in minutes. Its powerful, flexible per-project environment configurations can be extended, version controlled, and shared. DDEV allows development teams to adopt a consistent Docker workflow without the complexities of bespoke configuration.

DDEV's many features are what make it a great way to build Drupal and farmOS
projects in a local environment:

* Cross-platform, open source software.
* Supports many versions of Docker or can be used with Colima.
* When combined with Colima and Mutagen, performance is significantly improved.
* Automatic HTTPS.
* Run multiple projects concurrently.
* Can be used to develop many other CMSs.
* Support multiple databases (including MySQL, PostgreSQL, SQLite).
* Lots of developer tools included, and is easy to extend and integrate.

# Installing farmOS with DDEV and Composer

- First, follow the instructions to install and setup DDEV: https://ddev.readthedocs.io/en/latest/users/install/
- Once installed you can create a DDEV project and install farmOS. Your DDEV project is configured to use a specific PHP and database version and can include additional DDEV addons and services. Here are two examples of how to create and configure your DDEV project:

1. Use the `wotnak/ddev-farmos` addon to configure a DDEV project with the latest recommended versions of PHP, PostgreSQL and PHP GEOS for farmOS. This addon will also configure the private filesystem and a Cron job for Drupal.
```
# Create a directory for the farmOS DDEV project
mkdir farmos-project && cd farmos-project
ddev config --project-type=php
ddev get wotnak/ddev-farmos
ddev composer create farmos/project:3.x-dev
ddev drush site:install farm --account-name=admin --account-pass=admin -y
ddev drush uli
```

2. If you prefer, you can also configure each aspect of the DDEV project yourself:
```
# Create a directory for the farmOS DDEV project
mkdir farmos-project && cd farmos-project
ddev config --project-type=drupal10 --docroot=web --create-docroot --database=postgres:15 --php-version=8.2
ddev get wotnak/ddev-php-geos
ddev start
ddev composer create "farmos/project:3.x-dev"
ddev drush site:install farm --account-name=admin --account-pass=admin -y
ddev drush uli
```

## Usage

### Useful DDEV commands:
- Start/stop a project: `ddev start`/ `ddev stop`
- Open project: `ddev launch`
- Stop DDEV: `ddev poweroff`
- PHP CLI: `ddev php`
- Additional DDEV commands: https://ddev.readthedocs.io/en/latest/users/usage/cli/

### Drush
- Drush commands: `ddev drush {drush command}`
- Login link: `ddev drush uli`
- CRON: `ddev drush cron`
- Additional Drush commands: https://www.drush.org/latest/commands/all/

### Composer:
- Add dependency (exmple `farm_organic`): `ddev composer require drupal/farm_organic`
- Updating dependencies: `ddev composer update`
- See farmOS documentation on using Composer: https://farmos.org/hosting/composer/

# Going to production

It should be noted that DDEV _is not_ designed to be used as a production
hosting environment. DDEV is designed to make managing a local development
environment easier. Taking a local environment to production depends entirely
on how that production environment is built. Most composer-based workflows
will expect the project's `composer.json`, `composer.lock` and any application
code be checked in to source control, from which the production environment
can be built. For more information on hosting farmOS see:
- [Installing farmOS](https://farmos.org/hosting/install/)
- [Building farmOS with Composer](https://farmos.org/hosting/composer/)

Another strategy that might be worth experimenting with is DDEV's hosting
provider integrations. These can be customized for different workflows to sync
data between a production and the local environment. For more information see
[Hosting Provider Integration](https://ddev.readthedocs.io/en/stable/users/providers/).

# Docker image limitations

farmOS uses Docker and Docker Compose to create and distribute reproducible
development environments. Each commit to
farmOS builds a new Docker image that includes the environment and development
dependencies required to install, test, and lint the core codebase. While this
process works well to onboard many new contributors and developers of
farmOS, it also produces some headaches.

Docker can be unintuitive to install and configure on non-linux systems. Long-existing platform issues
such as slow file systems in macOS and WSL2 complexities in Windows frequently present challenges for
new farmOS admins and developers.

Another issue with development and production environments based on the official
farmOS Docker images is that many use-cases quickly outgrow the default set of modules
and site configuration. In some cases, one can work around that with a deep understanding
of Docker and/or Docker Compose, but such environments can be fragile to updates and
more challenging to document, share, and recreate in a team context.

DDEV offers a refreshing experience for local development of farmOS in Docker - consider trying it out!
Binary file added posts/2023/movement-quick-form/geometry.mp4
Binary file not shown.
98 changes: 98 additions & 0 deletions posts/2023/movement-quick-form/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
title: Movement Quick Form
date: 2023-05-22
author: Michael Stenta
slug: 2023/movement-quick-form
---

# Movement Quick Form

The farmOS [v2.1.0 release](https://github.com/farmOS/farmOS/releases/tag/2.1.0)
includes a new and *Movement Quick Form* for quickly and easily recording the
movement of assets to a new location. This feature existed as a more specific
*Animal movement* quick form in farmOS v1, and has now been ported to v2 and
generalized for use with any asset type (eg: Equipment, Plants, etc).

See the video below for a quick demonstration, and read on for more details.

<video controls>
<source src="./movement.mp4" type="video/mp4">
</video>

Recording the movement of assets in farmOS requires creating a log with the
following information:

- The date of the movement
- The assets that are moving
- The locations that they are moving to
- The geometry of the new location

In order for this log to be counted towards the asset's current location, it
must have a status of "Done", with a date in the past, and the "Is movement" box
checked.

For more information, see:
[farmOS Location Logic](https://farmOS.org/model/logic/location)

The Movement Quick Form streamlines this process by asking for only the
essential information and filling in the rest automatically.

The form starts by asking for the date when the movement took place. This
defaults to the current date, so you can record movements on the fly when they
happen. You can also adjust this date to record movements that happened in the
past, or movements that you are planning in the future. If you plan future
movements, be sure to uncheck the "Completed" box at the bottom of the form to
indicate that it hasn't happened yet.

Next, you must specify the assets that are moving. Start typing an asset's name
into the Assets field and select the one you want from the dropdown that
appears. Separate multiple assets with a comma.

You can select the locations that the assets are moving to in the same way. If
no locations are specified, this will clear the current location of the assets.

If the assets and locations you selected have a geometry already, they will
automatically show up on the map within the form. Current asset location
geometry will be displayed in blue, and the new geometry will be displayed in
orange.

The geometry for the movement is editable within the map, which allows you to
customize the asset's new geometry. Use the map's edit controls to select the
geometry you want to edit, and use the modify, move, or delete buttons to change
them. You can also use the polygon, line, point, and circle buttons to draw new
geometries.

Customizing the geometry of the movement does *not* change the geometry of the
location assets you selected. The custom geometry is only saved to the movement
log and thus only affects the moved asset(s). For more information on location,
see [Movements and location](https://farmos.org/guide/location/) in the farmOS
user guide.

See the video below for a quick demonstration.

<video controls>
<source src="./geometry.mp4" type="video/mp4">
</video>

One example where this is useful is moving animals with temporary fencing for
rotational grazing purposes. You may move a fence multiple times within the same
paddock, and you want to be able to record exactly where the animals were grazed
and for how long. The Movement Quick Form can accomplish this by referencing the
same location multiple times, but drawing the fence geometry differently each
time.

Another example could be moving a piece of equipment to a field, but specifying
the exact point where it was moved, so you (or someone else) can find it again
easily. Using the Movement Quick Form, you can specify a location like "North
Field" and also draw a point on the map exactly where the equipment is in "North
Field".

At the bottom of form there is an area to enter notes about the movement, which
will be saved to the "Notes" field of the log that is created.

The "Completed" checkbox at the bottom defaults to "Completed", but can be
unchecked if you are planning a future movement.

Upon submitting the form, you will see a message with a link to the new log that
is created, and if you look at your asset records you will see that their
current location and geometry have been updated.
Binary file added posts/2023/movement-quick-form/movement.mp4
Binary file not shown.
Loading