dependencies (you need this on your machine):
xampp
https://www.apachefriends.org/de/index.htmlcomposer
https://getcomposer.org/download/npm
https://nodejs.org/en/download/yarn
https://yarnpkg.com/lang/en/docs/install/
ubuntu installation:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php php-xml php-zip php-mbstring npm yard
backend with symfony4, with the additional bundles:
server
for a better symfony serverdoctrine
the database wrappermigrations
to migrate between different versions of the databaseorm-fixtures
to generate sample dataadmin
for the adminannotation
to configure routes in the controllerform
to easely manage html formslogger
who doesn't need logging?profiler
to measure performancemailer
to send mails via smtpapache-pack
for the .htaccess filephpunit-bridge
to run testsexpression-language
for fancy expressions & annotations
using the following libraries:
erusev/parsedown
to convert markup to htmlfriendsofphp/php-cs-fixer
to fix code styling issues
frontend building tools:
@symfony/webpack-encore
for the encore provided by symfonyjquery
to simplify DOM accessbootstrap-sass
bootstrap for basic css stylingfont-awesome
font with iconssass-loader node-sass
to enable the sass precompiler
after first pull, execute from project root:
yarn install
installs npm dependenciescomposer install
installs php dependenciesyarn encore dev
builds css / js filesphp bin/console doctrine:fixtures:load
loads sample data & user
if you're developing in the backend:
php bin/console server:run
#starts the symfony server
if you're developing the frontend (css/js), execute afterwards:
gulp watch
#serves as a proxy between the symfony server & the webpage displayed in the browser- go to the webpage display in the console from gulp, propably http://localhost:3000/
- edit files in web/assets/sass or web/assets/js, save them to see the change instantly in the browser
- test error templates inside TwigBundle/views by accessing
/_error/404
and/_error/500
if you want to login as an admin
- go to /login
- use the user
info@nodika.ch
with passasdf1234
if you've changed the Entities and need to adapt the database
php bin/console doctrine:migrations:diff
to generate the migration classphp bin/console doctrine:migrations:migrate
to migrate db to the newest version
if you want to deploy
- rename
servers_template.yml
toservers.yml
, correct entries - execute
php deployer.phar deploy ENVIRONMENT
, replacingENVIRONMENT
by etherdev
,testing
orproduction
(defaults todev
) - if you are on the dev branch fixtures are autoamtically applied
- if you deploy the fist time to production may want to login with ssh and prepare the database data with
php bin/console doctrine:fixtures:load --fixtures=src/DataFixtures/Production -q
if you're setting up deployment on a new server
cat ~/.ssh/id_rsa.pub
to ensure you already have created an ssh key for yourself, if none:ssh-keygen -t rsa -b 4096 -C "info@famoser.ch"
generate a new keyeval $(ssh-agent -s)
start the ssh agentssh-add ~/.ssh/id_rsa
add the new key
- add own ssh key to the server with
ssh-copy-id -i ~/.ssh/id_rsa.pub username@server.domain
- connect to server with
ssh username@server.domain
cat ~/.ssh/id_rsa.pub
to display the sever ssh key, if none see above on how to create one- go to https://github.com/famoser/nodika/deploy_keys and add the server ssh key
- point the web directory to
~/myurl.ch/ENV/current/web
- deploy!
- you may want to check with
php bin/symfony_requirements
if your server does support symfony