Repository navigation
Development Setup
There are various setups which you can use for local development of gewisweb. Which method you choose will depend on your personal preference and current setup. For instance if you already have a local webserver you may prefer to use a local setup rather than vagrant or docker. It is recommended to read this page carefully and the choose the method which suits you best.
It's probably most easy to use a Linux virtual machine in combination with the Docker method below.
- Install docker and docker-compose
- Run
docker-compose up -d(possibly with sudo) - Run
./dockerexec composer install - Copy
./config/autoload/doctrine.local.development.php.distto./config/autoload/doctrine.local.php - Copy
./config/autoload/local.php.distto./config/autoload/local.php - Make sure the ./config/autoload/doctrine.local.php contains the following values:
'host' => 'webmysql',
'port' => '3306',
'user' => 'gewis',
'password' => 'gewis',
'dbname' => 'gewis',
- Run
./dockerexec ./web orm:schema-tool:create
If you need testdata run the following commands
./dockerexec ./web testdata user
./dockerexec ./web testdata activity
./dockerexec ./web testdata decision
./dockerexec ./web testdata education
./dockerexec ./web testdata page
./dockerexec ./web testdata photo
./dockerexec ./web testdata poll- Install VirtualBox and Vagrant
- Run
vagrant up - You now have a fully functional website at http://192.168.41.42/ or http://webdev.gew.is/
Testdata is included automatically and a PhpMyAdmin install can be found at
/pma
- Install dependencies using composer:
php composer.phar install - Create a new MySQL database.
- Copy
config/autoload/doctrine.local.php.disttoconfig/autoload/doctrine.local.phpand configure the database settings in it. - Copy
./config/autoload/local.php.distto./config/autoload/local.php - Give the webserver's user read and write permissions to the
data/andpublic/data/directories. - Run
./web orm:schema-tool:createto populate the database. - Copy
config/autoload/local.php.disttoconfig/autoload/local.php - Set the environment variable
APP_ENVtodevelopmentin your webserver configuration
If you need to edit stylesheets, you need to be able to compile scss files locally. For that, follow the next steps:
- Install nodejs and npm (npm should be bundled with node).
- Install Ruby and the Sass gem
gem install sass - Install grunt-cli globally,
npm install -g grunt-cli - Install local dependencies (in the directory of the GEWIS Website),
npm install
To compile scss files, simply run grunt css. While working on the
stylesheets, it may be nice to let grunt watch the stylesheet and
automatically recomple. For this, you can run grunt watch.