Skip to content

prakashpie/app

 
 

Repository files navigation

License

Summary

Limoncello App is a quick start application for Limoncello PHP framework.

The demo application is a simple message board which implements

  • JSON API CRUD operations (create, read, update and delete) for a few sample resources with to-one, to-many and many-to-many relationship types.
  • Support for such JSON API features as resource inclusion, sparse field sets, sorting, filtering and pagination.
  • Database migrations and seedings.
  • OAuth 2.0 server authentication and role authorization.
  • Cross-Origin Resource Sharing (CORS).
  • JSON API errors.
  • API tests.

Supported features

  • Multiple nested paths resource inclusion (e.g. posts,posts.user,posts.comments.user).
  • Sorting by multiple attributes.
  • Filters could be applied to attributes and primaries in relationships (all major relationship types such as belongsTo, hasMany and belongsToMany). Supported operators =, eq, equals, !=, neq, not-equals, <, lt, less-than, <=, lte, less-or-equals, >, gt, greater-than, >=, gte, greater-or-equals, like, not-like, in, not-in, is-null, not-null.
  • Pagination works for main resources and resources in relationships. Limits for maximum number of resources are configurable.

Server API documentation is here.

Based on

It could be a great start if you are planning to develop JSON API.

Installation

1 Create project

$ composer create-project --prefer-dist limoncello-php/app app_name && cd app_name

2 Run server

Application runs PHP built-in server on port 8080

$ composer serve

Port could be configured in composer.json

The easiest way to play with the server is Postman.

Run in Postman

API documentation and code snippets here.

Requests in Postman

3 Turn on production mode (optional)

By default the application is installed in development mode (less performance, tests and development libraries are available). Application could be switched into production mode (higher performance, no tests, no development libraries) with command

$ composer build

Testing

$ composer test

License

MIT license

About

Quick start JSON API application

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 98.7%
  • Other 1.3%