Setup Guide
Two ways to run Wave Networks: Docker for development, or shared hosting for production.
Requirements
| Requirement | Version | Notes |
|---|---|---|
| PHP | 8.2+ | With PDO MySQL, GD, mbstring |
| MySQL | 5.7+ or MariaDB 10.3+ | InnoDB engine required |
| Composer | 2.x | For dependency management |
| Imagick | (optional) | For SVG-to-PNG conversion (PWA icons) |
| Node.js | (optional) | Only for SCSS theme compilation |
Docker Setup (Development)
-
Clone both repos as siblings
git clone git@github.com:WaveNetworks/wave-networks-core.git admin git clone git@github.com:WaveNetworks/child-app.git child-appKeep
child-app/intact as a reference template — you'll copy it in the next step. -
Copy the template into your own app folder
cp -r child-app my-app cd my-app rm -rf .git git init git remote add origin git@github.com:YourOrg/my-app.gitThis gives you a clean copy to build on. The original
child-app/stays untouched as a working reference you can diff against, pull updates from, or consult when you need to see how a pattern was implemented. -
Configure your app
cp .env.example .env # Edit .env with your values (see config reference below)Rename all
child_app_prefixes indocker-compose.ymlto your app name (e.g.,myapp_admin_main,myapp_main,myapp_shard_1). -
Start Docker
docker compose up -dThis starts 8 services: PHP-Apache app, 3 admin databases (main + 2 shards), 3 child databases, and Mailhog for email testing.
-
Build the theme
cd my-app npm install && npm run build:cssThe template ships SCSS source only — no compiled CSS. This step compiles the glassmorphism theme to
assets/css/custom.css. Without it, you'll see plain Bootstrap. -
Run the installers
Visit
http://localhost/admin/install/index.phpto set up admin core and create the first admin user.Visit
http://localhost/my-app/install/index.phpto set up your child app.Use the explicit
/index.phppath — the directory URL may return 403 depending on your Apache config.Migrations run automatically on first page load after config is created.
-
Start building
Source code is mounted read-only — edit PHP files locally, refresh the browser. Docker cannot modify your working directory. Mailhog runs at
http://localhost:8025.
child-app/ for your own project.
Running Multiple Apps (Docker)
Each child app gets its own complete, isolated Docker stack — including its own admin databases, its own admin install, and its own branding. Every database and volume is namespaced by the child app name so multiple stacks never collide.
1. Namespace databases and volumes
All databases and volumes are prefixed with your app's directory name (hyphens → underscores). When you clone child-app as payments, rename every child_app_ prefix to payments_ in docker-compose.yml:
| Template default | Your app (payments) |
|---|---|
child_app_admin_main | payments_admin_main |
child_app_admin_shard_1 | payments_admin_shard_1 |
child_app_admin_shard_2 | payments_admin_shard_2 |
child_app_main | payments_main |
child_app_shard_1 | payments_shard_1 |
child_app_shard_2 | payments_shard_2 |
Do NOT use external: true — each stack must own its volumes.
2. Unique ports
Change the host port mapping in docker-compose.yml:
| Stack | Web | Mailhog |
|---|---|---|
| App 1 | 80:80 | 8025:8025 |
| App 2 | 8081:80 | 8026:8025 |
| App 3 | 8082:80 | 8027:8025 |
3. Filesystem isolation
Source code is mounted read-only (:ro). Docker cannot modify your working directory. Writable paths use named volumes (vendor dependencies, uploaded files, databases).
4. Fresh admin per stack
Each stack runs its own admin install with independent users, settings, and branding. The admin installer creates the first admin user during setup.
Shared Hosting Setup (Production)
-
Generate vendor dependencies locally
cd admin composer install --no-dev -
Copy the template and upload to your webroot
Copy
child-app/to your own folder, then uploadadmin/and your app topublic_html/:cp -r child-app my-app cd my-app && rm -rf .git && git init # Upload via SFTP, or use the included deploy script: cp deploy_config.sample.py deploy_config.py # Edit with your SFTP credentials python deploy.py --allKeep
child-app/locally as a reference — you don't need to deploy it to production. -
Create databases
Create 6 databases via cPanel or phpMyAdmin:
# Admin core wncore_main wncore_shard_1 wncore_shard_2 # Your child app yourapp_main yourapp_shard_1 yourapp_shard_2 -
Create the files directory
mkdir -p /home/username/files/home chmod 755 /home/username/filesThis must be outside
public_html/— not web-accessible. -
Run the installers
Visit
https://yourdomain.com/admin/install/index.php— enter your database credentials and create the first admin user.Visit
https://yourdomain.com/your-app/install/index.php— enter your child app DB credentials.The installers write
config/config.phpand lock themselves down after completion. -
Set up cron
* * * * * /usr/bin/php /home/username/public_html/admin/cron/cron.php > /dev/null 2>&1This processes the email queue and runs scheduled tasks every minute.
Configuration Reference
Core Settings
| Config File | Environment Var | Purpose |
|---|---|---|
$dbHostSpec | DB_HOST_MAIN | Main database host |
$dbInstance | DB_NAME_MAIN | Main database name |
$dbUserName | DB_USER | Database username |
$dbPassword | DB_PASSWORD | Database password |
$shardConfigs | DB_HOST_SHARD, DB_HOST_SHARD2 | Shard database connections |
$app_secret | APP_SECRET | JWT signing key (64 chars) |
$hiddenhash | HIDDEN_HASH | Password salt |
$files_location | FILES_LOCATION | Absolute path to file storage (trailing slash) |
SMTP Settings
| Config File | Environment Var | Purpose |
|---|---|---|
$smtp_host | SMTP_HOST | SMTP server hostname |
$smtp_port | SMTP_PORT | SMTP port (587 STARTTLS, 465 SSL) |
$smtp_user | SMTP_USER | SMTP username |
$smtp_pass | SMTP_PASS | SMTP password |
$mail_from | MAIL_FROM | Default sender email |
$mail_from_name | MAIL_FROM_NAME | Default sender name |
Optional Services
| Variable | Purpose |
|---|---|
$google_client_id / $google_client_secret | Google OAuth login |
$github_client_id / $github_client_secret | GitHub OAuth login |
$facebook_app_id / $facebook_app_secret | Facebook OAuth login |
$grecaptcha_key / $grecaptcha_secret | Google reCAPTCHA |
$vapid_subject / $vapid_public_key / $vapid_private_key | Web Push notifications |
$stripe_secret_key / $stripe_public_key | Stripe payments |
Deploy Script
Both repos include a Python SFTP deployment script (deploy.py) that uploads only changed files:
# Deploy files changed in last commit
python deploy.py
# Deploy all tracked files + vendor
python deploy.py --all
# Preview what would be uploaded
python deploy.py --dry-run
Create deploy_config.py from the sample:
SFTP_HOST = "your-server.example.com"
SFTP_PORT = 22
SFTP_USER = "username"
SFTP_PASS = "password"
LOCAL_ROOT = r"/path/to/local/admin"
REMOTE_ROOT = "admin" # relative to SFTP root
The script compares file sizes before uploading and skips unchanged files automatically.
Additional Flags
# Include specific files or directories (even untracked)
python deploy.py --include vendor/ assets/css/custom.css
# Deploy only vendor/ directory (after composer install)
python deploy.py --vendor
# Child-app only: skip CSS build check
python deploy.py --no-css-check
The child-app deploy script warns if assets/css/custom.css hasn't been built. Run npm install && npm run build:css before deploying.
Production Deploy Checklist
Follow this order when deploying to a new server. Admin must be deployed and installed before the child app, and the child app's CSS must be built before the website will display correctly.
-
Pre-flight
- Verify server has PHP 8.2+ with pdo_mysql, gd, mbstring extensions
- Create databases: admin main + N shards, child app main + N shards
- Create
../files/directory above public_html (or let the installer auto-create it)
-
Deploy admin (first)
cd admin composer install --no-dev cp deploy_config.sample.py deploy_config.py # Edit deploy_config.py with SFTP credentials python deploy.py --all python deploy.py --vendor -
Install admin
Visit
https://yourdomain.com/admin/install/index.php- Step 1: Configure databases (1–20 shards), file storage path (auto-detected), SMTP
- Step 2: Create first admin user (email + password)
-
Deploy child app (second)
cd my-app npm install && npm run build:css cp deploy_config.sample.py deploy_config.py # Edit deploy_config.py with SFTP credentials python deploy.py --all -
Install child app
Visit
https://yourdomain.com/my-app/install/index.php— enter child app DB credentials. -
Deploy website (third)
Upload
site/,index.php,.htaccess,sitemap.xml, and root files via SFTP. -
Post-deploy
- Set up cron:
* * * * * /usr/bin/php public_html/admin/cron/cron.php - Configure branding in admin settings (logo, favicon, site name, theme color)
- Verify all three components load correctly in browser
- Set up cron: