PHPackages                             mael/symfony-api-template - 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. [Framework](/categories/framework)
4. /
5. mael/symfony-api-template

ActiveProject[Framework](/categories/framework)

mael/symfony-api-template
=========================

Preconfigured template to create an API based on the Symfony framework

1.0.0(5y ago)05MITPHPPHP ^7.2.5

Since Jul 8Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Mael-91/symfony-api-template)[ Packagist](https://packagist.org/packages/mael/symfony-api-template)[ RSS](/packages/mael-symfony-api-template/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)Dependencies (41)Versions (2)Used By (0)

Symfony API Template
====================

[](#symfony-api-template)

- Synfony version : 5.1.2

Table of content
----------------

[](#table-of-content)

- Getting started
- Configuration
    - Doctrine
    - unit tests
    - PHPStan
    - JWT Configuration
- First Functional test
- Contributing
- License

Getting Started
---------------

[](#getting-started)

Requirements :

- `PHP 7.2.5`
- `ext-ctype`
- `ext-iconv`
- `ext-json`

First create a new project with composer

```
$ composer create-project mael/symfony-api-template
```

In the composer.json file, change the name of the project by yours as well as the description and the license.

Configuration
-------------

[](#configuration)

Before you can start your project, you need to do some basic configuration

### Doctrine

[](#doctrine)

In the `.env` file, modify the `DATABASE_URL` by filling in your identifiers (see the Symfony documentation)

### Unit tests

[](#unit-tests)

Our template provides you with a lot of tools for unit testing, you'll have to configure some things to suit your project

First, in the files `WebTestCase.php` and `ApiTestCase.php` you need to modify the login information that will be used to log in to a user.

You need to fill in the following variables `$username`, `$password` and `$route`

Ex :

```
public function login(string $username = 'test', string $password = 'test', string $route = '/api/login')
```

### PHPStan

[](#phpstan)

We also added PHPStan which allows you to detect errors in your code, you can change the level of detection in the `phpstan.neon` file.

You will find PHPStan's documentation via this link

### JWT Configuration

[](#jwt-configuration)

We assume that your api will use the `LexikJWTAuthenticationBundle`. You will find the configuration in `config/packages`

First, in the `.env` file, modify `JWT_PASSPHRAS`E by a string that you will choose

When you do the following two commands, it will ask you to enter the passphrase you previously selected

For JWT authentication to work, you need to generate two :

```
$ openssl genpkey -out config/jwt/private.pem -aes256 -algorithm rsa -pkeyopt rsa_keygen_bits:4096
$ openssl pkey -in config/jwt/private.pem -out config/jwt/public.pem -pubout
```

We have also added a bundle to refresh the JWT token, you will find the documentation here

You can also configure the route in the `config/route.yaml` file.

Be careful, you have to configure the authentication system yourself via JWT, in the security.yaml file (see the bundle documentation ).

First Functional test
---------------------

[](#first-functional-test)

During your first functional tests you will have to generate the sqlite database using the command

```
$ php bin/console doctrine:database:create --env test
```

Contributing
------------

[](#contributing)

If you want to contribute to the improvement of the template, you can :

- Fork this repo
- Make your change
- Create pull request

License
-------

[](#license)

This repository is under MIT License

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Unknown

Total

1

Last Release

2138d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9baf4f87f73f14b0f568373d259392b09f6e1a355cdbdb2c5637e2dcd3437ded?d=identicon)[Mael-91](/maintainers/Mael-91)

---

Top Contributors

[![Mael-91](https://avatars.githubusercontent.com/u/29598048?v=4)](https://github.com/Mael-91 "Mael-91 (3 commits)")

---

Tags

apisymfonyframeworktemplateapi-platform

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mael-symfony-api-template/health.svg)

```
[![Health](https://phpackages.com/badges/mael-symfony-api-template/health.svg)](https://phpackages.com/packages/mael-symfony-api-template)
```

###  Alternatives

[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)[chameleon-system/chameleon-base

The Chameleon System core.

1026.5k3](/packages/chameleon-system-chameleon-base)[sylius/sylius

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

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

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[forumify/forumify-platform

121.8k11](/packages/forumify-forumify-platform)[sulu/sulu

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

1.3k1.3M152](/packages/sulu-sulu)

PHPackages © 2026

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