From df1b42bb1e00b7d2ae76ecc78ef9282cffeb02d0 Mon Sep 17 00:00:00 2001 From: Almira Krdzic Date: Mon, 30 Jul 2018 09:00:38 +0200 Subject: [PATCH] Readme changes --- README.md | 103 +++++++++++++++++++++++++----------------------------- 1 file changed, 47 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index f71508d..2ca165a 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,10 @@ Wiaas implementation based on wordpress [woocommerce](https://woocommerce.com/) 1) Copy environment.env file and rename it to .env - ``` - cp environment.env .env - ``` + cp environment.env .env 2) Edit .env file and add needed information + * `MYSQL_ROOT_PASSWORD` - MySQL database root password for MySQL docker image * `MYSQL_DATABASE` - Wordpress database name * `MYSQL_USER` - Wordpress database user @@ -30,10 +29,8 @@ Wiaas implementation based on wordpress [woocommerce](https://woocommerce.com/) 3) Execute in the root of the project : - ```sh - sudo docker-compose build - sudo docker-compose up - ``` + sudo docker-compose build + sudo docker-compose up Frontend is running on http://localhost:8080 and backend on http://localhost:8081 @@ -46,11 +43,9 @@ Wiaas implementation based on wordpress [woocommerce](https://woocommerce.com/) 1) Create MYSQL database / user - ```sql - CREATE DATABASE ${MYSQL_DATABASE}; - CREATE USER '${MYSQL_USER}'@'localhost' IDENTIFIED BY '${MYSQL_PASSWORD}'; - GRANT ALL PRIVILEGES ON ${MYSQL_DATABASE}.* TO '${MYSQL_USER}'@localhost; - ``` + CREATE DATABASE ${MYSQL_DATABASE}; + CREATE USER '${MYSQL_USER}'@'localhost' IDENTIFIED BY '${MYSQL_PASSWORD}'; + GRANT ALL PRIVILEGES ON ${MYSQL_DATABASE}.* TO '${MYSQL_USER}'@localhost; 2) Seed database with `new-wiaas/database/clean-dump.sql` @@ -61,9 +56,8 @@ Wiaas implementation based on wordpress [woocommerce](https://woocommerce.com/) For handling environment variables during local development we use `dotenv` library which will load all variables from `local.env` file if such file is present. These variables will then be accessible inside wordpress. - ``` - cp environment.env local.env - ``` + cp environment.env local.env + Update `local.env` with your local environment variables. 2) Apache @@ -75,11 +69,9 @@ Wiaas implementation based on wordpress [woocommerce](https://woocommerce.com/) Run setup commands to install wordpress and required plugins with composer: - ```sh - cd backend - composer install - composer update-db - ``` + cd backend + composer install + composer update-db @@ -87,15 +79,14 @@ Wiaas implementation based on wordpress [woocommerce](https://woocommerce.com/) 1) Install dependencies - ```sh - cd frontend - npm install - ``` + cd frontend + npm install + 2) Start local server - ```sh - cd frontend - npm start - ``` + + cd frontend + npm start + ## Contribution @@ -105,34 +96,34 @@ Wiaas implementation based on wordpress [woocommerce](https://woocommerce.com/) Project structure is inspired with [Roots Bedrock structure](https://roots.io/bedrock/). - ``` - ├── composer.json # → Manage versions of WordPress, plugins & dependencies - ├── config # → WordPress configuration files - │ ├── application.php # → Primary WP config file (wp-config.php equivalent) - │ └── environments # → Environment specific configs - │ ├── development.php # → Development config - │ ├── local.php # → Local config - │ └── production.php # → Production config - ├── vendor # → Composer packages (never edit) - ├── app # → wp-content equivalent - │ ├── mu-plugins # → Must use plugins - │ ├── plugins # → Plugins - ├── wiaas # → Our code goes here - │ ├── themes # → Themes - │ └── uploads # → Uploads - ├── wp-config.php # → Required by WP (never edit) - ├── index.php # → WordPress view bootstrapper - └── wp # → WordPress core (never edit) - ``` - - This approach enables: - - Better folder structure (wordpress core is in separate folder and is treated as dependency) - - Dependency management with Composer (wordpress core and plugins) - - Easy WordPress configuration with environment specific files - - Environment variables with [Dotenv](https://github.com/vlucas/phpdotenv) - - Enhanced security (all sensitive information is accessed with environment variables) - - Secure passwords with [wp-password-bcrypt](https://github.com/roots/wp-password-bcrypt) - - Composer as task runner for automatic wordpress db updates + + ├── composer.json # → Manage versions of WordPress, plugins & dependencies + ├── config # → WordPress configuration files + │ ├── application.php # → Primary WP config file (wp-config.php equivalent) + │ └── environments # → Environment specific configs + │ ├── development.php # → Development config + │ ├── local.php # → Local config + │ └── production.php # → Production config + ├── vendor # → Composer packages (never edit) + ├── app # → wp-content equivalent + │ ├── mu-plugins # → Must use plugins + │ ├── plugins # → Plugins + ├── wiaas # → Our code goes here + │ ├── themes # → Themes + │ └── uploads # → Uploads + ├── wp-config.php # → Required by WP (never edit) + ├── index.php # → WordPress view bootstrapper + └── wp # → WordPress core (never edit) + + + This approach enables: + - Better folder structure (wordpress core is in separate folder and is treated as dependency) + - Dependency management with Composer (wordpress core and plugins) + - Easy WordPress configuration with environment specific files + - Environment variables with [Dotenv](https://github.com/vlucas/phpdotenv) + - Enhanced security (all sensitive information is accessed with environment variables) + - Secure passwords with [wp-password-bcrypt](https://github.com/roots/wp-password-bcrypt) + - Composer as task runner for automatic wordpress db updates - Dependencies management