- Web application for decoding payment codes from PDF files using PHP and Laravel framework with Livewire. The main API used for decoding was Google Vision API V1 which has a free plan.
- App designed to test the Cloud platform called Render and Laravel/Livewire FE library.
- The app uses Resend to send emails without using SMTP protocol.
- The app uses Cloudflare services for DNS management.
- PHP v8.4.13
- Composer v2.8.12
- Laravel v12.43.1
- Livewire v3.7.3
- NodeJS v20.13.1
- pecl.php.net/imagick-3.8.1
# Install ImageMagick system libraries first
sudo apt-get update
sudo apt-get install libmagickwand-dev imagemagick ghostscript
# Install Imagick extension via PECL
pecl install imagick
# Find your PHP ini directory
php --ini
# Add the extension to your php.ini or create a new config file
echo "extension=imagick.so" >> $(php --ini | grep "Scan for additional" | awk '{print $NF}')/imagick.ini
# Check if the extension is loaded
php -m | grep imagickcp .env.example .env
# Create PostgreSQL and Laravel containers
sail up -d
# Run database migrations
sail artisan migrate
# Run Vite dev server
sail npm run devThe project follows a Clean Architecture approach with Domain-Driven Design (DDD) principles, separating business logic from framework dependencies and infrastructure concerns.
The \Core namespace is organized into distinct layers:
App\Core\
├── 📦 Domain\ # Business logic and entities
├── ⚙️ Application\ # Use cases and services
└── 🔌 Infrastructure\ # External dependencies and implementations
Domain entities represent core business concepts with encapsulated business rules:
- Immutability: Entities use readonly properties to ensure state consistency
- Value Objects: Properties like
PaymentCode::$codeare protected to maintain invariants - Business Rules: Validation and behavior are encapsulated within entities
Example: PaymentCode entity enforces payment code format rules and provides typed access to its properties.
Application services/use-cases orchestrate domain entities and coordinate business workflows:
- Single Responsibility: Each service handles one specific use case
- Dependency Injection: Services depend on interfaces, not concrete implementations
- Framework Agnostic: No direct Laravel dependencies in service logic
Concrete implementations of domain interfaces:
- Database interactions (Eloquent models/repositories)
- External API clients
- OCR services (Google Vision API)
Released in 2025
By Victor B. Fiamoncini ☕️