Readme changes
This commit is contained in:
103
README.md
103
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
|
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
|
||||||
@@ -30,10 +29,8 @@ Wiaas implementation based on wordpress [woocommerce](https://woocommerce.com/)
|
|||||||
|
|
||||||
3) Execute in the root of the project :
|
3) Execute in the root of the project :
|
||||||
|
|
||||||
```sh
|
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
|
||||||
|
|
||||||
@@ -46,11 +43,9 @@ Wiaas implementation based on wordpress [woocommerce](https://woocommerce.com/)
|
|||||||
|
|
||||||
1) Create MYSQL database / user
|
1) Create MYSQL database / user
|
||||||
|
|
||||||
```sql
|
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`
|
||||||
|
|
||||||
@@ -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
|
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
|
||||||
@@ -75,11 +69,9 @@ Wiaas implementation based on wordpress [woocommerce](https://woocommerce.com/)
|
|||||||
|
|
||||||
Run setup commands to install wordpress and required plugins with composer:
|
Run setup commands to install wordpress and required plugins with composer:
|
||||||
|
|
||||||
```sh
|
cd backend
|
||||||
cd backend
|
composer install
|
||||||
composer install
|
composer update-db
|
||||||
composer update-db
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -87,15 +79,14 @@ Wiaas implementation based on wordpress [woocommerce](https://woocommerce.com/)
|
|||||||
|
|
||||||
1) Install dependencies
|
1) Install dependencies
|
||||||
|
|
||||||
```sh
|
cd frontend
|
||||||
cd frontend
|
npm install
|
||||||
npm install
|
|
||||||
```
|
|
||||||
2) Start local server
|
2) Start local server
|
||||||
```sh
|
|
||||||
cd frontend
|
cd frontend
|
||||||
npm start
|
npm start
|
||||||
```
|
|
||||||
|
|
||||||
## Contribution
|
## 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/).
|
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
|
||||||
├── config # → WordPress configuration files
|
├── config # → WordPress configuration files
|
||||||
│ ├── application.php # → Primary WP config file (wp-config.php equivalent)
|
│ ├── application.php # → Primary WP config file (wp-config.php equivalent)
|
||||||
│ └── environments # → Environment specific configs
|
│ └── environments # → Environment specific configs
|
||||||
│ ├── development.php # → Development config
|
│ ├── development.php # → Development config
|
||||||
│ ├── local.php # → Local config
|
│ ├── local.php # → Local config
|
||||||
│ └── production.php # → Production config
|
│ └── production.php # → Production config
|
||||||
├── vendor # → Composer packages (never edit)
|
├── vendor # → Composer packages (never edit)
|
||||||
├── app # → wp-content equivalent
|
├── app # → wp-content equivalent
|
||||||
│ ├── mu-plugins # → Must use plugins
|
│ ├── mu-plugins # → Must use plugins
|
||||||
│ ├── plugins # → Plugins
|
│ ├── plugins # → Plugins
|
||||||
├── wiaas # → Our code goes here
|
├── wiaas # → Our code goes here
|
||||||
│ ├── themes # → Themes
|
│ ├── themes # → Themes
|
||||||
│ └── uploads # → Uploads
|
│ └── uploads # → Uploads
|
||||||
├── wp-config.php # → Required by WP (never edit)
|
├── wp-config.php # → Required by WP (never edit)
|
||||||
├── index.php # → WordPress view bootstrapper
|
├── index.php # → WordPress view bootstrapper
|
||||||
└── wp # → WordPress core (never edit)
|
└── wp # → WordPress core (never edit)
|
||||||
```
|
|
||||||
|
|
||||||
This approach enables:
|
This approach enables:
|
||||||
- Better folder structure (wordpress core is in separate folder and is treated as dependency)
|
- Better folder structure (wordpress core is in separate folder and is treated as dependency)
|
||||||
- Dependency management with Composer (wordpress core and plugins)
|
- Dependency management with Composer (wordpress core and plugins)
|
||||||
- Easy WordPress configuration with environment specific files
|
- Easy WordPress configuration with environment specific files
|
||||||
- Environment variables with [Dotenv](https://github.com/vlucas/phpdotenv)
|
- Environment variables with [Dotenv](https://github.com/vlucas/phpdotenv)
|
||||||
- Enhanced security (all sensitive information is accessed with environment variables)
|
- Enhanced security (all sensitive information is accessed with environment variables)
|
||||||
- Secure passwords with [wp-password-bcrypt](https://github.com/roots/wp-password-bcrypt)
|
- Secure passwords with [wp-password-bcrypt](https://github.com/roots/wp-password-bcrypt)
|
||||||
- Composer as task runner for automatic wordpress db updates
|
- Composer as task runner for automatic wordpress db updates
|
||||||
|
|
||||||
- Dependencies management
|
- Dependencies management
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user