- Linux Ubuntu Server
- Apache2
- MySQL
- PHP 7+
- Twig Template
- Eloquent ORM
- Phinx Migration
- NPM
- ReactJS
- Redux
- Semantic UI React
Install VirtualBox
If during installation a failed installation appears such as this one:
Navigate to the System Preferences > Security & Privacy
then click the Allow Button as shown in the image below.
~ » php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
~ » php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
~ » php composer-setup.php
~ » php -r "unlink('composer-setup.php');"
...
...
...
~ » mv ./composer.phar /usr/local/bin
~ » echo "export PATH="$PATH:/usr/local/bin"" >> ~/.bash_profile
~ » echo "alias composer=composer.phar" >> ~/.bash_profile
Install NPM and NodeJS
Install Vagrant
The following instructions contain variable placeholders that you could configure to your liking.
Through out the instructions replace any PROJECT_*
variable to your liking.
To make things easier, I marked headers in the instructions with a @var for sections that contain placeholders.
Ex. PROJECT_NAME
=> todo_app
~ » git clone git://github.com/abubakir1997/slim-boilerplate.git PROJECT_NAME
~ » cd ~/PROJECT_NAME
~/PROJECT_NAME/config/dev.php
~/PROJECT_NAME/config/prod.php
~/PROJECT_NAME/phinx.yml
~/PROJECT_NAME/Vagrant.sh
~/PROJECT_NAME/Vagrantfile
~/PROJECT_NAME » composer install
~/PROJECT_NAME » composer dump-autoload --optimize
~/PROJECT_NAME » cd npm/
~/PROJECT_NAME » npm install
~/PROJECT_NAME » npm run build
~/PROJECT_NAME » vagrant up --provision
The following error may appear due to improper VirtualBox Installation:
In such case remove Virtual Box and reinstall it following the above instructions.
When in vim mode navigate to the bottom of the page (i.e. to the last letter) via the arrow keys.
Then click the letter i after it click the key enter | return and insert the line after vim>.
~/PROJECT_NAME » sudo vim /etc/hosts
vim> 192.168.33.10 PROJECT_DOMAIN.test
~/PROJECT_NAME » sudo echo 'alias phinx=vendor/bin/phinx' >> ~/.bash_profile
~/PROJECT_NAME » phinx migrate
Username: admin
Password: admin
The following hash will generate the admin password => md5(admin+salt)
To insert the admin/admin login crediential based on the provided salt in the default configuration do the following (When Prompted for password enter root if you stick to the default configuration):
~/PROJECT_NAME » vagrant ssh
~/vagrant » mysql -u DB_USER -p DB_NAME -e "INSERT INTO users (username, password) VALUES ('admin', 'ec5c5011157cfe93b4994ad2b4dde12b');"