# QuitSure Laravel Program

A multi-language smoking cessation web application built on Laravel 11. Serves onboarding flows, B2B partner integrations, and B2C customer journeys with Stripe and Razorpay payment processing.

## Quick Start

```bash
# Install dependencies
composer install && npm install

# Start development server, queue worker, and Vite
composer dev

# Run tests
php artisan test

# Static analysis (PHPStan level 5)
./vendor/bin/phpstan analyse

# Code formatting
./vendor/bin/pint
```

## Architecture

- **PHP 8.2+ / Laravel 11** with Laradock (Nginx, MySQL, Redis)
- **7 languages**: English, Hindi, German, Japanese, Portuguese, Spanish, French
- **3 MySQL databases**: main app (`mysql`), user PII (`qsuserinfo`), logs (`logs`)
- **Frontend**: Blade templates + Hotwire Turbo + jQuery (via Vite)
- **Payments**: Stripe (international), Razorpay subscriptions (India)

See [CLAUDE.md](CLAUDE.md) for detailed architecture documentation, conventions, and AI assistant guidance.

## Project Structure

```
app/
├── Helpers/              # Global helper functions (safe_env, getActiveDayEnv)
├── Http/
│   ├── Controllers/
│   │   ├── V2/           # Current live version
│   │   │   ├── B2B/      # Partner flows (6 languages)
│   │   │   ├── B2C/      # Consumer flows (6 languages)
│   │   │   └── OnBoarding/  # Onboarding wizard (7 languages)
│   │   ├── V3/           # New English-only flow
│   │   │   ├── B2C/      # Consumer flows
│   │   │   └── OnBoarding/  # Restructured onboarding
│   │   ├── WebQuiz/      # Quiz result controller
│   │   └── *.php         # Standalone controllers (Stripe, Razorpay, Webhook, etc.)
│   ├── Queries/          # 40 query classes encapsulating Eloquent operations
│   └── Requests/         # Form Request validation classes
├── Models/               # 45 models with Hungarian notation (iUserID, vEmail, bActive)
├── Services/             # Business logic and external integrations (13 services)
└── Mail/                 # Mailable classes
```

## Documentation

| File | Purpose |
|------|---------|
| [CLAUDE.md](CLAUDE.md) | AI assistant context — architecture, conventions, commands |
| `CLAUDE.local.md` | Local dev environment setup (gitignored) |
| `app/*/README.md` | Per-directory documentation for each app layer |

## Testing

Tests use [Pest PHP](https://pestphp.com/) with custom expectations and a `MockHelper` for service mocking. Database interactions are mocked (no migrations in this project).

```bash
php artisan test                        # All tests
./vendor/bin/phpunit tests/Unit         # Unit only
./vendor/bin/phpunit tests/Feature      # Feature only
./vendor/bin/phpunit --filter=TestName  # Single test
```
