iccm-africa / iccm-backend

The International Conference on Computing and Mission (ICCM) Backend System
https://iccm.africa
GNU Affero General Public License v3.0
2 stars 4 forks source link

Add REST API #20

Closed phox4ever closed 10 months ago

phox4ever commented 1 year ago

This PR reverts my first PR which got merged prematurely. It adds three endpoints, one for users, groups and post registrations and a basic token based authentication. It also takes into account, that a group is created with the initial user registration. The endpoints are documented using the OpenAPI standard, and I've included a swagger based documentation page which is generated from annotations have been added (using L5 swagger).

Instructions how to generate and load the API documentation have been added to the Readme. Also, PHP-CS-Fixer has been included to help with formatting annotations also to fix files to comply with PSR-12. Only files relevant to this PR have been reformatted. Others should be done in a separate PR.

The API routes use a middleware for XSS security, which should eventually be used by other routes as well.

Please thoroughly review this PR and see if this what you had in mind when you were planning to have a REST API in the backend.