b2in/CLAUDE.md
2025-10-20 17:50:35 +02:00

4.6 KiB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

This is a multi-domain Laravel application with Fortify/Sanctum authentication. The application supports 5 different domains with distinct themes and configurations:

  • Admin Portal: portal.b2in.test - Backend admin user interface (uses Livewire/Flux UI)
  • B2in Main: b2in.test - Frontend main page (uses TailwindCSS + Tailwind UI/Plus)
  • B2A Secondary: b2a.test - Frontend secondary page (uses TailwindCSS + Tailwind UI/Plus)
  • Stileigentum: stileigentum.test - Frontend landing page (uses TailwindCSS + Tailwind UI/Plus)
  • Style2own: style2own.test - Frontend landing page (uses TailwindCSS + Tailwind UI/Plus)

Development Commands

Setup & Installation

composer install
npm install
php artisan key:generate
php artisan migrate

Development Server

# Full development environment (server, queue, logs, vite)
composer run dev

# Individual components
php artisan serve
php artisan queue:listen --tries=1
php artisan pail --timeout=0
npm run dev

Asset Compilation

# Development
npm run dev

# Production builds
npm run build          # Main build
npm run build:admin    # Admin portal assets
npm run build:web      # Web assets

Testing

composer run test
# Or directly:
php artisan test

Code Quality

./vendor/bin/pint      # Laravel Pint (PHP CS Fixer)

Domain Management

php artisan domains:generate-favicons    # Generate placeholder favicons for all domains

Architecture

Multi-Domain System

The application uses a sophisticated domain routing system:

  • Domain configuration is managed via .env variables (see DOMAINS-CONFIG.md)
  • Each domain can have custom themes, colors, and CSS
  • Domain simulation available for development (DEV_SIMULATE_DOMAIN=true)
  • Routes are organized by domain type (routes/domains.php, routes/admin.php, routes/web.php)

Frontend Architecture

  • Vite: Multiple configurations for different domains (vite.config.js, vite.portal.config.js, vite.web.config.js)
  • TailwindCSS: Version 4.x with domain-specific configurations (tailwind.config.js, tailwind.portal.config.js, tailwind.web.config.js)
  • Backend (Portal): Livewire with Flux UI components and Volt for reactive components
  • Frontend Sites: Livewire with TailwindCSS + Tailwind UI/Plus components (no Flux UI)
  • Alpine.js: For lightweight frontend interactions

Backend Architecture

  • Laravel Framework: Version 12.x
  • Authentication: Laravel Fortify + Sanctum for API authentication
  • Permissions: Spatie Laravel Permission package
  • Database: Configured for multiple environments with migrations in database/migrations/
  • Providers: Custom providers for theme handling (app/Providers/ThemeServiceProvider.php)

Key Directories

  • app/Livewire/: Livewire components and actions
  • resources/css/web/: Domain-specific CSS themes
  • resources/views/: Blade templates with Flux components
  • routes/: Domain-separated route files
  • config/: Laravel configuration files

Development Tools

  • Laravel Sail: Docker development environment
  • Laravel Pail: Real-time log monitoring
  • Laravel Debugbar: Development debugging (barryvdh/laravel-debugbar)
  • PestPHP: Testing framework

Domain Configuration

Domains are configured in config/domains.php with environment variables:

  • DOMAIN_PORTAL, DOMAIN_B2IN, DOMAIN_B2A, DOMAIN_STILEIGENTUM, DOMAIN_STYLE2OWN
  • Each domain has custom color schemes and font families defined in the config
  • Development simulation via DEV_SIMULATE_DOMAIN and DEV_SIMULATED_DOMAIN

Domain-specific configurations include:

  • portal.b2in.test: Admin backend with Flux UI theme
  • b2in.test: Anthracite/Dynamic Blue color scheme, Inter/IBM Plex Sans fonts
  • b2a.test: Azur Blue/Liberty Red color scheme, Inter/Merriweather fonts
  • stileigentum.test: Style Blue/Style Sun color scheme, Inter/Ephesis fonts
  • style2own.test: Imperial Blue/Sand Gold color scheme, Inter/EB Garamond fonts

For local development, add domains to your hosts file:

127.0.0.1   portal.b2in.test
127.0.0.1   b2in.test
127.0.0.1   b2a.test
127.0.0.1   stileigentum.test
127.0.0.1   style2own.test

Important Files

  • DOMAINS-CONFIG.md: Detailed domain configuration guide
  • FORTIFY-SANCTUM-SETUP.md: Authentication setup guide
  • composer.json: Contains useful dev scripts (composer run dev, composer run test)
  • Multiple Vite/Tailwind configs for different build targets