This is a foodsharing API backend. It is meant to operate on the same database as the legacy foodsharing.de software, so to keep it simple, it must not modify the schema.
This software is build on symfony 3 with some bundles to simplify providing a json API.
- PHP (>=5.6, >=7.1 for development)
- PDO MySQL module
- PHP modules to satisfy symfony
To install, just clone the repository and run
This application is not able to run without having a properly initialized database. While the structure for a test setup can be build with
bin/console doctrine:schema:update, the necessary data is not (yet) included and cannot be generated by the application itself (e.g. user registration). It should still be easy for you to manually create some users etc.
A pull request with some test data is highly appreciated.
So far, running in parallel to the legacy foodsharing.de software is suggested. That is available including a development setup after requesting access to https://gitlab.com/foodsharing-dev. Configure the database access accordingly:
There is codeception for testing in place. It uses a test database that has credentials in
app/config/parameters.yml. You can define them as you wish for your local setup, an example configuration would be:
Once you have defined the credentials you can create the test database and import the schema with:
./bin/console --env=test doctrine:database:create ./bin/console --env=test doctrine:schema:update --force
Then run the tests with:
Fire up a symfony dev server by running
Currently, just check it out on the production server and configure it like stated above. Follow symfony setup instructions for webserver configuration and make sure to setup necessary proxy paths as well (depending on frontend):
- Access to websocket
- Access to static data
- Access to desktop version API
scripts/update.sh to pull changes from git and reinitiate the cache.