Local Setup
Overview
Section titled “Overview”The production environment executes directly on the host operating system and does not rely on a containerized infrastructure.
For local development, however, Docker is the reccomended local-development environment. While the application can technically run directly on a machine’s host layer, potential runtime version disparities and dependency drift make manual environment duplication unreliable. Subsequent development teams should treat the provided Docker configurations as the canonical local environment.
Useful references:
Prerequisites & Stack Specifications
Section titled “Prerequisites & Stack Specifications”The recommended local ecosystem requires the following system tools:
- Docker Desktop
- Docker Compose
- Git
The application environment expects and isolates the following specific stack layers:
- PHP 7.3–8.x
- Laravel 8 Framework
- PostgreSQL
- PostGIS Spatial Extension
Example Local Docker Configuration
Section titled “Example Local Docker Configuration”The project does not include a standardized Docker configuration in the repository.
During this engagement, local development infrastructure fell outside the contracted scope. The inherited project did not provide a reproducible development environment, so V&B created an internal Docker configuration to make local development practical and consistent while implementing the contracted work.
The following configuration is provided as a working reference implementation rather than an official or required deployment standard. Future maintainers are free to improve or replace it, but it successfully supported day-to-day development throughout this engagement.
docker-compose.yml
Section titled “docker-compose.yml”services: app: build: . ports: - "8000:8000" volumes: - .:/app env_file: - .env depends_on: - db
db: image: postgis/postgis:15-3.4 environment: POSTGRES_DB: autosplash POSTGRES_USER: laravel POSTGRES_PASSWORD: laravel volumes: - pgdata_legacy:/var/lib/postgresql/data ports: - "5433:5432"
volumes: pgdata_legacy:docker/nginx.conf
Section titled “docker/nginx.conf”server { listen 8001; server_name _;
root /app/public; index index.php index.html;
client_max_body_size 100M;
location / { try_files $uri $uri/ /index.php?$query_string; }
location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
location ~ /\.ht { deny all; }}docker/supervisord.conf
Section titled “docker/supervisord.conf”[supervisord]nodaemon=truelogfile=/var/log/supervisor/supervisord.log
[program:php-fpm]command=/usr/local/sbin/php-fpmautostart=trueautorestart=truestdout_logfile=/dev/stdoutstdout_logfile_maxbytes=0stderr_logfile=/dev/stderrstderr_logfile_maxbytes=0
[program:nginx]command=/usr/sbin/nginx -g "daemon off;"autostart=trueautorestart=truestdout_logfile=/dev/stdoutstdout_logfile_maxbytes=0stderr_logfile=/dev/stderrstderr_logfile_maxbytes=0Required Environment Configurations
Section titled “Required Environment Configurations”Without the presence of this file, Firebase-dependent features—specifically customer mobile OTP validation sequences and real-time messaging subsystems—will fail to initialize.
First-Time Bootstrap Sequence
Section titled “First-Time Bootstrap Sequence”To initialize a fresh repository clone locally, commands must be executed within the container shell in the following precise structural order to ensure dependencies exist before framework hooks are fired:
# 1. Install runtime dependenciescomposer install
# 2. Initialize application security keysphp artisan key:generate
# 3. Build structural database layers and seed essential recordsphp artisan migratephp artisan db:seedCritical Seed Data Note
Section titled “Critical Seed Data Note”The application strictly requires database seeders to accompany migrations during startup. During the platform stabilization phase, several missing foundational seeds were corrected and integrated because portions of the inherited codebase implicitly depend on core lookups existing out of the box. Running migrations without executing db:seed will result in incomplete database states and unpredictable logic failures.
Running the Application
Section titled “Running the Application”To orchestrate and spin up the localized ecosystem, execute the standard Compose instruction from the root folder:
docker compose up --build(Note: Depending on your specific local engine version, you may alternatively use docker-compose up --build).
The orchestration engine mounts the project directory directly into the active application container runtime while exposing an isolated PostgreSQL data layer through designated network ports.
Database & Spatial Topologies
Section titled “Database & Spatial Topologies”Local database operations run on PostgreSQL paired with the PostGIS spatial extension. The supplied development file provisions the data container using the following explicit parameters:
db: image: postgis/postgis:15-3.4 environment: POSTGRES_DB: autosplash POSTGRES_USER: laravel POSTGRES_PASSWORD: laravelStrategic Importance of PostGIS
Section titled “Strategic Importance of PostGIS”The PostGIS extension is a structural system requirement. Core booking sequences depend directly on specialized geographic spatial calculations (PolygonModel) to assess coverage limits and match user locations with active service perimeters. Attempting to execute the application without a properly provisioned PostGIS extension will cause location queries to error out.
Local Infrastructure Layout
Section titled “Local Infrastructure Layout”The repository includes specific configurations designed exclusively to build a reproducible local development sandbox:
docker-compose.ymldocker/nginx.confdocker/supervisord.conf
These configurations serve solely to streamline local developer onboarding and mirror the application dependencies uniformly. They are distinct from, and independent of, the host-level parameters utilized in the production server architecture.
Deployment Optimization Script
Section titled “Deployment Optimization Script”The repository includes an optimized server deployment helper utility located within the project files:
#!/bin/bash
# Ensure local tree reflects the branch state cleanlygit reset --hard HEADgit pull
# Install production-ready dependency structurescomposer update --no-dev --optimize-autoloader --no-interaction
# Execute pending database migrations safelyphp artisan migrate --force
# Clear out any conflicting runtime state cachesphp artisan optimize:clear
# Build highly performant compiled caches for production operationsphp artisan config:cachephp artisan route:cachephp artisan view:cachephp artisan optimizeThis helper script is designed to safely automate upstream server updates by ensuring a synchronized repository state, applying schema updates, clearing lingering memory files, and compiling unified Laravel caching schemas to optimize server response times.
Operational Troubleshooting & Known Constraints
Section titled “Operational Troubleshooting & Known Constraints”Host-Level Version Irregularities
Section titled “Host-Level Version Irregularities”Running this application directly on a host machine rather than utilizing the provided container ecosystem may surface runtime errors arising from dependency constraints. Docker is provided as the definitive mitigation for version management.
Missing Cryptographic Keys & Configs
Section titled “Missing Cryptographic Keys & Configs”The system environment will fail to manage active sessions or processes if the required Firebase service account JSON structural file is omitted from the application root.
Container File System Ownership Permissions
Section titled “Container File System Ownership Permissions”Depending on your host operating system’s filesystem engine (e.g., specific Linux or macOS permission groupings), files generated internally by the Docker container may inherit root-level execution permissions. If your editor or local package manager encounters write restrictions, reset the working directory ownership mapping using your system’s chown configuration utilities.
Runtime Integration Summary
Section titled “Runtime Integration Summary”The primary functional modules driving the application ecosystem are explicitly detailed below:
- Laravel 8 Core Monolith
- PostgreSQL Database Engine
- PostGIS Geographic Extension
- Google Firebase Auth Services
- Stripe Payment Processing API
- Amazon S3 Asset Storage
- Twilio Communication Services
- Xero Accounting Integration
- Laravel WebSockets Server
For package update procedures, the composer.json schema is the authoritative reference for version ranges and core dependencies.
Handover Transition Guidelines
Section titled “Handover Transition Guidelines”This deployment documentation establishes the baseline local configuration designed to minimize downstream engineering overhead. Incoming engineering resources are strongly encouraged to utilize the provided container system to ensure uniform behavior and significantly accelerate onboarding timelines.