staegi / symfony-rest-api
The "Symfony2 REST API " project
Installs: 42
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Type:project
Requires
- php: >=5.4.0
- doctrine/doctrine-bundle: ~1.4
- doctrine/doctrine-fixtures-bundle: ^2.2
- doctrine/orm: ^2.4.8
- friendsofsymfony/oauth-server-bundle: ^1.4
- friendsofsymfony/rest-bundle: ^1.7
- friendsofsymfony/user-bundle: ^1.3
- incenteev/composer-parameter-handler: ~2.0
- jms/serializer-bundle: ^1.1
- liip/monitor-bundle: ^2.1
- nelmio/api-doc-bundle: ^2.10
- nelmio/cors-bundle: ^1.4
- sensio/distribution-bundle: ~4.0
- sensio/framework-extra-bundle: ^3.0.2
- symfony/assetic-bundle: ~2.3
- symfony/monolog-bundle: ~2.4
- symfony/swiftmailer-bundle: ~2.3
- symfony/symfony: 2.8.*
Requires (Dev)
This package is not auto-updated.
Last update: 2024-11-15 19:55:43 UTC
README
This is a nice start point to create an application which provides a REST interface to your database.
#Requirements
- git
- MySQL
- PHP 5.4 or higher
- Apache 2 or Nginx
- Composer
#Installation
Create project with vendors:
curl -sS https://getcomposer.org/installer | php
composer.phar create-project staegi/symfony-rest-api
cd symfony-rest-api
Create development database:
php bin/console doctrine:database:create -e dev
php bin/console doctrine:schema:create -e dev
Load fixtures to create first client and user:
php bin/console doctrine:fixtures:load
###Preconfigured vendor modules
- FOSOAuthServerBundle: Provides token and user authorization with OAuth2
- FOSUserBundle: Provides user and group management
- FOSRestBundle: Provides various tools to rapidly develop RESTful API's with Symfony
- NelmioApiDocBundle: Generates documentation for your REST API from annotations
- NelmioCorsBundle: Adds CORS (Cross-Origin Resource Sharing) headers support in your Symfony2 application
- JMSSerializerBundle: Allows you to easily serialize, and deserialize data of any complexity
- LiipMonitorBundle: Provides an interface for monitoring
- DoctrineBundle: Provides an ORM database layer
- DoctrineFixturesBundle: Provides fixtures to load data for initial installation and acceptance tests
#Documenttation
The API documentation is shown under api.your-domain.com/doc
.
#Monitoring
The monitoring is running under api.your-domain.com/monitor/
#Unit tests
Create test database:
php bin/console doctrine:database:create -e test
Run the unit tests with:
bin/phpunit
For the acceptance test you need a test database. Set test_database_name
, test_database_user
and test_database_password
in your parameters.yml
.