Skip to main content
This comprehensive guide covers everything you need to install and configure Zoo Arcadia on your system.

System Requirements

Required Software

PHP

Version 7.4 or higher (8.x recommended)

Composer

Latest stable version for dependency management

Node.js

Version 14+ with npm included

Database

MySQL 8.0+ or MariaDB 11.4+

Optional Software

  • Docker Desktop - For containerized deployment (recommended)
  • Git - For version control and cloning the repository

Installation Methods

Docker provides a consistent, isolated environment for Zoo Arcadia.

Prerequisites

1

Install Docker Desktop

Download and install Docker Desktop for your operating system:
2

Verify Docker installation

docker --version
docker-compose --version

Setup Process

1

Clone the repository

git clone https://github.com/dumitrusf/zoo-Arcadia.git
cd zoo-ARCADIA
2

Configure environment

Run the Docker configuration script:
.\switch-to-docker.bat
This creates/updates your .env file with Docker-specific settings:
DB_HOST=db
DB_NAME=zoo_arcadia
DB_USER=zoo_user
DB_PASS=zoo_password
3

Review Docker Compose configuration

The docker-compose.yml defines three services:Web Service (PHP + Apache)
  • Exposes port 8080
  • Mounts source directories for development
  • Automatically installs dependencies
Database Service (MariaDB 11.4)
  • Exposes port 3306
  • Persistent volume for data storage
  • Auto-initializes with SQL scripts from database/ directory
4

Build and start containers

docker-compose up -d --build
The --build flag ensures all dependencies are installed and assets are compiled. This may take a few minutes on first run.
5

Verify containers are running

docker-compose ps
You should see:
  • zoo-arcadia-web - Status: Up
  • zoo-arcadia-db - Status: Up
6

Check application logs

docker-compose logs -f web
Press Ctrl+C to exit log view.

Docker Container Management

docker-compose ps

Database Management (Docker)

docker-compose down -v && docker-compose up -d

Updating Code in Docker

When you modify composer.json, package.json, or source files:
docker-compose up -d --build
Docker volumes automatically sync changes to PHP files, so you don’t need to rebuild for simple code changes. Only rebuild when dependencies change.

Environment Configuration

Database Configuration

The .env file controls all database connections:
DB_HOST=db
DB_NAME=zoo_arcadia
DB_USER=zoo_user
DB_PASS=zoo_password

Email Configuration

Configure SMTP for contact form and notifications:
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_SECURE=tls
SMTP_USER[email protected]
SMTP_PASS=your-app-password
SMTP_FROM_EMAIL[email protected]
SMTP_FROM_NAME=Arcadia Zoo
ZOO_EMAIL[email protected]
For Gmail, you need to create an App Password instead of using your regular password.

Cloudinary Configuration (Optional)

For cloud-based image storage:
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret

Database Setup

Database Schema

Zoo Arcadia uses a modular SQL structure:
  • 01_init.sql - Creates database and sets character encoding
  • 02_tables.sql - Defines all tables (users, animals, habitats, services, etc.)
  • 03_constraints.sql - Foreign key relationships and constraints
  • 04_indexes.sql - Performance optimization indexes
  • 05_procedures.sql - Stored procedures for complex operations
  • 06_seed_data.sql - Initial data for development/testing
  • 07_cleanup.sql - Removes deprecated tables

Manual Database Deployment

If automated scripts don’t work, execute SQL files manually:
mysql -u root -p < database/01_init.sql
mysql -u root -p zoo_arcadia < database/02_tables.sql
mysql -u root -p zoo_arcadia < database/03_constraints.sql
mysql -u root -p zoo_arcadia < database/06_seed_data.sql

Seed Data

The 06_seed_data.sql file includes:
  • Roles: Admin, Veterinary, Employee, Accountant
  • Employees: Sample employee records
  • Users: Login credentials for each role
  • Animals: Sample zoo animals with details
  • Habitats: Savanna, Jungle, Marsh environments
  • Services: Restaurant, guided tours, train ride
Review database/06_seed_data.sql for default credentials before deploying to production.

Asset Compilation

Build Commands

npx gulp buildCss && npx gulp buildJs

Asset Pipeline

The Gulp configuration (gulpfile.js) handles: CSS Processing:
  • Compiles src/scss/app.scsspublic/build/css/app.css
  • Compiles src/scss/bo-sidebar-only.scss for back-office
  • Copies vendor CSS (Bootstrap, DataTables, Normalize.css)
JavaScript Processing:
  • Minifies src/js/app.js with Terser
  • Compiles individual filter scripts:
    • animals-filter.js
    • habitat-filter.js
    • rating-testimony.js
  • Generates source maps for debugging
  • Copies vendor JS (jQuery, Bootstrap, DataTables)
Development Features:
  • BrowserSync for live reload
  • File watching for automatic recompilation
  • Proxy to http://localhost:3001

Verification Steps

1

Check PHP configuration

php --ini
Verify extensions are loaded: mysqli, pdo_mysql, mbstring, curl, gd
2

Test database connection

mysql -u root -p -e "SHOW DATABASES;"
Verify zoo_arcadia database exists
3

Verify assets compiled

Check that public/build/ contains:
  • css/app.css
  • css/bo-sidebar-only.css
  • css/bootstrap.min.css
  • js/app.js
  • js/jquery.min.js
4

Access the application

Docker: http://localhost:8080Local: http://localhost:3001You should see the Zoo Arcadia homepage.
5

Test back-office access

Navigate to /home/pages/login-personnel and attempt to log in with credentials from 06_seed_data.sql.

Troubleshooting

SSL Certificate Error (Windows)

If composer install fails with curl error 60: SSL certificate problem:
1

Download cacert.pem

Download from curl.se/ca/cacert.pemSave to a permanent location, e.g., C:\php\cacert.pem
2

Locate php.ini

php --ini
Note the “Loaded Configuration File” path
3

Update php.ini

Add or update these lines:
[curl]
curl.cainfo = "C:\php\cacert.pem"

[openssl]
openssl.cafile = "C:\php\cacert.pem"
4

Restart services

  • Close and reopen your terminal
  • Restart Apache if using XAMPP/WAMP
  • Retry composer install

Port Conflicts

Port 8080 (Docker) already in use:
# Edit docker-compose.yml
web:
  ports:
    - "8081:80"  # Change external port
Port 3001 (Local) already in use:
php -S localhost:3002 -t public public/index.php

Database Connection Issues

Verify credentials in .env match your MySQL/MariaDB setup:
mysql -u root -p
If you can’t connect, reset the root password or create a new user.
Run the database deployment script:
.\deploy_database.bat  # Windows
./deploy.sh            # Linux/macOS
Ensure MySQL/MariaDB service is running:
# Windows (XAMPP)
# Start via XAMPP Control Panel

# macOS
brew services start mariadb

# Linux
sudo systemctl start mariadb

Asset Compilation Errors

Install Gulp globally or use npx:
npm install -g gulp-cli
# OR
npx gulp
Rebuild node-sass:
npm rebuild node-sass
Windows: Run terminal as AdministratormacOS/Linux:
sudo npm install -g gulp-cli

Docker-Specific Issues

Check logs for errors:
docker-compose logs web
docker-compose logs db
Ensure SQL files are being mounted:
docker exec -it zoo-arcadia-db ls /docker-entrypoint-initdb.d
If empty, rebuild:
docker-compose down -v
docker-compose up -d --build
For PHP changes: Refresh browser (changes are mounted in real-time)For dependencies: Rebuild container:
docker-compose up -d --build

Project Structure

zoo-ARCADIA/
├── App/                    # Domain-based architecture (MVC per domain)
│   ├── Animals/
│   ├── Auth/
│   ├── Habitats/
│   └── Services/
├── public/                 # Front controller and compiled assets
│   ├── index.php           # Application entry point
│   └── build/              # Compiled CSS/JS
├── src/                    # Source SCSS and JavaScript
│   ├── scss/
│   └── js/
├── database/               # Versioned SQL scripts
│   ├── 01_init.sql
│   ├── 02_tables.sql
│   ├── 03_constraints.sql
│   └── 06_seed_data.sql
├── includes/               # Shared helpers and layouts
│   ├── csrf.php
│   ├── functions.php
│   └── layouts/
├── .env                    # Environment configuration
├── .env.example            # Environment template
├── composer.json           # PHP dependencies
├── package.json            # Node.js dependencies
├── docker-compose.yml      # Docker configuration
├── gulpfile.js            # Asset build configuration
└── README.md              # Project documentation

Next Steps

After successful installation:
  1. Explore the codebase architecture in App/
  2. Review the front controller pattern in public/index.php
  3. Check routing configuration in App/router.php
  4. Review security implementations (CSRF tokens, input validation)
  5. Test all user roles (Admin, Veterinary, Employee)

Additional Resources

Build docs developers (and LLMs) love