Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/omarfawzi/restful-api-starter
Restful API Starter Project For Laravel
https://github.com/omarfawzi/restful-api-starter
api laravel openapi restful-api starter-project swagger template
Last synced: 29 days ago
JSON representation
Restful API Starter Project For Laravel
- Host: GitHub
- URL: https://github.com/omarfawzi/restful-api-starter
- Owner: omarfawzi
- License: mit
- Created: 2022-04-17T12:49:16.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-11T09:34:55.000Z (over 2 years ago)
- Last Synced: 2023-03-03T10:22:51.620Z (almost 2 years ago)
- Topics: api, laravel, openapi, restful-api, starter-project, swagger, template
- Language: PHP
- Homepage:
- Size: 13.3 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Testing](https://github.com/omarfawzi/Restful-API-Starter/actions/workflows/main.yml/badge.svg)](https://github.com/omarfawzi/Restful-API-Starter/actions/workflows/main.yml)
# Restful API Starter
**Avoid** request schema code validation, starter which is integrated with the agnostic open api schema + validation in order to provide the best restful design for your API services, care about your business logic validation, implementation and leave the starter to take care of the rest.
### Request Life Cycle
![Chart.drawio.png](https://github.com/omarfawzi/Restful-API-Starter/blob/main/Chart.png)
### Requirements
- PHP >= 8.0
- MYSQL 8
- Laravel 9### Powered By
- Open API (3.0.2)
- [OpenAPI PSR-7 Message (HTTP Request/Response) Validator](https://github.com/thephpleague/openapi-psr7-validator)### Specifications
Added under `storage/app/schema` ([Live](https://omarfawzi.github.io/Restful-API-Starter/)).
### Routes
Routes are imported from the open api specifications to provide a more generic way for configuring routes,
this also means that accessing any routes not specified in the open api specifications would return an error.For more info check `App\Providers\RouteServiceProvider::configureRoutes`
### Security
Security is done based on the specification as well and handled by the `App\Modules\OpenApi\Services\AuthenticationManager`
### Get Ready
- `make rebuild` to rebuild and start services.
- Install [npm](https://nodejs.org/en/download) for local development.
- Add your open api specifications (under `storage/app/schema`) and **don't** forget to define an `operationId` for your new operation.
- Add the new `operationId` and the corresponding `RequestHandler` to the `ApiHandler::MAP` (located at `app/Modules/Api/ApiHandler.php`).
- `make bundle` to combine and validate your specs.
- `make swagger-ui` to host your open api specs locally [localhost](http://localhost:8081).
- `make test` to start running tests.Have a look over [Makefile](https://github.com/omarfawzi/Restful-API-Starter/blob/main/Makefile) for more options.
### Contributions
Feel free to create Pull Requests.