Skip to content
This repository was archived by the owner on Jun 29, 2021. It is now read-only.

Commit 30f7fa2

Browse files
author
José Postiga
committed
refactor(): remove docs folder and update readme file
1 parent 2eac5d5 commit 30f7fa2

File tree

4 files changed

+41
-578
lines changed

4 files changed

+41
-578
lines changed

README.md

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Laravel-Portugal API
1+
# Laravel-Portugal API
22

33
![Run tests](https://github.com/laravel-portugal/api/workflows/Run%20tests/badge.svg)
44
[![Coverage Status](https://coveralls.io/repos/github/laravel-portugal/api/badge.svg?branch=master)](https://coveralls.io/github/laravel-portugal/api?branch=master)
@@ -10,29 +10,47 @@
1010
- PHP >= 7.4
1111
- MySQL >= 8, MariaDB >= 10 or PostgreSQL >= 11
1212

13-
**Steps to activate this project**
13+
**Activation**
1414

1515
1. Clone this repository.
1616
2. Run `composer install` to install all dependencies (add `--no-dev` if you're using this in production).
1717
3. Run `cp .env.example .env` to create an `.env` file based on the distributed `.env.example` file.
1818
4. Update the `.env` file with a new `APP_KEY` and the connection details for the database.
1919
5. Run `php artisan migrate` to create the database schema.
2020

21-
## Testing
21+
**Deployment**
2222

23-
This project is fully tested. We have an [automatic pipeline](https://github.com/laravel-portugal/api/actions) and an [automatic code quality analysis](https://coveralls.io/github/laravel-portugal/api) tool set up to continuously test and assert the quality of all code published in this repository, but you can execute the test suite yourself by running the following command:
23+
This project is prepared to be run with Docker. There are docker-compose files that try to provide an easy way to deploy this project to your infrastructure. You should create a `docker-compose.override.yml` (probably based on the example file provided), and change it to your specific needs.
2424

25-
``` bash
26-
vendor/bin/phpunit
27-
```
25+
## Documentation
2826

29-
_Note: This assumes you've run `composer install` (without the `--no-dev` option)._
27+
This service API is organized around REST and has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
3028

31-
**We aim to keep the master branch always deployable.** Exceptions may happen, but they should be extremely rare.
29+
### Authentication
3230

33-
## Documentation
31+
Authentication to the API is performed via checking for the presence of a Bearer token on the Authorization header of a request. This token is an encoded JWT that's generated by exchanging the username and the password, of a previously registered user account, on the `/login` endpoint.
32+
33+
### Include relationship data
34+
35+
Many objects allow you to request additional relationship information as an expanded response, by using the `include` request parameter. This parameter is available on all API requests that have related data available to be included and applies to the response of that request only. You can, however, include multiple objects at once by identifying multiple items in the `include` query parameter separated by a comma.
36+
37+
### Errors
38+
39+
This API uses conventional HTTP response codes to indicate the success or failure of a request. Codes in the `2xx` range indicate success, codes in the `4xx` range indicate a validation error (e.g., a required parameter was omitted) and codes in the `5xx` range indicate an error with the service internal programming (these should be very rare). Check the table below for a list of possible status codes and their meaning:
40+
41+
Code | Status | Description
42+
---- | ------ | -----------
43+
200 | OK | Everything worked as expected.
44+
401 | Unauthorized | No valid authorization header value provided.
45+
403 | Forbidden | The supplied authorization key doesn't have permission to perform the request.
46+
404 | Not Found | The requested resource doesn't exist.
47+
422 | Unprocessable Entity | The request was unacceptable, often due to missing a required parameter.
48+
429 | Too Many Requests | Too many requests hit the API too quickly.
49+
5xx | Server Errors | Something went wrong on the internal service programming.
3450

35-
Please see the [public documentation site](https://laravel-portugal.stoplight.io/docs/api/docs/1.Introduction.md).
51+
## Support
52+
53+
If you have any problems and need assistance, feel free to use the issue tracker to ask for support. However, be patient! Your request might take time to be answered.
3654

3755
## Changelog
3856

@@ -42,6 +60,18 @@ Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed re
4260

4361
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
4462

63+
## Testing
64+
65+
This project is fully tested. We have an [automatic pipeline](https://github.com/laravel-portugal/api/actions) and an [automatic code quality analysis](https://coveralls.io/github/laravel-portugal/api) tool set up to continuously test and assert the quality of all code published in this repository, but you can execute the test suite yourself by running the following command:
66+
67+
``` bash
68+
vendor/bin/phpunit
69+
```
70+
71+
_Note: This assumes you've run `composer install` (without the `--no-dev` option)._
72+
73+
**We aim to keep the master branch always deployable.** Exceptions may happen, but they should be extremely rare.
74+
4575
## Security
4676

4777
Please see [SECURITY](SECURITY.md) for details.

docs/1.Introduction.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/2.Errors.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)