Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sfcod/api-boilerplate
https://github.com/sfcod/api-boilerplate
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/sfcod/api-boilerplate
- Owner: sfcod
- Created: 2019-11-21T13:48:15.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-28T23:26:29.000Z (over 1 year ago)
- Last Synced: 2024-07-25T20:09:46.582Z (4 months ago)
- Language: PHP
- Size: 883 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Symfony api-boilerplate
## Admin part
- Sonata admin## Api part
- Api platform#### Run:
``` bash
$ composer install
$ npm install
$ npm run dev
$ php init.php
```#### Docker
```bash
docker exec -it api-bollerplate_web su www-data
```#### Generate the SSH keys:
``` bash
$ mkdir -p config/jwt
$ 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
```#### PHPUnit:
```bash
php bin/console do:mi:mi --env=test
php bin/console do:fi:lo --env=test
```
``` bash
$ php bin/phpunit
$ php bin/phpunit --filter SecurityControllerTest
```#### Custom annotation:
- Add a custom field to normalize entity
```bash
@AgrNormalizer(UserItemNormalizer::class, groups={"user:statistic"})
```
- Add a query param require validation
```bash
@ApiRequiredFilters("get", filters={"referred"})
```