Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

REST Api for Pouce d'Or website backend (in Symfony3)

Notifications You must be signed in to change notification settings

oliviernguyenquoc/pouce_rest

Repository files navigation

"Pouce d'Or" RESTful service (Symfony)

Repository for the Symfony version of restful service for Pouce d'Or Website : www.poucedor.fr

Major bundles used

  • Symfony 3.2
  • Doctrine
  • phpUnit
  • FOSUserBundle
  • FOSOauthServerBundle
  • FOSRestBundle
  • JMSSerializerBundle
  • NelmioApiDocBundle
  • BazingaGeocoderBundle

To Do

For Version 1.0

For Version 2.0

  • Add Facebook and Google OAuth2

Issues

phpunit have issues : Fixed it by installing phpunit through composer. Have to run it : "./vendor/bin/phpunit"

Tips

Allow more memory to PHP

php -d memory_limit=-1 /usr/local/bin/composer update

How it works

All API calls are in the documentation : Api.html. Generated by NelmioApiDocBundle. Please re-generate the documentation to have an up-to-date one.

Localization

There is a city database with the most used cities (linked with a country table). Basic GET will search on that database.

If you need to add one, there is a location service which able to retrieve city information (latitude, longitude ...) by OpenStreetMap (Nominatim), Google Map ...

Service made with BazingaGeocoderBundle.

Distances

Distances are calculated with this project: https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#route-service

Teams

Only teams of 2 users. Front-end will let only 2 users from the same school to make a team but backend can handle 2 users from different school.

Tech

Documentation

Documentation is made with NelmioApiDocBundle. We use '@ApiDoc' tag before each method to specify what to put in the API genrated documentation.

Serialization and groups

We used JMSSerializerBundle for serialization with groups annotations in models. In each entity, we specify which property belongs to what to ensure the serialization process (see JMSSerializerBundle documentation).

RESTful

Made with FOSRestBundle.

Users

Made with FOSUserBundle (Identification, SignUp, LogIn).

Authentication (Security)

Made with FOSOauthServerBundle. We used OAuth2 authentication: password grant

How to use it

Setup

Get vendors via composer ("composer update"). https://getcomposer.org/download/

Run Apache and mySQL with the test database. You can use MAMP (OSX) or WAMP (Windows).

Access to API documentation

Access with the following address: localhost:8888/web/app_dev.php/api/doc

Run tests

Install phpUnit on your machine: https://phpunit.de/getting-started.html

WARNING : See Issues paragraph

Run tests with the command: phpUnit

Deploy

Run "sh deploy.sh"

The project

It's a personal project done after work hours for the Pouce d'Or contest.

License

This website have been created and is owned by Olivier NGUYEN QUOC.

**Copyright © 2014-2016 Olivier NGUYEN QUOC. All rights reserved.

No rights permission given including rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software without an authorization of the owner.**

All technologies used are under MIT license or BSD license.

A Symfony project created on September 19, 2016, 2:46 pm.

About

REST Api for Pouce d'Or website backend (in Symfony3)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages