# AutoAdmin Library

## Overview and Links

- [Complete documentation](./docs/index.md)
- [Changelog)](./CHANGELOG.md)

## Installation

To integrate AutoAdmin into a Symfony 6.4 project, follow these steps.

### Project initialization and dependencies

Create the Symfony 6.4 project, install the base dependencies (`webapp`, `doctrine/orm`) and remove any unrequired bundles:

```shell
composer create-project symfony/skeleton:"6.4.*" <my_project_directory>
cd <my_project_directory>
composer require webapp
composer require -W doctrine/orm:^2.6.3
composer remove symfony/asset-mapper symfony/ux-turbo symfony/stimulus-bundle
```

### Repository Configuration and Installation

Configure the private Satis repository for access to the bundle, then install `gda/autoadmin`:

```shell
composer config repositories.satis composer https://satis.gda.fr
composer config extra.symfony.endpoint --json '["https://satis.gda.fr/recipes/index.json", "flex://defaults"]'

composer require -W gda/autoadmin
php bin/console aa:install
```

### Quick start

Create your initial site and the first administrator account:

```shell
# Creates the default site structure
php bin/console aa:content:create-site

# Create the first administrator account
php bin/console aa:admin:create-administrator
```

## For the Development of the Bundle

### Local Development via Docker Volumes

To develop directly on the bundle's code, use a Docker volume mounted in `compose.override.yaml` (service `web`) to link your local source code to the container's vendor directory:

```shell
# Extract of compose.override.yaml
services:
  web:
    volumes:
      # Load the source code of the local bundle
      - /home/gda/PhpstormProjects/autoadmin-library/src:/var/www/vendor/gda/autoadmin/src:ro
```

### Local asset management

For dynamic asset management: run `yarn watch` in the bundle, then execute `php bin/console assets:install --symlink` in your project.

**Attention**: run `yarn build` in the bundle before pushing a commit.

### Bundle Update

Satis generates a new version of the bundle after the creation of a **Release** (tag) on GitHub.

Update the dependency in your project with:

```shell
composer update gda/autoadmin
```

### List the latest Git tags

```shell
bash ./scripts/git/last_tags.sh
```

## Notes

We use phpunit ^9.5 because Symfony 6.4 uses this version.
