Readme changes

This commit is contained in:
Almira Krdzic
2018-07-30 09:12:07 +02:00
parent ff649553cc
commit ec170577c6

View File

@@ -12,27 +12,27 @@ Wiaas implementation based on wordpress [woocommerce](https://woocommerce.com/)
## Local Docker setup ## Local Docker setup
1) Copy environment.env file and rename it to .env 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 2) Edit .env file and add needed information
* `MYSQL_ROOT_PASSWORD` - MySQL database root password for MySQL docker image * `MYSQL_ROOT_PASSWORD` - MySQL database root password for MySQL docker image
* `MYSQL_DATABASE` - Wordpress database name * `MYSQL_DATABASE` - Wordpress database name
* `MYSQL_USER` - Wordpress database user * `MYSQL_USER` - Wordpress database user
* `MYSQL_PASSWORD` - Wordpress database password * `MYSQL_PASSWORD` - Wordpress database password
* `MYSQL_HOST` - Wordpress database host (will be `db` for docker) * `MYSQL_HOST` - Wordpress database host (will be `db` for docker)
* `WP_ENV` - Set to environment (`local`, `development`, `production`) * `WP_ENV` - Set to environment (`local`, `development`, `production`)
* `API_URL` - Full URL to WordPress home (http://localhost:8081 if you are testing locally) * `API_URL` - Full URL to WordPress home (http://localhost:8081 if you are testing locally)
* `WP_AUTH_KEY`, `WP_SECURE_AUTH_KEY`, `WP_LOGGED_IN_KEY`, `WP_NONCE_KEY`, `WP_AUTH_SALT`, `WP_SECURE_AUTH_SALT`, `WP_LOGGED_IN_SALT`, `WP_NONCE_SALT`, `WP_JWT_AUTH_SECRET_KEY` * `WP_AUTH_KEY`, `WP_SECURE_AUTH_KEY`, `WP_LOGGED_IN_KEY`, `WP_NONCE_KEY`, `WP_AUTH_SALT`, `WP_SECURE_AUTH_SALT`, `WP_LOGGED_IN_SALT`, `WP_NONCE_SALT`, `WP_JWT_AUTH_SECRET_KEY`
3) Execute in the root of the project : 3) Execute in the root of the project :
sudo docker-compose build sudo docker-compose build
sudo docker-compose up sudo docker-compose up
Frontend is running on http://localhost:8080 and backend on http://localhost:8081 Frontend is running on http://localhost:8080 and backend on http://localhost:8081
@@ -41,51 +41,51 @@ Wiaas implementation based on wordpress [woocommerce](https://woocommerce.com/)
### DB setup ### DB setup
1) Create MYSQL database / user 1) Create MYSQL database / user
CREATE DATABASE ${MYSQL_DATABASE}; CREATE DATABASE ${MYSQL_DATABASE};
CREATE USER '${MYSQL_USER}'@'localhost' IDENTIFIED BY '${MYSQL_PASSWORD}'; CREATE USER '${MYSQL_USER}'@'localhost' IDENTIFIED BY '${MYSQL_PASSWORD}';
GRANT ALL PRIVILEGES ON ${MYSQL_DATABASE}.* TO '${MYSQL_USER}'@localhost; GRANT ALL PRIVILEGES ON ${MYSQL_DATABASE}.* TO '${MYSQL_USER}'@localhost;
2) Seed database with `new-wiaas/database/clean-dump.sql` 2) Seed database with `new-wiaas/database/clean-dump.sql`
### Backend setup ### Backend setup
1) Environment variables 1) Environment variables
For handling environment variables during local development we use `dotenv` library which will load all variables from `local.env` file 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. 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. Update `local.env` with your local environment variables.
2) Apache 2) Apache
Point your apache server to `new-wiaas/backend` by updating apache default host files to point to it. Point your apache server to `new-wiaas/backend` by updating apache default host files to point to it.
(do not copy folder content to `/var/www/html`, since then dotenv will not be able to load `local.env` file since it is placed one folder above.) (do not copy folder content to `/var/www/html`, since then dotenv will not be able to load `local.env` file since it is placed one folder above.)
3) Wordpress 3) Wordpress
Run setup commands to install wordpress and required plugins with composer: Run setup commands to install wordpress and required plugins with composer:
cd backend cd backend
composer install composer install
composer update-db composer update-db
### Frondend setup ### Frondend setup
1) Install dependencies 1) Install dependencies
cd frontend cd frontend
npm install npm install
2) Start local server 2) Start local server
cd frontend cd frontend
npm start npm start
## Contribution ## Contribution
@@ -94,7 +94,7 @@ Wiaas implementation based on wordpress [woocommerce](https://woocommerce.com/)
- Project structure - Project structure
Project structure is inspired with [Roots Bedrock structure](https://roots.io/bedrock/). Project structure is inspired with [Roots Bedrock structure](https://roots.io/bedrock/).
├── composer.json # → Manage versions of WordPress, plugins & dependencies ├── composer.json # → Manage versions of WordPress, plugins & dependencies