Multi-page PHP site version for Papasmedia.
Multi-page PHP website for Papasmedia with a front-end asset pipeline powered by Gulp. The site is served via Apache (PHP 8.1) and uses MySQL for data storage. Development uses BrowserSync proxying the internal container URL for live reload of SCSS and assets.
Key traits:
- Pages:
home,about,services,gallery, contact, plus anadminarea (src). - Asset pipeline: SCSS → CSS, image optimization, and copying app files to dist for production.
- Live reload dev workflow via BrowserSync (
gulp watch) proxying the internal Apache container URL.
Note: The single-page version of the site can be found here.
- Docker + Docker Compose (recommended)
- PHP 8.1 with Apache (containerized)
- MySQL 8.0 (containerized)
- Node.js 14.x for Gulp tasks
Optional local-only development requires PHP and MySQL installed locally; Docker is recommended.
This section contains the steps necessary to get the application up and running.
-
Clone the repository:
git clone <repository-url> cd papas2
-
Copy environment file:
cp .env.example .env
-
Edit
.envas needed:APP_URL=http://localhost:8080(external access)APP_INTERNAL_URL=http://php-apache-2:80(used by BrowserSync)ENV_DIR=srcfor development orENV_DIR=distfor production- MySQL credentials (match defaults in example if unsure)
-
Build images:
docker compose build
-
Start services (Apache/PHP, MySQL):
docker compose up -d mysql php-apache
-
Install Node dependencies and build assets (runs in a Node container):
docker compose run --rm node
This compiles SCSS, optimizes images, and copies files to dist.
-
Create the database:
docker compose exec mysql \ sh -c 'MYSQL_PWD="${MYSQL_ROOT_PASSWORD}" \ mysql -u root -e "CREATE DATABASE IF NOT EXISTS ${MYSQL_DATABASE}"'
-
Import the sample dataset:
docker compose exec -T mysql \ sh -c 'MYSQL_PWD="${MYSQL_ROOT_PASSWORD}" mysql -u root ${MYSQL_DATABASE}' \ < src/assets/data/webapp02.sql
-
Access the site:
-
Live development (optional):
-
Ensure
ENV_DIR=srcin.envso Apache serves src. -
Set
APP_INTERNAL_URL=http://php-apache-2:80. -
Run BrowserSync with watch:
docker compose run -p 3000:3000 --rm node \ sh -c "npm install && npx gulp watch"
This watches SCSS and reloads the browser on changes while proxying the internal Apache URL.
-
-
Production build and serve dist:
docker compose run --rm node sh -c "npm install && npx gulp build" # switch Apache to serve dist sed -i 's/^ENV_DIR=.*/ENV_DIR=dist/' .env docker compose restart php-apache
docker compose up # (re)create the services
docker compose stop # stop the services
docker compose start # start the services
docker compose restart # restart the services
docker compose down # teardown the services
docker compose run # run a one-time command against a service- src: PHP pages, assets, includes, and admin.
- dist: Built production files (output of Gulp build).
- tasks: Build helper scripts.
- gulpfile.js: Gulp tasks (build, watch, styles, images).
- compose.yml: Docker Compose services (php-apache, mysql, node).
- Dockerfile: Apache + PHP 8.1 container.
Planned improvements and extensions for upcoming versions of the project:
- Use Laravel to make the codebase more maintainable.
- Implement backend as a REST API
- Use a frontend framework (Vue.js or React) for the UI
This would allow having different UIs powered by the same backend.
The project is licensed under the MIT License. Refer to LICENSE for more information.



