# Technology Stack **Analysis Date:** 2026-05-28 ## Languages **Primary:** - PHP 8.2 - Server-side application logic; runtime via `php:8.2-fpm` base image in `Dockerfile` **Secondary:** - JavaScript (ES Modules) - Frontend interactivity (Alpine.js, Chart.js, Leaflet maps) - CSS / PostCSS - Styling with Tailwind CSS utility classes - Blade templates - Server-side templating language (`.blade.php` files) - SQL - Raw PostgreSQL queries used extensively in controllers ## Runtime **Environment:** - Docker containers orchestrated by Docker Compose (version `3.9`) - PHP-FPM 8.2 (`php:8.2-fpm` image) for PHP processing - Nginx `stable-alpine` as reverse proxy / static file server **Package Manager:** - Composer 2.x (copied from `composer:2.3` image) for PHP dependencies - npm (Node.js LTS installed in Docker image) for frontend dependencies - Lockfile: `composer.lock` and `package-lock.json` (both present) ## Frameworks **Core:** - Laravel 12.0 (`laravel/framework ^12.0`) - Full-stack PHP web framework - Eloquent ORM (minimal usage — predominantly raw DB queries) - Blade templating engine - Artisan CLI for management commands - Built-in auth scaffolding via `laravel/breeze ^2.3` (dev dependency) **Testing:** - PHPUnit 11.5.3 (`phpunit/phpunit ^11.5.3`) - Unit and feature testing - Mockery 1.6 (`mockery/mockery ^1.6`) - Mocking framework - Laravel Pail 1.2.2 (`laravel/pail ^1.2.2`) - Log viewer for CLI (dev) - Collision 8.6 (`nunomaduro/collision ^8.6`) - Error reporting (dev) **Build/Dev:** - Vite 7.0.7 (`vite ^7.0.7`) - Frontend build tool / bundler - Laravel Vite Plugin 2.0 (`laravel-vite-plugin ^2.0`) - Vite integration for Laravel - PostCSS 8.4.31 (`postcss ^8.4.31`) - CSS processing pipeline - Autoprefixer 10.4.2 (`autoprefixer ^10.4.2`) - Vendor prefix injection - Laravel Pint 1.24 (`laravel/pint ^1.24`) - PHP code style fixer (dev) - Laravel Sail 1.41 (`laravel/sail ^1.41`) - Docker dev environment (dev) ## Key Dependencies **Critical:** - `google/auth ^1.49` - Google OAuth2 authentication library; used for Firebase Cloud Messaging (FCM) service account token generation - `barryvdh/laravel-dompdf ^3.1` - PDF generation from Blade views (used for siren history, rainfall history, water level history exports) - `maatwebsite/excel ^3.1` - Excel export (XLSX) for historical rainfall and water level data - `laravel/tinker ^2.10.1` - Interactive REPL for Laravel **Infrastructure:** - PostgreSQL 18.1 (via `postgres:18.1` Docker image) - Primary database - Nginx `stable-alpine` - Web server / reverse proxy - Redis (configured in `config/database.php` via `phpredis` client) - Cache/queue driver option - pgAdmin4 (`dpage/pgadmin4`) - Database administration UI - Adminer - Lightweight database management UI **Frontend:** - Tailwind CSS 3.1 (`tailwindcss ^3.1.0`) - Utility-first CSS framework - `@tailwindcss/forms ^0.5.2` - Form reset plugin - `@tailwindcss/vite ^4.0.0` - Tailwind+Vite integration - Alpine.js 3.4.2 (`alpinejs ^3.4.2`) - Lightweight JS framework for interactivity - Axios 1.11.0 (`axios ^1.11.0`) - HTTP client for API requests - Bootstrap 5.3.3 - Loaded via CDN for UI components (modals, toasts, dropdowns) - Chart.js 4.4.0 - Loaded via CDN; chart rendering with zoom plugin 2.1.1 - Leaflet 1.9.4 - Loaded via CDN; interactive map for station visualization - jQuery 3.6.0 - Loaded via CDN for DOM manipulation - Flatpickr - Loaded via CDN; date picker widget - Boxicons 2.1.4 - Loaded via CDN; icon library - jsPDF 2.5.1 + jspdf-autotable 3.5.28 - Loaded via CDN; client-side PDF generation ## Configuration **Environment:** - `.env` file (`.env.example` pattern for initial setup via `composer setup` script) - Config files in `src/config/` — all values read from `env()` with sensible defaults **Build:** - `src/vite.config.js` — Vite entry points: `resources/css/app.css`, `resources/js/app.js`, `resources/css/style.css`, `resources/js/script.js` - `src/tailwind.config.js` — Content paths for PurgeCSS; custom font family (Figtree); forms plugin - `src/postcss.config.js` — PostCSS pipeline (default Vite setup) ## Platform Requirements **Development:** - Docker Engine + Docker Compose (preferred via `docker-compose.yml`) - PHP 8.2+ CLI (if running outside Docker) - Composer 2.x - Node.js LTS + npm **Production:** - Docker container orchestration (Docker Compose or similar) - PostgreSQL 18.1 database - Redis (optional, for queue/cache/session in production config) - Nginx with PHP-FPM ## Database **Primary:** - PostgreSQL 18.1 (via Docker image `postgres:18.1` in `docker-compose.yml`) - Port: 5432 (exposed) - Connection configured in Laravel via `config/database.php` (`pgsql` driver) - Default schema: `public` - All migrations use raw PostgreSQL-specific SQL (e.g., `::date` casts, `INTERVAL`, `date_trunc`) --- *Stack analysis: 2026-05-28*