Skip to content

API REST skeleton with Symfony 5, following best practices and implementing clean architecture.

License

Notifications You must be signed in to change notification settings

demartis/symfony5-rest-api

Repository files navigation

Symfony 5 REST API skeleton

Symfony 5 + FOSRestBundle + JSON Standard responses + working example

Travis (.org) GitHub last commit GitHub repo size in bytes GitHub language count GitHub top language PHP from Travis config GitHub FOSSA Status

Table of Contents

About

Symfony 5 skeleton to build REST APIs, inclusive of:

  • FOSRestBundle (friendsofsymfony/rest-bundle) to simplify the entire process
  • Hateoas Bundle (willdurand/hateoas-bundle) that specifies relation types for Web links
  • Doctrine

This project is compliant with:

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

What things you need to install the software and how to install them.

Installing

git clone https://github.com/demartis/symfony5-rest-api/
cd symfony5-rest-api
cp .env.dist .env
## edit .env if needed
composer install
symfony server:start

Running the example

Install database

php bin/console doctrine:database:create
php bin/console doctrine:migrations:migrate

Get with Curl

curl -H 'content-type: application/json' -v -X GET http://127.0.0.1:8000/v1/books
curl -H 'content-type: application/json' -v -X GET http://127.0.0.1:8000/v1/books/2 

Using it as skeleton

Add notes about how to use the system.

Contributing

  1. Fork it (https://github.com/demartis/symfony5-rest-api/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

License

FOSSA Status

About

API REST skeleton with Symfony 5, following best practices and implementing clean architecture.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •