Provision WooCommerce multisite shops with correct rewrites and checkout working, using FastAPI and Docker.
Supports Localized Interface and translation workflow.
- FastAPI REST API for shop provisioning
- Docker-based WordPress and MySQL setup
- Automatic WooCommerce installation and demo product import
- Multisite network with custom rewrite rules for subsites
- Export WooCommerce translation strings to CSV
- Upload translated CSV or JSON to generate PO/MO and deploy to WooCommerce language directory
- Python 3.11 (recommended: use conda)
- Docker
- requirements.txt dependencies
conda create -n env-wordpress-shop python=3.11 -y
conda activate env-wordpress-shop
pip install -r requirements.txtStart the API server with:
uvicorn app:app --reload --host 0.0.0.0 --port 5000Send a POST request to /create_shop with JSON body:
{
"site_name": "My Shop",
"email": "admin@example.com",
"tenant_mode": "multi",
"theme": "woostify",
"locale": "en_US",
"wp_image": "wordpress:6.7-php8.2-apache",
"mysql_image": "mysql:5.7"
}Example using curl:
curl -X POST http://localhost:5000/create_shop \
-H "Content-Type: application/json" \
-d '{"site_name":"My Shop"}'Download translation strings as CSV:
curl -O http://localhost:5000/download_csv/{store_name}Upload a translated CSV to generate PO/MO and deploy:
curl -X POST http://localhost:5000/upload_csv/{store_name}/{lang_code} \
-F "file=@woocommerce.csv"Upload a translated JSON to generate PO/MO and deploy:
curl -X POST http://localhost:5000/upload_json/{store_name}/{lang_code} \
-F "file=@woocommerce.json"- The WordPress container exposes port 8080.
- Latest stable image version:
wordpress:6.7-php8.2-apache - Logs are written to files named like
log_YYYYMMDD_HHMMSS.log. - Translation workflow uses polib for PO/MO file handling.
MIT


