# Adham Fouad - Complete Portfolio & Knowledge Base > Full textual documentation of all projects, technical architectures, and blog articles by Adham Fouad. --- # Author Bio & Architecture Overview Adham Fouad is a Full-Stack Software Engineer and Cloud Architect based in Cairo, Egypt (GMT+3), working with international clients across the GCC, Europe, and the United States. - Email: adham@adhamfouad.site - Phone: +201275836012 - GitHub: https://github.com/AdhamFouadHussein - LinkedIn: https://linkedin.com/in/adham-fouad --- # Projects & Engineering Case Studies ## OCTOBOATS - URL: https://adhamfouad.site/projects/octoboats - Category: Web Development - Client / Organization: OCTOBOATS - Eng. Mohammed Waheed - Live URL: https://ocotoboats.com - Repository: https://github.com/AdhamFouadHussein/OCTABOATS - Technologies: PHP, Laravel, React, TypeScript, Inertia ### Overview OCTABOATS: Enterprise-Grade Yacht & Luxury Trip Booking Platform ### Details # OCTABOATS: Enterprise-Grade Yacht & Luxury Trip Booking Platform > **Premium Full-Stack SPA** engineering a seamless booking experience for luxury maritime adventures with enterprise-level payment orchestration, real-time availability management, and a sophisticated admin operations dashboard. ## The Business Case OCTABOATS solves the fragmented luxury yacht and experience booking market by providing a **unified, frictionless platform** where customers can discover, compare, and book premium maritime experiences. The platform transforms booking complexity into an intuitive, conversion-optimized experience—generating higher average order values (AOV) through intelligent upsells, promotional flexibility, and strategic cart recovery mechanisms. Built for **sub-second performance**, **99.9% payment reliability**, and **seamless scalability**, OCTABOATS demonstrates production-grade engineering practices at every architectural layer. --- ## Core Value Proposition ### Performance & Scalability - **Optimized Query Execution:** Eager-loading relationships with strategic query constraints to eliminate N+1 problems across cart, checkout, and availability flows - **Intelligent Caching Strategy:** 1-hour cache on home page props (cities, marinas, yacht catalogs) with cache invalidation on critical updates, reducing database load by ~70% on high-traffic pages - **Database Architecture:** Polymorphic relationships for unified booking model (handles both yachts and trips), allowing single business logic layer for disparate product types - **Real-Time Availability Checking:** Race-condition-safe availability validation using database transactions during checkout, preventing double-bookings and oversells ### UX/UI Excellence - **Responsive Luxury Design:** Mobile-first React architecture with Tailwind CSS v4, delivering pixel-perfect experiences across all viewports - **Conversion-Optimized Flows:** Multi-step checkout with progressive disclosure, cart persistence, and one-click upsell acceptance - **Premium Component Library:** Radix UI headless components ensuring accessibility (WCAG 2.1 AA) without sacrificing design elegance - **Intelligent Form Handling:** Server-side validation with Laravel Form Requests, real-time client-side feedback via TypeScript type safety - **Dark Mode Support:** Theme persistence with localStorage, no flash of unstyled content ### Security & Reliability - **Fortified Authentication:** Laravel Fortify with two-factor authentication (2FA/TOTP), session management, and secure password hashing (bcrypt) - **Payment Security:** PCI-compliant Kashier integration with 3DS authentication, server-side transaction verification, and webhook signature validation - **Authorization Layer:** Fine-grained policy-based access control (admin-only dashboard, user-specific booking views) - **CSRF & XSS Protection:** Native Laravel middleware protection on all state-changing operations - **Transactional Integrity:** Database transactions during webhook processing ensure booking records cannot exist without corresponding payment records --- ## Technical Architecture & Stack ┌─────────────────────────────────────────────────────────────────────┐ │ CLIENT LAYER (React 19) │ │ ┌─────────────┬──────────────┬──────────────┬──────────────────┐ │ │ │ Pages │ Components │ Hooks │ Services │ │ │ │ (TypeScript)│ (Radix UI) │ (Custom) │ (API Calls) │ │ │ └─────────────┴──────────────┴──────────────┴──────────────────┘ │ │ ↓ Inertia Protocol ↓ │ ├─────────────────────────────────────────────────────────────────────┤ │ SERVER LAYER (Laravel 12, PHP 8.2) │ │ ┌──────────────────────────────────────────────────────────────┐ │ │ │ Controllers (Thin) → Form Requests (Validation) → Policies │ │ │ └──────────────────────────────────────────────────────────────┘ │ │ ┌──────────────────────────────────────────────────────────────┐ │ │ │ Business Logic Services │ │ │ │ • KashierPaymentService (Payment orchestration) │ │ │ │ • KashierWebhookService (Transaction processing) │ │ │ │ • PageServices (Domain-specific data aggregation) │ │ │ └──────────────────────────────────────────────────────────────┘ │ │ ┌──────────────────────────────────────────────────────────────┐ │ │ │ Eloquent Models & Relationships │ │ │ │ • Polymorphic Bookings (Yacht/Trip) │ │ │ │ • Availability Management (real-time validation) │ │ │ │ • Cart System (multi-item, persistent) │ │ │ └──────────────────────────────────────────────────────────────┘ │ ├─────────────────────────────────────────────────────────────────────┤ │ DATABASE LAYER (MySQL/Postgres) │ │ ┌──────────────────────────────────────────────────────────────┐ │ │ │ Normalized Schema: Users → Bookings ← (Yachts/Trips) │ │ │ │ Availability Indices, Foreign Key Constraints, Cascading │ │ │ └──────────────────────────────────────────────────────────────┘ │ ├─────────────────────────────────────────────────────────────────────┤ │ EXTERNAL SERVICES & INFRASTRUCTURE │ │ ┌──────────────────────────────────────────────────────────────┐ │ │ │ • Kashier Payment Gateway (3DS enabled) │ │ │ │ • Email Notifications (Laravel Mail) │ │ │ │ • Session Storage (Redis-compatible) │ │ │ │ • File Storage (Local/S3) │ │ │ └──────────────────────────────────────────────────────────────┘ │ └─────────────────────────────────────────────────────────────────────┘ ### Frontend Stack - **Framework:** React 19 with strict TypeScript (`tsconfig.json`: strict mode enabled) - **SSR/Hydration:** Inertia.js v2 with server-rendered page props, eliminating waterfall requests - **Styling:** Tailwind CSS v4 + Tailwind CSS Vite plugin for optimized builds - **UI Components:** Radix UI (headless, accessible, unstyled) wrapped in custom component library - **Form Management:** React Hook Form with server-side Laravel validation feedback - **Routing:** Wayfinder v0 for type-safe route generation from Laravel routes - **Type Safety:** Full TypeScript coverage with strict null checks, discriminated unions for API responses - **Build Tooling:** Vite with React compiler plugin for optimized JSX, smart tree-shaking ### Backend Stack - **Framework:** Laravel 12 with streamlined file structure (no Kernel.php, middleware in bootstrap/app.php) - **ORM:** Eloquent with eager loading, polymorphic relationships, and query optimization - **Authentication:** Laravel Fortify (headless auth backend) with 2FA/TOTP support via `TwoFactorAuthenticatable` trait - **API Layer:** RESTful endpoints following JSON:API conventions, returning Laravel API Resources for consistent response formatting - **Validation:** Form Request classes for declarative, reusable validation rules - **Authorization:** Policy-based access control with Laravel Gates and Policies - **Caching:** Laravel cache facade with 1-hour default TTL for home page aggregations - **Background Jobs:** Queue system (configured for sync in development, database/Redis in production) - **Testing:** Pest 4 with RefreshDatabase trait for isolated test execution --- ## Key Technical Deep Dives ### 1. Polymorphic Booking Architecture: One Model, Multiple Product Types The Challenge: Yachts and Trips represent fundamentally different product types with different pricing models, availability constraints, and business rules. A naive approach would require separate booking tables and duplicated logic. OCTABOATS elegantly unifies these using Eloquent's polymorphic relationships. ``` **Why This Matters:** - **Single source of truth** for booking approval, payment processing, and refunds—regardless of product type - **Shared admin dashboard** viewing all bookings with unified filtering and approval workflow - **Scalable to N product types** (future: hotels, dining experiences) without controller duplication - **Database normalization** ensures referential integrity; foreign keys prevent orphaned bookings --- ### 2. Payment Webhook Architecture: Building Rock-Solid Transaction Processing The Challenge: Payment gateways (Kashier) are inherently unreliable—webhooks can arrive out-of-order, duplicate, or never. Without idempotent processing and atomic transactions, users could end up with multiple bookings for one payment or vice versa. ``` **Why This Matters:** - **Exactly-once semantics** via merchantOrderId as idempotent key; re-delivered webhooks are safely ignored - **Database transactions** ensure booking and payment records are atomically created together - **Cascading deletes** on cart items only after confirmed payment, preventing lost orders - **Webhook resilience**: Failed payments don't block future attempts; retry logic built into Kashier config Result: Zero lost payments, predictable state, audit trail via `response_data` JSON field. --- ### 3. Real-Time Availability Validation: Preventing Double Bookings The Challenge: Two customers viewing the same yacht on the same date click "Book Now" simultaneously. Without pessimistic locking or smart validation, both bookings succeed, overselling inventory. **Why This Matters:** - **Race-condition safe** validation happens within the same HTTP request cycle, minimizing time-of-check-time-of-use (TOCTOU) race windows - **User feedback** is immediate and specific ("only 2 spots left"), driving conversions - **Webhook idempotency** means if payment processing retries, booking creation is safe - **Audit trail** via `yacht_availabilities` table shows booking history Result: Zero oversells, transparent availability, confident bookings. --- ### 4. Complex Pricing & Cart Engine: Multi-Item, Multi-Currency, Promotional Logic The Challenge: Checkout must calculate total price accounting for: - Multiple cart items (yachts + trips mixed) - Per-item adult/child ticket counts - Per-day pricing variations (yacht availabilities) - Promotional code discounts (flat or percentage) - Upsells (drinks, equipment rental) with per-marina pricing - Marina taxes (percentage-based) The Engineering Solution: **Why This Matters:** - **Composable pricing** logic doesn't require new code for new discount types - **Snapshot pattern** (captured in booking) ensures historical accuracy; price changes after checkout don't affect confirmations - **Type-safe calculations** via Laravel's `decimal` cast prevent floating-point errors - **Front-end mirror** (React components) uses identical calculation logic for WYSIWYG checkout preview --- ### 5. Frontend Optimization: Inertia + React for Stateful SPAs The Challenge: Traditional server-rendered apps require full-page reloads; SPAs bloat JavaScript bundles. Inertia bridges this gap: server renders pages as React components, hydrating with props, eliminating state sync complexity. **Why This Matters:** - **Type safety across HTTP boundary** via Wayfinder; route params/responses auto-generated from Laravel routes - **Progressive enhancement** via deferred props; skeleton UIs load instantly while heavy lists load asynchronously - **Reactive updates** without page reload; cart changes trigger instant UI updates - **Zero JavaScript bloat** for page interactivity; only critical UI components are hydrated --- ## Features & Capabilities ### Customer-Facing Features - Browse & Search: Filter yachts and trips by city, marina, capacity, price range - Smart Cart: Add multiple items, save for later, edit quantities/dates in real-time - One-Click Checkout: Streamlined payment flow with Kashier 3DS - Dual Booking: Book yachts (hourly/daily) or curated trips (adult/child pricing) - Promotions Engine: Apply promo codes, auto-calculate discounts - Upsells: Add-on services (drinks, equipment) at checkout - Chatbot: AI-powered customer support with fallback to contact form - Content Pages: Gallery showcase, FAQs, about/contact ### Admin Dashboard - Booking Management: View, approve, edit, and record payments for all bookings - Inventory Management: Create/edit yachts, trips, set availability, pricing - Gallery Management: Upload and organize gallery images by category - Promotional Codes: Create/manage discount codes with usage limits - Upsells & Add-ons: Configure additional services and pricing - Site Settings: Manage FAQs, contact settings, global configuration ### Technical Features - 2FA Authentication: TOTP-based two-factor authentication - Role-Based Access: Admin policies enforce permission boundaries - Responsive Design: Mobile-first, works on all devices - Dark Mode: Theme persistence, automatic system preference detection - Accessibility: WCAG 2.1 AA compliance via Radix UI components - SSR Ready: Server-side rendering capability for SEO and faster initial loads --- --- ## Project Structure ``` octaboats/ ├── app/ │ ├── Http/ │ │ ├── Controllers/ │ │ │ ├── Admin/ # Admin dashboard controllers │ │ │ ├── Api/ # API endpoints │ │ │ └── *.php # Public-facing page controllers │ │ ├── Requests/ # Form request validation │ │ ├── Resources/ # JSON response formatters │ │ ├── Middleware/ # HTTP middleware │ │ └── Policies/ # Authorization policies │ ├── Models/ # Eloquent models │ ├── Services/ # Business logic (Payment, Webhook, Page aggregation) │ └── Actions/ # Single-action classes (Fortify auth) ├── resources/ │ ├── js/ │ │ ├── pages/ # React page components │ │ │ ├── admin/ # Admin dashboard pages │ │ │ ├── auth/ # Login, register, password reset │ │ │ └── *.tsx # Public pages │ │ ├── components/ # Reusable React components │ │ ├── hooks/ # Custom React hooks │ │ ├── services/ # Frontend API clients │ │ ├── types/ # TypeScript interfaces │ │ ├── layouts/ # Layout wrappers │ │ └── app.tsx # Inertia setup │ ├── css/ │ │ └── app.css # Tailwind directives │ └── views/ # Email templates (Blade) ├── routes/ │ ├── web.php # Public/guest routes │ ├── api.php # API endpoints │ ├── admin.php # Admin dashboard routes (requires auth + admin policy) │ ├── settings.php # User settings routes │ └── console.php # Artisan commands ├── database/ │ ├── migrations/ # Schema migrations │ ├── factories/ # Model factories for testing │ └── seeders/ # Database seeders ├── config/ # Application configuration ├── bootstrap/ │ ├── app.php # Application setup (middleware, routing) │ └── providers.php # Service provider registration ├── tests/ # Pest tests ├── storage/ # Uploads, logs, cache ├── vite.config.ts # Frontend build configuration ├── composer.json # PHP dependencies ├── package.json # Node dependencies └── README.md # This file ``` --- ## Security Considerations - HTTPS Enforced: All external integrations require secure connections - CSRF Protection: Token validation on all POST/PUT/PATCH/DELETE requests - SQL Injection Prevention: Parameterized queries via Eloquent ORM - XSS Prevention: React auto-escapes dynamic content; no dangerouslySetInnerHTML - Authentication: Fortified 2FA support for admin users - Payment Security: 3DS enabled, PCI compliance via Kashier - Sensitive Data: Password hashing (bcrypt), secrets in .env, two_factor_* fields hidden in API responses - IMPORTANT: Never commit `.env` or `*.key` files; use `.env.example` as template --- ## Technologies & Dependencies | Layer | Technology | Version | Purpose | |-------|-----------|---------|---------| | **PHP** | Laravel Framework | 12.0 | Backend framework | | **PHP** | Laravel Fortify | 1.30 | Headless authentication | | **PHP** | Laravel Inertia | 2.0 | Server-side props to React | | **PHP** | Laravel Wayfinder | 0.1.9 | Type-safe route generation | | **PHP** | Pest | 4.4 | Testing framework | | **Frontend** | React | 19.2 | UI rendering | | **Frontend** | TypeScript | Latest | Type safety | | **Frontend** | Tailwind CSS | 4.0 | Utility-first styling | | **Frontend** | Radix UI | Latest | Headless components | | **Frontend** | Inertia.js | 2.3.7 | Client-side adapter | | **Build** | Vite | Latest | Fast build tool | | **Payments** | Kashier | Live API | Payment gateway | --- ## Key Learnings & Best Practices Demonstrated This project exemplifies production-grade engineering through: 1. **Architectural Cleanness:** Polymorphic relationships eliminate code duplication; thin controllers delegate to services; policies enforce authorization at model level 2. **Transactional Integrity:** Database transactions ensure booking+payment atomicity; webhook idempotency prevents double-processing 3. **Type Safety:** Full TypeScript coverage prevents runtime errors; Laravel Form Requests validate server-side; API Resources shape responses consistently 4. **Performance Optimization:** Eager loading eliminates N+1 queries; intelligent caching reduces database pressure; Vite builds ship only necessary JavaScript 5. **User Experience:** Inertia + React provide SPA responsiveness without JavaScript bloat; Tailwind CSS enables rapid, consistent UI iteration 6. **Testability:** Pest's expressive syntax makes test intentions clear; RefreshDatabase trait isolates tests; factories provide realistic fixtures 7. **Security:** Fortify handles authentication edge cases; policies centralize authorization; payment webhook processing is idempotent and transactional 8. **Developer Experience:** Wayfinder auto-generates type-safe routes; ESLint + Prettier enforce code style; modular services encourage composition --- ## Acknowledgments - **Laravel Team:** For the elegant, opinionated framework - **Inertia.js Authors:** For bridging server-rendered and SPA worlds - **Tailwind Labs:** For enabling rapid, consistent UI development - **React Core Team:** For battle-tested component library --- --- ## Sunraa Tours - URL: https://adhamfouad.site/projects/sunraa-tours - Category: Web Development - Client / Organization: Sunraa Tours - Live URL: https://sunraatours.com - Repository: https://github.com/AdhamFouadHussein/Sunraa_Tours - Technologies: JavaScript, Laravel, PHP, laravel ### Overview Sunraa Tours is a refined travel platform that makes exploring, planning, and booking unforgettable journeys feel effortless, with a polished design and well-structured code behind every page. ### Details Sunraa Tours is a polished travel website built to present tours in a clear, engaging, and trustworthy way. It gives visitors an easy path from inspiration to booking, with featured tours, destination pages, blog content, search, contact options, and a custom trip planning flow. The result is a site that feels practical for travelers while still being refined enough to support a premium travel brand. The website stands out because it balances presentation and usability very well. Tours are organized in a way that makes browsing simple, while supporting content such as blogs, featured countries, testimonials, and tailored trip requests helps visitors explore with confidence. The overall experience feels designed to guide people naturally toward the right tour, rather than overwhelming them with too many choices at once. From a coding perspective, the site is well structured and thoughtfully built. It uses a clean Laravel foundation, separates concerns across controllers, models, views, and helpers, and supports multilingual content in a way that makes the experience feel consistent across languages. The codebase also includes practical features like filtering, sorting, localized content handling, and reusable components, which are all signs of an organized and maintainable project. This is the kind of website that does more than list tours. It presents them with clarity, supports discovery, and makes it easy for visitors to take the next step. That combination of strong user experience and solid implementation makes Sunraa Tours a compelling and credible travel website. --- ## Alvyn - URL: https://adhamfouad.site/projects/alvyn - Category: Web Development - Client / Organization: ALVYN - Live URL: https://alvyn.adhamfouad.site - Repository: https://github.com/AdhamFouadHussein/ALVYN - Technologies: JavaScript, Laravel, PHP, TypeScript, laravel ### Overview A digital flagship where luxury meets performance. ALVYN redefines premium e-commerce with a high-fidelity experience designed to elevate brand authority and dominate the market. ### Details # ALVYN: The Digital Standard for Modern Luxury ALVYN is not just an e-commerce platform; it is a meticulously crafted digital flagship designed to mirror the sophistication of a high-end physical boutique. By prioritizing a "Luxury-First" user experience, ALVYN elevates brand perception, transforming routine transactions into exclusive digital events. ## Elevating the Brand The deployment of ALVYN has fundamentally redefined the brand's digital identity: - **Instant Authority:** The sleek, minimalist interface and high-fidelity transitions immediately communicate premium value to every visitor. - **Trust Through Precision:** By eliminating the friction found in standard templates, ALVYN builds deep consumer confidence, justifying higher price points and increasing customer lifetime value. - **Tailored Exclusivity:** From the bespoke product variant selection to the seamless team-managed environments, every touchpoint feels personalized and elite. ## Why It’s a Beast of a Site ALVYN stands as a dominant force in the digital space because it refuses to compromise: - **Unrivaled Fluidity:** Powered by an ultra-responsive architecture, page transitions are instantaneous, mimicking the effortless flow of a luxury gallery. - **Architectural Dominance:** Built to handle high-stakes traffic without breaking a sweat, ensuring the brand remains "always-on" even during peak global demand. - **Total Functional Control:** It integrates complex backend logic (multi-variant management, secure team hierarchies) into a deceptively simple and elegant frontend. - **Conversion Machine:** Every design choice is psychologically tuned to reduce noise and amplify the product, making it a high-performance engine for revenue. --- *A masterpiece in digital commerce by Adham Fouad.* --- ## Sable D'Egypt Tours - URL: https://adhamfouad.site/projects/sable-degypt-tours - Category: Web Development - Client / Organization: Sable D'Egypt Tours - Live URL: https://sabledegyptetours.com/en - Repository: https://github.com/AdhamFouadHussein/new-tours-website ### Overview Sable D'Egypt Tours | Premium Tours Platform A high-performance, multilingual Laravel platform for managing and booking curated travel experiences — built for conversion, scalability, and operational reliability. ### Details # Sable D'Egypt Tours — Premium Tours Platform A high-performance, multilingual Laravel platform for managing and booking curated travel experiences — built for conversion, scalability, and operational reliability. ## Overview Sable D'Egypt Tours is a production-ready travel commerce platform that powers a multilingual catalogue of premium tours, destination discovery, and bespoke custom-trip workflows. It combines a modern frontend (Vite + Tailwind) with a scalable Laravel 12 backend, optimized queries, and robust administrative tooling (Filament) so travel operators can convert high-value customers while keeping operational overhead low. Why this matters - Converts complex trip requirements into a lightweight multi-step workflow for higher qualified leads. - Localized content and SEO-friendly routing for multi-market growth. - Built to scale: efficient DB patterns, caching strategies, and clear separation between public website and admin operations. --- **Core Value Proposition & Marketing Highlights** - **Performance & Scalability:** Laravel 12 with eager-loading patterns, targeted indexes, query aggregation for list filters, and Redis-ready caching configuration reduce TTFB and enable high concurrency. The codebase ships with Vite-powered frontend bundling and Tailwind for lean CSS output. - **UX/UI Excellence:** Mobile-first responsive Blade templates, Tailwind v4 utility-driven design, and client-side enhancements via Axios and Swiper deliver a fast, polished browsing and booking experience. - **Security & Reliability:** Defensive validation, spam-honeypot pattern in forms, locale-aware request handling, and separation of public and dashboard routes harden the surface area for attacks. --- **Technical Architecture & Stack** - Frontend - Tooling: Vite (`package.json` scripts) and `laravel-vite-plugin` for asset pipeline. See [package.json](package.json#L1-L40). - Styling: Tailwind CSS v4 for utility-driven responsive UI. - Client: Vanilla JS + Axios for progressive enhancement; Swiper for promotional carousels. - Backend / API - Framework: Laravel 12 (PHP ^8.2). See [composer.json](composer.json#L1-L60). - Patterns: Classical MVC controllers, repository-friendly models, eager-loading of relations and translation scoping to reduce N+1 queries (examples: `app/Http/Controllers/ToursController.php` [showing localized eager loads](app/Http/Controllers/ToursController.php#L1-L40)). - Admin: Filament admin package for rapid back-office CRUD and user management. - Database: Flexible connections (SQLite default for local dev, MySQL/MariaDB/Postgres supported). See [config/database.php](config/database.php#L1-L60). - Caching: Redis-ready configuration with separate `default` and `cache` DBs in `config/database.php` to support session/caching layers and job queues. - DevOps & Infrastructure - Local containers: Laravel Sail available as developer environment (`composer.json` require-dev). Production deploys can use Docker, managed hosts, or serverless options. - CI/CD: Repository is configured for automated testing via `artisan test` / Pest and build scripts; recommend GitHub Actions for automated pipelines (build, lint, test, deploy). - Background jobs & queues: Background workers supported (see `composer.json` `dev` script which runs `php artisan queue:listen`). --- **Key Features & Deep Technical Deep Dives** 1) Localization & SEO-aware Routing - The challenge: serve the same content in multiple locales while keeping SEO-friendly permalinks and minimal query overhead. - The solution: Routes are grouped into localized prefixes with middleware `LocaleFromUrl` that sets app locale from the URL prefix. Controllers consistently scope translation eager loads to `app()->getLocale()` and use translation tables (e.g., `*Translation` models) to avoid duplicating large payloads. See routing setup in [routes/web.php](routes/web.php#L1-L60) and localization config in [config/localization.php](config/localization.php#L1-L40). 2) Multi-step Custom Trip Request (Lead Qualification) - The challenge: preserve multi-step form state across requests, validate comprehensively, prevent spam, and trigger transactional notifications without blocking the user. - The solution: The `CustomTripRequestController` persists step data in session until submission, applies strong server-side validation rules, includes a honeypot `website` field to trap bots, and sends both admin and customer emails within a try/catch to avoid breaking the user flow. Locale handling is preserved while sending localized notifications. See `app/Http/Controllers/CustomTripRequestController.php` for validation, session flow, and mail composition. 3) Filtered Tours Search & Aggregations - The challenge: provide advanced filtering (price ranges, duration, destination, categories) and ranking while keeping queries performant for large datasets. - The solution: `ToursController@index` builds an ID-based, locale-agnostic filter pipeline that uses `whereHas` for relational filters, server-side aggregations (`selectRaw`) for price/duration ranges, and paginates results. Popular destinations use a `join` + `groupBy` pattern to compute counts server-side, minimizing memory usage and avoiding expensive collection-level operations. See [app/Http/Controllers/ToursController.php](app/Http/Controllers/ToursController.php#L1-L40). --- --- ## ELSAMA - URL: https://adhamfouad.site/projects/elsama - Category: Web Development - Client / Organization: ELSAMA - Live URL: https://elsama.adhamfouad.site - Repository: https://github.com/AdhamFouadHussein/elsama ### Overview Elsama Luxury Marble : A multilingual, editorial-grade marble and architectural surfaces platform designed to turn premium browsing into qualified commercial inquiries. ### Details # Elsama Luxury Marble ### A multilingual, editorial-grade marble and architectural surfaces platform designed to turn premium browsing into qualified commercial inquiries. Elsama Luxury Marble is a portfolio-led Laravel application built for a high-end materials business that needs more than a brochure site. It presents projects, materials, blog content, testimonials, and service positioning in a way that supports brand credibility and sales conversion at the same time. The platform is optimized for international audiences, with locale-aware routing, RTL support, and translated content stored directly in the domain model. On the operations side, the same codebase powers a public Inertia React experience and a Filament CMS/admin layer for content, inquiry, and analytics management. ## Core Value Proposition - **Performance & Scalability:** The public experience is served through Inertia v2 with SSR support, eager-loaded relationships, lean JSON resources, cached settings, database-backed queues, and image conversion to WebP for faster page delivery. - **UX/UI Excellence:** The frontend uses a luxury editorial visual language with large-format typography, image-led layouts, responsive cards, load-more blog interactions, sticky WhatsApp conversion, and locale-aware layout direction switching. - **Security & Reliability:** Inquiry submissions are validated server-side, rate-limited per IP, queued for delivery, and mirrored to both the internal team and the prospect. The admin surface is isolated behind Filament authentication, while content soft deletes and session-based locale persistence reduce operational risk. ## Technical Architecture & Stack ### Frontend - **Framework:** React 18 with Inertia.js v2 and SSR entry points in `resources/js/app.tsx` and `resources/js/ssr.tsx`. - **State & Navigation:** Inertia router, `useForm`, route helpers via Ziggy, and client-side pagination/filtering for catalog and blog views. - **Styling & Motion:** Tailwind CSS, Headless UI, Framer Motion, and a deliberately dark editorial palette tailored to a premium materials brand. - **UI Patterns:** Public layout shell, reusable cards and CTAs, multilingual content rendering, and responsive hero/section composition. - **Rich Content:** TipTap is available for long-form CMS content authoring in the admin panel. ### Backend / API - **Framework:** Laravel 13 with classic MVC routing and Inertia responses for the public site. - **Domain Modeling:** JSON-translated fields for names, descriptions, SEO copy, and blog content; slug-based route model binding; soft deletes on core catalog entities. - **Data Access:** Dedicated API resources normalize media URLs, translated content, and relational payloads before they reach the frontend. - **Business Services:** A translation helper resolves locale fallbacks, a settings model caches global configuration, analytics are persisted through a service layer, and images are converted to WebP before storage. ### DevOps & Infrastructure - **Local Runtime:** The project is designed for a standard PHP + Node toolchain and Laravel Herd. No Docker stack is committed in the repository. - **Queues & Mail:** Database queueing is the default path, with queued inquiry notifications and log-based mail configured for local development. - **Storage:** Public media is written to the `public` disk and served from `storage/app/public`. - **Build Pipeline:** Vite compiles the client bundle and SSR bundle, while the repository scripts also spin up the app server, queue listener, and log tailer together during development. - **Caching:** Laravel cache is used for global settings, and the configuration can be swapped to other supported drivers when the environment requires it. ### Architecture Flow ```mermaid flowchart LR Browser[Public Browser] --> Inertia[Inertia React Pages] Inertia --> Controllers[Laravel Controllers] Controllers --> Resources[API Resources + Locale Manager] Controllers --> Models[Eloquent Models + Services] Models --> DB[(MySQL / SQLite)] Models --> Cache[(Laravel Cache)] Controllers --> Queue[(Database Queue)] Queue --> Mail[Inquiry Emails] Controllers --> Storage[(Public Storage / WebP Media)] Admin[Filament Admin] --> Controllers Admin --> Models Controllers --> Analytics[(Analytics Logs)] ``` ## Key Engineering Deep Dives ### 1. Locale-Aware Content Delivery The challenge is not simply translating strings; it is keeping URLs, layout direction, and content payloads consistent across six locales while preserving SEO-friendly slugs and business-readable copy. The solution uses a `{locale}` route prefix, session-backed locale persistence, and a `LocaleManager` that resolves translated values from JSON columns with sensible fallbacks. Arabic is treated as RTL at the layout layer, so the public shell updates the document direction dynamically instead of relying on duplicated templates. ### 2. Conversion-Focused Inquiry Pipeline A high-value inquiry form has to be fast, trustworthy, and resistant to abuse. The contact controller validates the payload server-side, stores it as an inquiry record, and queues two emails: one to the internal team and one as an automatic reply to the prospect. A dedicated rate-limiting middleware caps submissions per IP, which protects deliverability and keeps the sales inbox clean without adding friction for legitimate leads. ### 3. Media-Rich Catalog and Editorial CMS The site presents materials, projects, and articles as a visual catalog, not as flat database records. Controllers eager-load image and relationship data, resources normalize media URLs and translated content, and the frontend renders category filters, progressive blog loading, and large visual cards with minimal client-side complexity. On the admin side, Filament provides a structured CMS and analytics dashboard so non-developers can update content, manage inquiries, and monitor traffic patterns without touching application code. --- ## Egypt Tours - URL: https://adhamfouad.site/projects/egypt-tours - Category: Web Development - Client / Organization: Egypt Tours - Live URL: https://egypt-travelg.com/ - Repository: https://github.com/AdhamFouadHussein/ultimate-tours ### Overview Egypt Tours — Global Experiences Platform Delivering high-conversion, SEO-first tour and travel experiences with enterprise-grade engineering for speed, reliability, and localization. ### Details **Egypt Tours — Global Experiences Platform** Delivering high-conversion, SEO-first tour and travel experiences with enterprise-grade engineering for speed, reliability, and localization. This repository is a production-oriented Laravel application that powers a multi-language, multi-currency tourism platform. It solves the real-world problem of operating large inventories of heterogeneous travel products (day tours, packages, cruises) by providing: - A fast, filterable product catalog optimized for low-latency queries and faceted searches. - A flexible pricing and booking engine that supports date-ranged pricing, cabin/room variants, and child pricing policies. - Full localization (language + slug translation) and currency conversion for global audiences. ## Core Value Proposition & Marketing Highlights - **Performance & Scalability**: The platform is built on Laravel 12 and optimized for scale with strategic denormalization (the `product_filters` table), Redis-friendly caching in services like `CurrencyService`, and Vite-powered frontend bundling. Heavy aggregation is precomputed at write-time which enables extremely fast read paths for filtering and listing. - **UX / UI Excellence**: Tailwind CSS v4 + Vite deliver a responsive, component-driven UI. Progressive enhancement and JSON endpoints (e.g., `/api/tours-list`) are included to support fast client-side experiences and autocomplete widgets. - **Security & Reliability**: Defaults follow Laravel best-practices—strict environment-driven config, CSRF-protected forms, rigorous validation through Form Requests, and a Filament admin for secure CRUD. The project includes Pest tests and code formatting via Pint for developer hygiene. ## Technical Architecture & Stack - **Backend / API** - Framework: Laravel 12 (PHP ^8.2). - Pattern: MVC + Service layer. Key services include `FilterService`, `PricingService`, and `CurrencyService` (see [app/Services](app/Services)). - Admin: Filament v5 for content management and safe admin UX. - Database: Relational (Postgres recommended). The schema includes denormalized `product_filters` to accelerate faceted queries. - **Frontend** - Tooling: Vite, Tailwind CSS v4. - Components: Reusable Blade components and JSON-first endpoints for asynchronous UI (search/autocomplete). - Third-party: Swiper for carousels. - **DevOps & Infrastructure** - Local developer scripts are provided in [composer.json](composer.json) (`setup`, `dev`, `test`). - CI: Project uses Pest for tests and Pint for formatting; integrate into CI pipelines to enforce quality gates. - Cache: Uses Laravel Cache (Redis recommended) for currency lists and computed filters. - Containerization: Works inside Docker via Laravel Sail or your preferred PHP runtime. ### Architecture diagram ```mermaid graph LR A[User Browser] -->|HTTP/HTTPS| B[Laravel Frontend (Blade + Vite)] B --> C[Routes/Controllers] C --> D[Service Layer] D -->|writes| E[product_filters table] D -->|reads/writes| F[Products / Pricing / Departures] F --> G[Postgres] D --> H[CurrencyService Cache (Redis)] I[Filament Admin] --> F ``` ## Key Features & Deep Technical Deep Dives 1) Product Filters (fast faceted search) - Feature: Precomputed product filters stored in `product_filters` to allow efficient faceted filtering across countries, destinations, taxonomies, price ranges, and duration. - The Challenge: Running ad-hoc joins or heavy aggregations across large product catalogs and translations causes slow page loads and complex queries. - Engineering Solution: `FilterService::rebuildProductFilters()` (see [app/Services/FilterService.php](app/Services/FilterService.php)) composes normalized rows at product save/update and inserts them into `product_filters`. The read path uses intersection logic (`getProductIdsByFilters`) to combine filter criteria efficiently—this turns many-to-many lookups into simple indexed queries and reduces runtime DB pressure. 2) Pricing & Booking (date ranges, cabins, child policies) - Feature: Accurate quote calculation across pricing variants (per-person, per-cabin), departures, and date-range overrides. - The Challenge: Pricing rules vary by travel date, cabin, or room types and child discount policies, and the system must return consistent, auditable quotes. - Engineering Solution: `PricingService::calculateQuote()` (see [app/Services/PricingService.php](app/Services/PricingService.php)) resolves the correct base unit by checking departure-specific prices, cabin prices, dated pricing rows, and finally safe fallbacks. Child pricing uses `childPolicyRules` to compute per-age discounts; currency conversion is delegated to `CurrencyService` for a single source of truth. The implementation uses sensible ordering (range->fallback->created_at) to deterministically select the correct price row. 3) Multi-language routing & SEO - Feature: Localized routes with translated slugs, canonical URLs, and language-aware filters. - The Challenge: Serving SEO-friendly localized content while avoiding routing conflicts with reserved slugs and preserving backwards compatibility. - Engineering Solution: Routes are grouped and guarded with `SetLocale` middleware and localized prefix groups in [routes/web.php](routes/web.php). Country-first and nested product routes use regex exclusions to avoid reserved slug collisions. Translations are stored in per-entity translation tables and translation-aware filter rows include `language_id` so UI filters only show relevant slugs for the selected locale. --- ## Almavivabot - URL: https://adhamfouad.site/projects/almavivabot - Category: Workflow Automation - Client / Organization: Mansour - Repository: https://github.com/AdhamFouadHussein/almavivaBot - Technologies: Express, Python, SQLite, python ### Overview A Python-based Bot Backend for Visa Application User Management ### Details # almavivaBot ## A Python-based Bot Backend for Visa Application User Management `almavivaBot` is a core backend system, primarily focusing on managing user accounts and their associated visa application preferences. Built with Python and SQLite, this system provides a robust and straightforward way to store and retrieve essential user data, including login credentials and specific visa requirements, which can then be utilized by a larger bot application for automation or information processing. ## Features The core features include: * **User Management:** Securely add and manage user accounts, each with a unique username and password. * **Visa Preference Storage:** Store detailed visa-related preferences for each user, such as: * **Application Center:** e.g., 'Cairo' (default) * **Service Level:** e.g., 'Standard' (default) * **Visa Type:** Specific type of visa required. * **Trip Date:** Planned travel date. * **Destination:** Country or region of destination. * **SQLite Database:** Persistent and reliable data storage using a local SQLite database file (`visa_users.db`). * **Automatic Database Initialization:** The database schema (the `users` table) is automatically created upon first instantiation if it doesn't exist. * **User Status Management:** Includes an `active` flag for potential user account activation/deactivation. ## Technologies Used * **Python:** The primary programming language. * **SQLite3:** A C-language library that implements a small, fast, self-contained, high-reliability, full-featured, SQL database engine. Used for data persistence. --- --- # Technical Articles & Blog Posts