Skip to content

Commit 5095ff9

Browse files
authored
Merge pull request #247 from dotkernel/docs-updates
Documentation updates
2 parents 04588bb + 41a8b7d commit 5095ff9

File tree

5 files changed

+51
-48
lines changed

5 files changed

+51
-48
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Based on Enrico Zimuel's [Zend Expressive API - Skeleton example](https://github
1111
[![GitHub license](https://img.shields.io/github/license/dotkernel/api)](https://github.com/dotkernel/api/blob/4.0/LICENSE.md)
1212

1313
[![Build Static](https://github.com/dotkernel/api/actions/workflows/continuous-integration.yml/badge.svg?branch=4.0)](https://github.com/dotkernel/api/actions/workflows/continuous-integration.yml)
14-
[![Build Static](https://github.com/dotkernel/api/actions/workflows/run-tests.yml/badge.svg?branch=4.0)](https://github.com/dotkernel/api/actions/workflows/run-tests.yml)
1514
[![codecov](https://codecov.io/gh/dotkernel/api/graph/badge.svg?token=53FN78G5CK)](https://codecov.io/gh/dotkernel/api)
1615
[![Qodana](https://github.com/dotkernel/api/actions/workflows/qodana_code_quality.yml/badge.svg)](https://github.com/dotkernel/api/actions/workflows/qodana_code_quality.yml)
1716

docs/book/v4/introduction/installation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Sending a GET request to the [home page](http://0.0.0.0:8080/) should output the
9090
9191
## Running tests
9292

93-
The project has 2 types of tests : functional and unit tests, you can run both types at the same type by executing this command:
93+
The project has 2 types of tests: functional and unit tests, you can run both types at the same type by executing this command:
9494

9595
```shell
9696
php vendor/bin/phpunit

docs/book/v4/introduction/introduction.md

+18-19
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,27 @@ Here is a list of the core components:
66

77
* Middleware Microframework (mezzio/mezzio)
88
* Error Handler (dotkernel/dot-errorhandler)
9-
* Problem Details (mezzio-problem-details)
10-
* CORS (mezzio-cors)
9+
* Problem Details (mezzio/mezzio-problem-details)
10+
* CORS (mezzio/mezzio-cors)
1111
* Routing (mezzio/mezzio-fastroute)
12-
* Authentication (mezzio-authentication)
13-
* Authorization (mezzio-authorization)
12+
* Authentication (mezzio/mezzio-authentication)
13+
* Authorization (mezzio/mezzio-authorization)
1414
* Config Aggregator (laminas/laminas-config-aggregator)
1515
* Container (roave/psr-container-doctrine)
16-
* Implicit Head, Options and Method Not Allowed
1716
* Annotations (dotkernel/dot-annotated-services)
1817
* Input Filter (laminas/laminas-inputfilter)
19-
* Doctrine
20-
* Hydrator (laminas/laminas-hydrator)
18+
* Doctrine 2 ORM (doctrine/orm)
19+
* Serializer/Deserializer (laminas/laminas-hydrator)
2120
* Paginator (laminas/laminas-paginator)
22-
* HAL (mezzio-hal)
21+
* HAL (mezzio/mezzio-hal)
2322
* CLI (dotkernel/dot-cli)
2423
* TwigRenderer (mezzio/mezzio-twigrenderer)
2524
* Fixtures (dotkernel/dot-data-fixtures)
2625
* UUID (ramsey/uuid-doctrine)
2726

2827
## Doctrine 2 ORM
2928

30-
For the persistence in a relational database management system we chose Doctrine ORM (object-relational mapper) .
29+
For the persistence in a relational database management system we chose Doctrine ORM (object-relational mapper).
3130

3231
The benefit of Doctrine for the programmer is the ability to focus on the object-oriented business logic and worry about persistence only as a secondary priority.
3332

@@ -40,15 +39,15 @@ Our documentation is Postman based. We use the following files in which we store
4039

4140
## Hypertext Application Language
4241

43-
For our API payloads ( a value object for describing the API resource, its relational links and any embedded/child resources related to it ) we chose mezzio-hal.
42+
For our API payloads (a value object for describing the API resource, its relational links and any embedded/child resources related to it) we chose mezzio-hal.
4443

4544
## CORS
4645

4746
By using `MezzioCorsMiddlewareCorsMiddleware`, the CORS preflight will be recognized and the middleware will start to detect the proper CORS configuration. The Router is used to detect every allowed request method by executing a route match with all possible request methods. Therefore, for every preflight request, there is at least one Router request.
4847

49-
## OAuth 2
48+
## OAuth 2.0
5049

51-
OAuth 2 is an authorization framework that enables applications to obtain limited access to user accounts on your DotKernel API. We are using mezzio/mezzio-authentication-oauth2 which provides OAuth2 authentication for Mezzio and PSR-7/PSR-15 applications by using league/oauth2-server package.
50+
OAuth 2.0 is an authorization framework that enables applications to obtain limited access to user accounts on your DotKernel API. We are using mezzio/mezzio-authentication-oauth2 which provides OAuth 2.0 authentication for Mezzio and PSR-7/PSR-15 applications by using league/oauth2-server package.
5251

5352
## Email
5453

@@ -66,7 +65,7 @@ You can further customize your api within the autoload directory where each conf
6665

6766
## Routing
6867

69-
Each Module has a `RoutesDelegator.php` file for managing existing routes inside that specific module. It also allows a quick way of adding new routes by providing the route path, Middlewares that the route will use and the route name.
68+
Each module has a `RoutesDelegator.php` file for managing existing routes inside that specific module. It also allows a quick way of adding new routes by providing the route path, Middlewares that the route will use and the route name.
7069

7170
You can allocate permissions per route name in order to restrict access for a user role to a specific route in `config/autoload/authorization.global.php`.
7271

@@ -76,17 +75,17 @@ For registering new commands first make sure your command class extends `Symfony
7675

7776
## File locker
7877

79-
Here you will also find our brand-new file locker configuration, so you can easily turn it on or off ( by default: `'enabled' => true` )
78+
Here you will also find our brand-new file locker configuration, so you can easily turn it on or off (by default: `'enabled' => true`).
8079

8180
Note: The File Locker System will create a `command-{command-default-name}.lock` file which will not let another instance of the same command to run until the previous one has finished.
8281

8382
## PSR Standards
8483

85-
* PSR-3: Logger Interface – the application uses `LoggerInterface` for error logging
86-
* PSR-4: Autoloader – the application locates classes using an autoloader
87-
* PSR-7: HTTP message interfaces – the handlers return `ResponseInterface`
88-
* PSR-11: Container interface – the application is container-based
89-
* PSR-15: HTTP Server Request Handlers – the handlers implement `RequestHandlerInterface`
84+
* [PSR-3](https://www.php-fig.org/psr/psr-3/): Logger Interface – the application uses `LoggerInterface` for error logging
85+
* [PSR-4](https://www.php-fig.org/psr/psr-4): Autoloader – the application locates classes using an autoloader
86+
* [PSR-7](https://www.php-fig.org/psr/psr-7): HTTP message interfaces – the handlers return `ResponseInterface`
87+
* [PSR-11](https://www.php-fig.org/psr/psr-11): Container interface – the application is container-based
88+
* [PSR-15](https://www.php-fig.org/psr/psr-15): HTTP Server Request Handlers – the handlers implement `RequestHandlerInterface`
9089

9190
## Tests
9291

docs/book/v4/tutorials/create-book-module.md

+30-25
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@ The below file structure is just an example, you can have multiple components su
77
```markdown
88
.
99
└── src/
10-
└── Book/
11-
└── src/
12-
├── Collection/
13-
│ └── BookCollection.php
14-
├── Entity/
15-
│ └── Book.php
16-
├── Handler/
17-
│ └── BookHandler.php
18-
├── InputFilter/
19-
│ ├── Input/
20-
│ │ ├── AuthorInput.php
21-
│ │ ├── NameInput.php
22-
│ │ └── ReleaseDateInput.php
23-
│ └── BookInputFilter.php
24-
├── Repository/
25-
│ └── BookRepository.php
26-
├── Service/
27-
│ ├── BookService.php
28-
│ └── BookServiceInterface.php
29-
├── ConfigProvider.php
30-
└── RoutesDelegator.php
10+
└── Book/
11+
└── src/
12+
├── Collection/
13+
│ └── BookCollection.php
14+
├── Entity/
15+
│ └── Book.php
16+
├── Handler/
17+
│ └── BookHandler.php
18+
├── InputFilter/
19+
│ ├── Input/
20+
│ │ ├── AuthorInput.php
21+
│ │ ├── NameInput.php
22+
│ │ └── ReleaseDateInput.php
23+
│ └── BookInputFilter.php
24+
├── Repository/
25+
│ └── BookRepository.php
26+
├── Service/
27+
│ ├── BookService.php
28+
│ └── BookServiceInterface.php
29+
├── ConfigProvider.php
30+
└── RoutesDelegator.php
3131
```
3232

3333
* `src/Book/src/Collection/BookCollection.php` - a collection refers to a container for a group of related objects, typically used to manage sets of related entities fetched from a database
@@ -532,9 +532,14 @@ class BookHandler implements RequestHandlerInterface
532532

533533
Once you set up all the files as in the example above, you will need to do a few additional configurations:
534534

535-
* Register the namespace by adding this line `"Api\\Book\\": "src/Book/src/",` in `composer.json` under the `autoload.psr-4` key.
536-
* Register the module by adding `Api\Book\ConfigProvider::class,` under `Api\User\ConfigProvider::class,`.
537-
* Register the module's routes by adding `\Api\Book\RoutesDelegator::class,` under `\Api\User\RoutesDelegator::class,` in `src/App/src/ConfigProvider.php`.
535+
* register the namespace by adding this line `"Api\\Book\\": "src/Book/src/",` in `composer.json` under the `autoload.psr-4` key
536+
* register the module by adding `Api\Book\ConfigProvider::class,` under `Api\User\ConfigProvider::class,`
537+
* register the module's routes by adding `\Api\Book\RoutesDelegator::class,` under `\Api\User\RoutesDelegator::class,` in `src/App/src/ConfigProvider.php`
538+
* update Composer autoloader by running the command:
539+
540+
```shell
541+
composer dump-autoload
542+
```
538543

539544
It should look like this:
540545

@@ -641,7 +646,7 @@ curl -X POST http://0.0.0.0:8080/book
641646
-d '{"name": "test", "author": "author name", "releaseDate": "2023-03-03"}'
642647
```
643648

644-
To list the books use :
649+
To list the books use:
645650

646651
```shell
647652
curl http://0.0.0.0:8080/books

mkdocs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
docs_dir: docs/book
22
site_dir: docs/html
33
extra:
4-
project: "DotKernel API"
4+
project: API
55
current_version: v4
66
versions:
77
- v4
@@ -18,7 +18,7 @@ nav:
1818
- Tutorials:
1919
- "Creating a book module": v4/tutorials/create-book-module.md
2020
site_name: api
21-
site_description: "DotKernel API"
21+
site_description: DotKernel API
2222
repo_url: "https://github.com/dotkernel/api"
2323
plugins:
2424
- search

0 commit comments

Comments
 (0)