vsv-verkeerskunde / gvq-api
API for GVQ
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 3
Type:project
Requires
- php: ^7.2.4
- ext-iconv: *
- ext-json: *
- ext-redis: *
- broadway/broadway: ^2.0
- doctrine/orm: ^2.6
- league/flysystem: ^1.0
- league/flysystem-aws-s3-v3: ^1.0
- league/uri: ^5.3
- ramsey/uuid: ^3.7
- ramsey/uuid-doctrine: ^1.4
- symfony/asset: ^4.0
- symfony/cache: ^4.0
- symfony/console: ^4.0
- symfony/expression-language: ^4.0
- symfony/flex: ^1.0
- symfony/form: ^4.0
- symfony/framework-bundle: ^4.0
- symfony/lts: ^4@dev
- symfony/monolog-bundle: ^3.3
- symfony/orm-pack: ^1.0
- symfony/security-bundle: ^4.0
- symfony/serializer: ^4.0
- symfony/swiftmailer-bundle: ^3.2
- symfony/translation: ^4.0
- symfony/twig-bundle: ^4.0
- symfony/validator: ^4.0
- symfony/yaml: ^4.0
Requires (Dev)
- php-coveralls/php-coveralls: ^2.0
- phpstan/phpstan: ^0.9.2
- phpunit/phpunit: ^7.1
- squizlabs/php_codesniffer: ^3.2
- symfony/debug: ^4.0
- symfony/dotenv: ^4.0
- symfony/profiler-pack: ^1.0
- symfony/web-server-bundle: ^4.0
Conflicts
This package is not auto-updated.
Last update: 2024-11-22 10:43:13 UTC
README
Seeding
Initial setup
Create a new database with settings taken from .env
file:
$ ./bin/console doctrine:database:create
Create the tables inside this database with:
$ ./bin/console doctrine:schema:create
Seeding categories
Adding all fixed categories can be done with the following custom command:
$ ./bin/console gvq:seed-categories
With the optional file argument it is possible to specify an arbitrary file with categories.
Seeding users
Rename the included fixed_users.yaml.dist
file to fixed_users.yaml
or create your own data file. Adding all fixed users can be done with the following custom command:
$ ./bin/console gvq:seed-users
With the optional file argument it is possible to specify an arbitrary file with users.
Docker
Basics
Edit the your host file and add the following:
127.0.0.1 gvq-api.test
127.0.0.1 mailhog.gvq-api.test
127.0.0.1 mysql.gvq-api.test
127.0.0.1 redis.gvq-api.test
Install sources by running:
$ composer install
Start docker by running:
$ docker-compose up -d
Connect to api on: http://gvq-api.test:8000/
Connect to mailhog on: http://mailhog.gvq-api.test:8025/
Connect to MySQL on: mysql.gvq-api.test:33066
Database
Create the schema with (make sure to have correct DATABASE_URL
string inside .env
):
$ docker-compose exec web bash -c "./bin/console doctrine:schema:create"
Example of DATABASE_URL
with values inside .env
:
DATABASE_URL=mysql://$DB_USER:$DB_PASSWORD@$DB_HOST:3306/$DB_NAME
Seeding categories (by default taken from categories.yaml)
$ docker-compose exec web bash -c "./bin/console gvq:seed-categories"
Seeding users (make sure to provide an input file)
$ docker-compose exec web bash -c "./bin/console gvq:seed-users"
Image upload
If you want to use s3 as upload location, then change inside env
:
UPLOAD_TARGET=remote
UPLOAD_PATH=*url_to_s3_bucket*
Example:
UPLOAD_TARGET=remote
UPLOAD_PATH=https://s3-eu-west-1.amazonaws.com/verkeersquiz-test/
and fill in the necessary credential and bucket details.
To use the local filesystem, leave the default values unchanged:
UPLOAD_TARGET=local
UPLOAD_PATH=/uploads/
Altering styling / CSS
See the documentation in assets/README.md.