You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 29, 2021. It is now read-only.
2. Run `composer install` to install all dependencies (add `--no-dev` if you're using this in production).
17
17
3. Run `cp .env.example .env` to create an `.env` file based on the distributed `.env.example` file.
18
18
4. Update the `.env` file with a new `APP_KEY` and the connection details for the database.
19
19
5. Run `php artisan migrate` to create the database schema.
20
20
21
-
## Testing
21
+
**Deployment**
22
22
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.
24
24
25
-
```bash
26
-
vendor/bin/phpunit
27
-
```
25
+
## Documentation
28
26
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.
30
28
31
-
**We aim to keep the master branch always deployable.** Exceptions may happen, but they should be extremely rare.
29
+
### Authentication
32
30
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.
34
50
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.
36
54
37
55
## Changelog
38
56
@@ -42,6 +60,18 @@ Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed re
42
60
43
61
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
44
62
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.
0 commit comments