2019-12-18 13:01:55 -07:00
|
|
|
# FarmBot Source Project structure
|
2019-12-18 10:55:01 -07:00
|
|
|
|
2019-12-18 13:01:55 -07:00
|
|
|
The FarmBot OS application is broken into several sub OTP applications.
|
2019-12-18 10:55:01 -07:00
|
|
|
|
|
|
|
* [farmbot_celery_script](/docs/project/farmbot_celery_script.md)
|
|
|
|
* [farmbot_core](/docs/project/farmbot_core.md)
|
|
|
|
* [farmbot_ext](/docs/project/farmbot_ext.md)
|
|
|
|
* [farmbot_firmware](/docs/project/farmbot_firmware.md)
|
|
|
|
* [farmbot_os](/docs/project/farmbot_os.md)
|
|
|
|
* [farmbot_telemetry](/docs/project/farmbot_telemetry.md)
|
|
|
|
|
2019-12-18 13:51:05 -07:00
|
|
|
## Generating Specific documentation
|
|
|
|
|
|
|
|
Each project has it's own inline documentation. Documentation can be
|
|
|
|
generated by changing directory into the application of interest and
|
|
|
|
using `exdoc` to generate docs. For example for `farmbot_core`:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cd farmbot_core
|
|
|
|
mix deps.get
|
|
|
|
mix docs
|
|
|
|
```
|
|
|
|
|
|
|
|
Generating docs for all projects can be done with the root level Makefile:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
make deps
|
|
|
|
make docs
|
|
|
|
```
|
|
|
|
|
2019-12-18 10:55:01 -07:00
|
|
|
## Commonality
|
|
|
|
|
|
|
|
All of these folders share a common structure.
|
|
|
|
|
2019-12-18 13:01:55 -07:00
|
|
|
```bash
|
|
|
|
$ tree $OTP_APP_ROOT
|
|
|
|
$OTP_APP_ROOT
|
2019-12-18 10:55:01 -07:00
|
|
|
├── lib/
|
|
|
|
│ ├── application.ex
|
|
|
|
│ └── some_file.ex
|
|
|
|
|
|
|
|
|
├── test/
|
|
|
|
| └── test_helper.exs
|
|
|
|
|
|
|
|
|
├── config/
|
|
|
|
| └── config.exs
|
|
|
|
|
|
|
|
|
├─── mix.exs
|
|
|
|
└─── mix.lock
|
|
|
|
|
|
|
|
* The `lib` folder contains Elixir source code
|
|
|
|
* the `test` folder contains Elixir scripts responsible for testing the `lib` code
|
2019-12-18 13:01:55 -07:00
|
|
|
* the `config` folder contains Elixir scripts responsible for
|
|
|
|
configuring the **current** OTP app
|
|
|
|
* `mix.exs` and `mix.lock` files are responsible describing
|
|
|
|
the OTP app, and managing external dependencies
|