PHPackages                             vandersangen/project-template-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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. vandersangen/project-template-bundle

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

vandersangen/project-template-bundle
====================================

Reusable Symfony bundle with authentication, user management, and master data loading

0.8.6(3w ago)0782MITPHPPHP &gt;=8.5CI passing

Since Feb 22Pushed 3w agoCompare

[ Source](https://github.com/vandersangen/project-template-bundle)[ Packagist](https://packagist.org/packages/vandersangen/project-template-bundle)[ Docs](https://github.com/vandersangen/project-template-bundle)[ RSS](/packages/vandersangen-project-template-bundle/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (10)Dependencies (170)Versions (19)Used By (0)

Project Template Bundle
=======================

[](#project-template-bundle)

[![CI Pipeline](https://github.com/vanDerSangen/project-template-bundle/workflows/CI%20Pipeline/badge.svg)](https://github.com/vanDerSangen/project-template-bundle/actions)[![Code Quality](https://github.com/vanDerSangen/project-template-bundle/workflows/Code%20Quality/badge.svg)](https://github.com/vanDerSangen/project-template-bundle/actions)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

A reusable Symfony bundle providing authentication, user management, and master data loading functionality.

Features
--------

[](#features)

- **JWT Authentication**: Complete authentication system with login, register, password reset
- **User Management**: User entity, repository, and service layer
- **Master Data Loading**: Flexible master data loading from PHP configuration files
- **Database Tools**: Git branch-based database naming, database copy command
- **Health Checks**: API health check endpoints
- **Queue (Messenger)**: Async message handling, `QueueJobLog` for monitoring, failed jobs in a separate transport
- **SuperAdmin**: Eigen login en gebruikers; alleen SuperAdmin-users hebben toegang. Zie [docs/super-admin.md](docs/super-admin.md)
- **Cron**: Scheduler command; cron-beheer (API en web UI) zit in de SuperAdmin-module. Zie [docs/cron-module.md](docs/cron-module.md)
- **Fully Tested**: 35 tests with 96 assertions (100% passing)

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

[](#installation)

### Via Composer (from Packagist)

[](#via-composer-from-packagist)

```
composer require vanDerSangen/project-template-bundle
```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.5
- Symfony &gt;= 7.4
- Doctrine ORM &gt;= 3.6
- Lexik JWT Authentication Bundle &gt;= 3.2

Quick Start
-----------

[](#quick-start)

### 1. Register the Bundle

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

Add to `config/bundles.php`:

```
return [
    // ...
    VanDerSangen\ProjectTemplateBundle\ProjectTemplateBundle::class => ['all' => true],
];
```

### 2. Configure the Bundle

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

Create `config/packages/project_template.yaml`:

```
project_template:
    mailer_sender: 'noreply@example.com'
```

### 3. Import Routes

[](#3-import-routes)

Add to `config/routes.yaml` (path relative to your `config/` directory):

```
project_template:
    resource: '../vendor/vandersangen/project-template-bundle/config/routes.yaml'
    type: yaml
    prefix: /
```

With a path repository use e.g. `../project-template-bundle/config/routes.yaml`. Then run `php bin/console cache:clear` and `php bin/console debug:router` to verify.

### 4. Configure Security

[](#4-configure-security)

Update `config/packages/security.yaml`:

```
security:
    password_hashers:
        VanDerSangen\ProjectTemplateBundle\User\Entity\User: 'auto'

    providers:
        app_user_provider:
            entity:
                class: VanDerSangen\ProjectTemplateBundle\User\Entity\User
                property: email

    firewalls:
        public:
            pattern: ^/(api/health|api/auth/(login|register|forgot-password|reset-password))
            security: false

        api:
            pattern: ^/api
            stateless: true
            provider: app_user_provider
            custom_authenticators:
                - VanDerSangen\ProjectTemplateBundle\Auth\Security\JwtAuthenticator
            entry_point: VanDerSangen\ProjectTemplateBundle\Auth\Security\JwtAuthenticator

    access_control:
        - { path: ^/api/health, roles: PUBLIC_ACCESS }
        - { path: ^/api/auth/(login|register|forgot-password|reset-password), roles: PUBLIC_ACCESS }
        - { path: ^/api, roles: ROLE_USER }
```

### 5. Generate JWT Keys

[](#5-generate-jwt-keys)

```
mkdir -p config/jwt
openssl genrsa -out config/jwt/private.pem -aes256 -passout pass:changeme 4096
openssl rsa -pubout -in config/jwt/private.pem -out config/jwt/public.pem -passin pass:changeme
```

### 6. Configure JWT

[](#6-configure-jwt)

Create `config/packages/lexik_jwt_authentication.yaml`:

```
lexik_jwt_authentication:
    secret_key: '%kernel.project_dir%/config/jwt/private.pem'
    public_key: '%kernel.project_dir%/config/jwt/public.pem'
    pass_phrase: 'changeme'
```

### 7. Run Migrations

[](#7-run-migrations)

The bundle automatically registers its migrations in your application. When you run the migrations command, both your application's migrations and the bundle's migrations will be executed:

```
php bin/console doctrine:migrations:migrate
```

The bundle's migrations are registered under the `DoctrineMigrations\ProjectTemplateBundle` namespace and will create the required tables (`users`, `mails`, `queue_job_logs`).

### 8. Load Master Data

[](#8-load-master-data)

```
php bin/console bundle:master-data:load
```

Usage
-----

[](#usage)

### Authentication Endpoints

[](#authentication-endpoints)

The bundle provides the following authentication endpoints:

#### Register

[](#register)

```
POST /api/auth/register
Content-Type: application/json

{
    "email": "user@example.com",
    "password": "SecurePass123!",
    "firstName": "John",
    "lastName": "Doe"
}
```

#### Login

[](#login)

```
POST /api/auth/login
Content-Type: application/json

{
    "email": "user@example.com",
    "password": "SecurePass123!"
}
```

Response:

```
{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...",
    "user": {
        "id": 1,
        "email": "user@example.com",
        "firstName": "John",
        "lastName": "Doe"
    }
}
```

#### Forgot Password

[](#forgot-password)

```
POST /api/auth/forgot-password
Content-Type: application/json

{
    "email": "user@example.com"
}
```

#### Reset Password

[](#reset-password)

```
POST /api/auth/reset-password
Content-Type: application/json

{
    "token": "reset-token-from-email",
    "password": "NewSecurePass123!"
}
```

### Queue and failed jobs

[](#queue-and-failed-jobs)

The bundle registers a **failed** Messenger transport. Jobs that fail after all retries are moved there. To list or retry them:

```
php bin/console messenger:failed:show failed
php bin/console bundle:queue:retry-failed --force
```

See [docs/messenger-failed-jobs.md](docs/messenger-failed-jobs.md) for details and cron examples.

### Protected Endpoints

[](#protected-endpoints)

Use the JWT token in the Authorization header:

```
GET /api/users/1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...
```

License
-------

[](#license)

MIT

Support
-------

[](#support)

- **Issues**: [GitHub Issues](https://github.com/vanDerSangen/project-template-bundle/issues)
- **Source**: [GitHub Repository](https://github.com/vanDerSangen/project-template-bundle)

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance95

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Total

14

Last Release

25d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6bcb49d473dad824194f78d4351a2defecfe8d0bfaad221bb263e34ae0c92808?d=identicon)[larsvandersangen](/maintainers/larsvandersangen)

---

Top Contributors

[![vandersangen](https://avatars.githubusercontent.com/u/130602080?v=4)](https://github.com/vandersangen "vandersangen (43 commits)")

---

Tags

jwtsymfonybundleAuthenticationmaster-data

###  Code Quality

TestsPHPUnit

Static AnalysisRector

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/vandersangen-project-template-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/vandersangen-project-template-bundle/health.svg)](https://phpackages.com/packages/vandersangen-project-template-bundle)
```

###  Alternatives

[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M738](/packages/sylius-sylius)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.1k17.8k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.8k](/packages/contao-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
