Initial POC for split user interface and new API #814
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a first POC for a new split UI and backend API. We would like to use this PR to discuss if and which aspects would be good to keep and expand on, and what should be changed and improved. For this proposal we made use of Luracast Restler (https://restler5.luracast.com/) for the backend, and Angular (https://angular.io/) for the frontend.
The focus of the implementation is on the backend side. So the most important thing to review is everything under
src/api/v2. The existing frontend and user/client APIs remain unchanged. We have added some basic API calls for hashlists, tasks and some other small things. Most of these are protected and require an API key to be passed. We also added DTO's for the communication, which are also validated up front by the framework we use. For testing, we made use of Behat, for which we added a couple of sample test cases. We also enabled Swagger documentation generation, which can also be used to manually test the API.The UI code is an extremely simple POC, just to show the idea. With it, you can create hashlists and view/update tasks.
If you want to test this, you could check out this branch and run it inside the devcontainer. If all goes well, you should be able to:
:8080/api/v2/*:8080/api/v2/explorer(pass a generated access key in the upper right):4200(requires setting the access key inconfiguration.ts)../../vendor/bin/behatinside directory/var/www/html/ci/apiv2in the Hashtopolis containerNote that there are still both implementation (e.g. clean setup code of tests, move Factory calls to Utils/Service, clean file importing), as wel as technical issues (e.g. caching in production mode, Swagger doc generation is iffy) to resolve. And perhaps other bugs (we would expand the tests and review everything in depth when we'd have an idea of way forward regarding implementation).
We are looking forward to your thoughts.