A lot of code is sorted into modules in the
This is a sorting by topic: each module contains files for one topic.
That can be a gateway,
The Rest api controllers do not go into
their respective module directory but into the
directory. This does not have a good reason but it's the way it is now.
Deprecated module structure
Since legacy code is still widespread through the repository it is important to understand it, too.
The (php) code is roughly structured with Model - View - Controller.
The communication with the database is found in Model classes.
For example we can find
sql-commands to manipulate a foodsaver in
Those are executed with the functions inherited from the
Db class (see
use Foodsharing\Lib\Db\Db;, for example
q stands for
Newer module structure
For a general description what „domain logic“ is, see section Transactions.
Note that all of the following guidelines have a lot of exceptions in the existing code. Nevertheless try to heed the following guidelines in code you write and refactor.