Skip to content

Refactor structure and implement background tasks

HacKan requested to merge feature/bg_tasks into develop

Change the application flow: users create a new registration request, optionally sending an email for notifications; then managers approve or reject and if approved the user sends the wanted Matrix account username, thus the account is created (with a randomly generated password). Since the user has not sent username nor password, encryption is not needed because no data is stored.

Only users can now delete their registration request.

Move the FastAPI application to backend subdirectory (frontend will come soon). Split FastAPI application definition into files inside an app module, create a configuration module, add auto discovery of API routes (no need to manually add them to the app). Implement settings check to verify that all required settings are set. Properly document settings in its file and in a sample environment file for Docker. The CRUD was greatly improved by efficiently handle objects and being more flexible. The API authentication was custom and is now implemented with BasicAuth. Create a new development mode and a fake Matrix API that makes it easy for the developers to try the app and add new features. The code quality and performance was greatly improved.

Email notifications and Matrix account registration are implemented as background tasks which provides immediate response w/o bottlenecks.

Create a neat Dockerfile with stages to achieve the smallest image size w/o loosing security nor reproducibility of the builds.

Add an invoke tasks file with several convenient task such as easily start and run the app, spawning a redis and a smtp server and so on.

Create a deploy subdirectory with the required files.

Split the readme between one with information for the backend and other with general information and deploy instructions.

Merge request reports