PHPackages                             webberdoocom/installer-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. webberdoocom/installer-bundle

ActiveSymfony-bundle[Admin Panels](/categories/admin)

webberdoocom/installer-bundle
=============================

A reusable Symfony installer bundle with React and Tailwind CSS frontend. Installs Symfony database tables and admin user.

v2.3.1(7mo ago)017MITPHPPHP &gt;=8.2CI failing

Since Oct 12Pushed 7mo agoCompare

[ Source](https://github.com/webberdoocom/installer-bundle)[ Packagist](https://packagist.org/packages/webberdoocom/installer-bundle)[ RSS](/packages/webberdoocom-installer-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (10)Versions (25)Used By (0)

Webberdoo Installer Bundle
==========================

[](#webberdoo-installer-bundle)

A complete, reusable Symfony installer bundle with a modern React + Tailwind CSS v4 frontend. This bundle provides a web-based installation wizard for Symfony applications with **automatic User entity detection**, configurable entities, database setup, and admin user creation.

Features
--------

[](#features)

✅ **Modern UI** - React with Tailwind CSS v4
✅ **Auto-Detection** - Automatically detects User entity and field names
✅ **Minimal Configuration** - Just list your entities, everything else is automatic
✅ **Step-by-step Installation** - System requirements, database, tables, admin user, SMTP (optional), app config
✅ **Optional SMTP Configuration** - Configure email settings during installation or skip for later
✅ **Safe Schema Installation** - Only creates tables, never drops existing ones
✅ **Dynamic Entity Support** - Add any Doctrine entities to install
✅ **Auto .env Update** - Automatically updates DATABASE\_URL in your .env file
✅ **Standalone Installation** - Works without existing Symfony configuration
✅ **Installation Status Tracking** - Resume interrupted installations

---

Installation
------------

[](#installation)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require webberdoocom/installer-bundle
```

### 2. Register the Bundle

[](#2-register-the-bundle)

Add to `config/bundles.php`:

```
return [
    // ... other bundles
    Webberdoo\InstallerBundle\InstallerBundle::class => ['all' => true],
];
```

### 3. Register Routes

[](#3-register-routes)

Add to `config/routes.yaml`:

```
installer:
    resource:
        path: ../vendor/webberdoocom/installer-bundle/src/Controller/
        namespace: Webberdoo\InstallerBundle\Controller
    type: attribute
```

**Important:** The route prefix `/install` is already defined in the controller attributes, so don't add a prefix here.

### 4. Configure the Bundle (Minimal Setup)

[](#4-configure-the-bundle-minimal-setup)

Create `config/packages/installer.yaml` with **just your entities**:

```
installer:
    entities:
        - App\Entity\User
        # Add more entities as needed:
        # - App\Entity\Post
        # - App\Entity\Category
```

**That's it!** The bundle will automatically:

- ✅ Detect your User entity (must implement `UserInterface`)
- ✅ Auto-detect field names (email, password, roles, etc.)
- ✅ Use sensible defaults for database driver, paths, and requirements
- ✅ Update your `.env` file with `DATABASE_URL`

### 4b. Optional Advanced Configuration

[](#4b-optional-advanced-configuration)

If you need to customize, here's the full configuration with defaults:

```
installer:
    entities:
        - App\Entity\User

    # Optional: Only needed if you want to change defaults
    database:
        driver: pdo_mysql          # pdo_mysql, pdo_pgsql, pdo_sqlite
        charset: utf8mb4

    # Optional: Customize PHP requirements
    requirements:
        php_version: '8.2.0'
        php_extensions:
            - ctype
            - iconv
            - pcre
            - session
            - simplexml
            - tokenizer
            - pdo_mysql
            - mbstring
            - json

    # Optional: Add custom application parameters
    app_config:
        parameters:
            - name: APP_NAME
              label: Application Name
              type: text
              required: true
```

### 5. Install Assets to Public Directory

[](#5-install-assets-to-public-directory)

**Note:** The frontend assets are **pre-built and included** in the package. You don't need to build them yourself unless you're modifying the source code.

```
php bin/console assets:install --symlink
```

---

Usage
-----

[](#usage)

### Access the Installer

[](#access-the-installer)

Navigate to: `http://your-app.com/install`

### Installation Steps

[](#installation-steps)

1. **System Requirements Check**

    - Verifies PHP version
    - Checks required and recommended PHP extensions
    - Validates directory permissions
2. **Database Configuration**

    - Enter database credentials
    - Tests connection before saving
    - Automatically updates `.env` file with `DATABASE_URL`
    - Writes config to `config/db.yaml`
3. **Install Tables**

    - Creates all configured entity tables
    - Sets up indexes and foreign keys
    - Safe mode - only creates, never drops
4. **Create Admin User**

    - Create administrator account
    - Password strength indicator
    - Email validation
5. **SMTP Configuration (Optional)**

    - Configure email/SMTP settings
    - Saved to both user entity and `config/smtp.yaml`
    - Can be skipped and configured later
6. **Application Configuration**

    - Set base URL and path
    - Configure custom parameters
    - Creates installation marker

---

Configuration Examples
----------------------

[](#configuration-examples)

### Minimal Configuration (Recommended)

[](#minimal-configuration-recommended)

The simplest setup - just list your entities:

```
installer:
    entities:
        - App\Entity\User
        - App\Entity\Post
        - App\Entity\Comment
```

The bundle automatically:

- Finds your User entity (implements `UserInterface`)
- Detects fields: `email`, `password`, `roles`, `fullName`, `isActive`
- Uses `pdo_mysql` driver with `utf8mb4` charset
- Sets sensible PHP version and extension requirements

### Adding Custom Application Parameters

[](#adding-custom-application-parameters)

```
installer:
    entities:
        - App\Entity\User

    app_config:
        parameters:
            - name: OPENAI_API_KEY
              label: OpenAI API Key
              type: text
              required: false
              default: ''
            - name: MAIL_FROM
              label: Email From Address
              type: email
              required: true
```

### PostgreSQL Database

[](#postgresql-database)

```
installer:
    entities:
        - App\Entity\User

    database:
        driver: pdo_pgsql
        charset: utf8
```

### Manually Specify User Entity (Advanced)

[](#manually-specify-user-entity-advanced)

Only needed if auto-detection doesn't work or you have multiple User entities:

```
installer:
    entities:
        - App\Entity\User
        - App\Entity\Customer

    admin_user:
        entity_class: App\Entity\User  # Explicitly specify which one
        admin_roles:
            - ROLE_ADMIN
            - ROLE_SUPER_ADMIN
```

---

How Auto-Detection Works
------------------------

[](#how-auto-detection-works)

### User Entity Detection

[](#user-entity-detection)

The bundle automatically finds your User entity by:

1. Scanning all entities listed in your configuration
2. Finding the one that implements `Symfony\Component\Security\Core\User\UserInterface`
3. No manual configuration needed!

### Field Name Detection

[](#field-name-detection)

The bundle intelligently detects field names using common naming patterns:

Field TypeDetected Names**Email**`email`, `username`, `user`, `login`**Password**`password`**Roles**`roles`**Full Name**`fullName`, `full_name`, `name`, `displayname`**Active Status**`isActive`, `is_active`, `active`, `enabled`, `status`**SMTP Host**`smtpHost`, `smtp_host`, `mailHost`, `mail_host`**SMTP Port**`smtpPort`, `smtp_port`, `mailPort`, `mail_port`**SMTP Username**`smtpUsername`, `smtp_username`, `smtpUser`, `smtp_user`**SMTP Password**`smtpPassword`, `smtp_password`, `smtpPass`, `smtp_pass`**SMTP Encryption**`smtpEncryption`, `smtp_encryption`, `smtpTls`, `smtp_tls`**SMTP From Email**`smtpFromEmail`, `smtp_from_email`, `fromEmail`, `from_email`**SMTP From Name**`smtpFromName`, `smtp_from_name`, `fromName`, `from_name`### Your User Entity

[](#your-user-entity)

The installer works with any User entity structure:

```
class User implements UserInterface
{
    private ?string $email = null;      // ✅ Detected as email field
    private ?string $password = null;   // ✅ Detected as password field
    private array $roles = [];          // ✅ Detected as roles field

    // Optional fields - will be set if they exist:
    private ?string $fullName = null;   // ✅ Auto-detected
    private bool $isActive = true;      // ✅ Auto-detected

    // SMTP fields (optional) - Auto-detected if present:
    private ?string $smtpHost = null;      // ✅ For email configuration
    private ?int $smtpPort = null;         // ✅ Auto-detected
    private ?string $smtpUsername = null;  // ✅ Auto-detected
    private ?string $smtpPassword = null;  // ✅ Auto-detected
    private ?string $smtpEncryption = null; // ✅ Auto-detected (tls/ssl)
    private ?string $smtpFromEmail = null; // ✅ Auto-detected
    private ?string $smtpFromName = null;  // ✅ Auto-detected

    // Standard getters/setters...
}
```

If a field doesn't exist or doesn't have a setter, the installer simply skips it - no errors!

---

SMTP Configuration
------------------

[](#smtp-configuration)

### Overview

[](#overview)

The installer includes an optional SMTP configuration step that allows users to set up email settings during installation. This feature is **completely optional** and can be skipped if you prefer to configure email settings later.

### How It Works

[](#how-it-works)

1. **During Installation** - Step 5 prompts for SMTP settings:

    - SMTP Host (e.g., `smtp.gmail.com`)
    - SMTP Port (default: `587`)
    - SMTP Username
    - SMTP Password
    - Encryption (TLS/SSL/None)
    - From Email (optional)
    - From Name (optional)
2. **Storage** - SMTP settings are saved in two locations:

    - **User Entity** - If your User entity has SMTP fields, they're automatically populated
    - **Config File** - Settings are also saved to `config/smtp.yaml` for easy access
3. **Skip Option** - Users can click "Skip for Now" to bypass this step and configure SMTP later

### Setting Up Your User Entity for SMTP

[](#setting-up-your-user-entity-for-smtp)

To enable SMTP configuration during installation, add these optional fields to your User entity:

```
