This repository contains Wordpress app, initially created using Bedrock stack. It depends on multiple other repositories like plugins and theme that are added as submodules (no need to download them separately).
Before running the commands make sure to install all the requirements mentioned above.
To install and setup everything, run the following commands:
- Clone repository:
git clone https://github.com/rkgeronimo/wp-web.git - Inside
wp-webdirectory runyarn- Installs NPM requirements from thepackage.jsonfile composer install- Installs PHP requirements from thecomposer.jsonfile./node_modules/.bin/gulp- Builds static files (js, css)cp .env.example .env- Create environment file and define variables (below explained)- Make sure all Wordpress permissions are allright, there could be an issue with
uploadsdirectory. If so, runchmod -R 755 web/app/uploadsand make sure it's owned by the right group e.g.chown -R www-data:www-data web/app/uploads - Import app database geronimo_basic.sql to your newly created MySQL database:
mysql -u your_db_user -p your_db_name < geronimo_basic.sql - Install plugin
wp-mail-smtp, manually or using WP CLIwp plugin install wp-mail-smtp --activate - Setup Apache virtual host
http://local.rkgeronimothe document root on the webserver to thewebfolder:/path/to/site/web/ - Map the hostname by editing your local
/etc/hostsfile and adding entry for the domain (http://local.rkgeronimo) next to localhost. - (optional) Make sure
php-zipextension is enabled if you want to use feature to download all photos from applicants in a course. Extension can be installed usingsudo apt-get install php7.4-zip. This is not necessary for anything else and app will work without it, just not the part with ZipArchive.
Note: If you are using other virual host and other domain, then domain replacements in the database should be made. This can be easily done through WP-CLI: wp search-replace 'http://local.rkgeronimo' 'new'. WP-CLI plugin can be used for similar data updates e.g. user password changing.
Super Administrator: Username: demo Password: demo123
Instructor: Username: instruktor Password: instruktor123
Environment variables in the .env file. Wrap values that may contain non-alphanumeric characters with quotes, or they may be incorrectly parsed.
- Database variables
DB_NAME- Database nameDB_USER- Database userDB_PASSWORD- Database passwordDB_HOST- Database host- Optionally, you can define
DATABASE_URLfor using a DSN instead of using the variables above (e.g.mysql://user:[email protected]:3306/db_name)
WP_ENV- Set to environment (development,staging,production)WP_HOME- Full URL to WordPress home (https://example.com)WP_SITEURL- Full URL to WordPress including subdirectory (https://example.com/wp)AUTH_KEY,SECURE_AUTH_KEY,LOGGED_IN_KEY,NONCE_KEY,AUTH_SALT,SECURE_AUTH_SALT,LOGGED_IN_SALT,NONCE_SALT- Generate with wp-cli-dotenv-command
- Generate with the WordPress salts generator
This project uses a custom database migration system for tracking and managing schema changes. See database/README.md for complete documentation.
Quick reference:
# Check migration status
php database/migrate.php status
# Create a new migration
php database/migrate.php create add_new_feature
# Run pending migrations
php database/migrate.php migrate
# Rollback last batch
php database/migrate.php rollbackImportant for contributors:
- Always create migrations for database schema changes
- Never modify the database directly in development
- JavaScript / CSS changes (watcher and build)
- Plugin building
- Folder structure
- Git submodules management
TBD
© RK Geronimo, Zagreb