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.7.13(2mo ago)0182MITPHPPHP &gt;=8.5CI passing

Since Feb 22Pushed 2mo 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 1mo ago

READMEChangelog (4)Dependencies (81)Versions (10)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
- **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`:

```
project_template:
    resource: '@ProjectTemplateBundle/config/routes.yaml'
    prefix: /
```

### 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!"
}
```

### 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

41

—

FairBetter than 89% of packages

Maintenance84

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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 ~1 days

Total

7

Last Release

75d 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 (25 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

[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[prestashop/prestashop

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

9.0k15.4k](/packages/prestashop-prestashop)[open-dxp/opendxp

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

7310.3k29](/packages/open-dxp-opendxp)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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