Day-1 Quickstart: plugn Backend
-
Clone the repository:
git clone <PLUGN_REPO_URL> cd plugn -
Start Docker Compose (recommended, sets up backend, MySQL, Redis):
docker-compose up -
In a new terminal, enter the backend container:
docker-compose exec backend bash -
Install PHP dependencies:
php composer.phar install -
Create your local environment config:
- Copy the appropriate environment files from
environments/as described in the env documentation, or run the init script interactively:
./init- Or non-interactively (example for Development):
./init --env=Development --overwrite=n- The script will copy config files and set up keys. Requires the OpenSSL PHP extension.
- Copy the appropriate environment files from
-
Run database migrations:
./yii migrate -
(Alternative) To run backend with PHP built-in server (not recommended for full stack):
php -S localhost:8083 -t web -
Wait for MySQL to be ready before running migrations or starting the backend for the first time.
-
Run a frontend app (e.g., plugn-ionic or plugn-dashboard-ionic) in a separate terminal. Set its
API_BASE_URLto:http://localhost:8083- Refer to the frontend's README for exact setup and where to configure
API_BASE_URL.
- Refer to the frontend's README for exact setup and where to configure
-
Access backend at http://localhost:8083.
For MySQL access:
docker-compose exec mysql bash
mysql -uroot -p12345
PhpMyAdmin: http://localhost:8080 (user: root, pass: 12345)
For more details, see the plugn README.