svp1989 / symfony-api-skeleton
Symfony api skeleton based on symfony-flex, api-platform, JWT etc.
Installs: 36
Dependents: 0
Suggesters: 0
Security: 0
Stars: 11
Watchers: 1
Forks: 1
Open Issues: 5
Type:project
Requires
- php: ^7.1.3
- ext-iconv: *
- api-platform/api-pack: ^1.0
- doctrine/annotations: ^1.6
- doctrine/doctrine-migrations-bundle: ^1.3
- friendsofsymfony/rest-bundle: ^2.3
- friendsofsymfony/user-bundle: dev-master
- jms/serializer-bundle: ^2.3
- lexik/jwt-authentication-bundle: ^2.4
- nelmio/api-doc-bundle: ^3.1
- nelmio/cors-bundle: ^1.5
- sensio/framework-extra-bundle: ^5.1
- symfony/asset: ^4.0
- symfony/console: ^4.0
- symfony/flex: ^1.0
- symfony/framework-bundle: ^4.0
- symfony/lts: ^4@dev
- symfony/maker-bundle: ^1.0
- symfony/phpunit-bridge: ^4.0
- symfony/security-bundle: ^4.0
- symfony/security-core: ^4.0
- symfony/swiftmailer-bundle: ^3.1
- symfony/templating: ^4.0
- symfony/validator: ^4.0
- symfony/yaml: ^4.0
Requires (Dev)
- codeception/codeception: ^2.4
- doctrine/doctrine-fixtures-bundle: ^3.0
- symfony/dotenv: ^4.0
- symfony/monolog-bundle: ^3.1
- symfony/web-server-bundle: ^4.0
Conflicts
This package is not auto-updated.
Last update: 2025-03-22 04:06:02 UTC
README
JSON REST API simple skeleton based on symfony-flex, JWT, api-platform, fosuserbundle etc.
Installation
1. Clone repository
Create project :
composer create-project svp1989/symfony-api-skeleton:@dev
Or clone repository from GitHub:
git clone https://github.com/svp1989/symfony-api-skeleton.git
2. Dependencies installation
Install all needed dependencies:
composer install
3. Create JWT auth keys
Create JWT auth keys and configure .env
:
ssh-keygen -t rsa -b 4096 -f private.pem openssl rsa -in private.pem -pubout -outform PEM -out public.pem
4. Configuration
Create .env
file, which contains all the necessary
environment variables that application needs:
cp .env.dist .env
5. Create database
Create database and upload fixtures:
bin/console doctrine:database:create bin/console doctrine:schema:create bin/console doctrine:fixtures:load
6. Start server
Start server and open in the browser http://127.0.0.1:8000/api/doc:
bin/console server:start
Authorisation
Go to route /api/login:
ROLE_USER:
--username:user
--password:user
ROLE_ADMIN
--username:admin
--password:admin