Replies: 4 comments 3 replies
-
We are going to do:
Will explore other generalizations later. |
Beta Was this translation helpful? Give feedback.
-
@amirozer @idoivri I think what we have written above from Oct is still totally valid as a high-level approach - it keeps all image handling quite distinct from the core of Gov Flow (it could be implemented as a completely separate micro service, but I suggest not at this stage, explained below), supports the storage of images as public or private (but we should do so 100% private for now), and works well as a general pattern over various cloud provider object storage solutions (or, just a file system). So, a bit more technical detail:
This requires the following on the server:
If we need to use Azure Blob Storage (which is not S3 compatible), we can run a minio service (here is a link to some internal notes I made about that). The great thing about using S3 API is that we are basically using a standard approach and don't need to make the open source codebase support multiple object storages, and, people can always use Minio to get the API, which is a well adopted approach. We can write the file handling ourselves using the File API or use a full-featured existing lib like Filepond for the management and manipulation of the files themselves. Here is a simple article I just dug up that gives an overview of this type of approach: https://blog.rocketinsights.com/uploading-images-to-s3-via-the-browser/ A benefit of this approach is that it can quite easily be abstracted to a microservice that you can use at Zen City generally. |
Beta Was this translation helpful? Give feedback.
-
We have an implementation in #45 which provides all the server support required, and we have two currently closed source code bases that implement the frontend handling of this, for (i) public form submissions and (ii) viewing public form submissions in the admin UI. We recently had a request to implement image support for comments on service requests - essentially for internal use as assignees within a given government department work on resolving requests. The following changes need to be done to support the expanded functionality:
The following change is highly recommended: We have two react components - one for putting an image and one for getting an image, abstracting away the handling of the signing of requests with the object storage. Until now, the public form uses the put component and the admin uses the get component, but now the admin also needs to use the put component, so I suggest we pull these components into a library for use in both admin and public form codebases. |
Beta Was this translation helpful? Give feedback.
-
This is now implemented. |
Beta Was this translation helpful? Give feedback.
-
People who submit service requests also need to optionally be able to submit images, to show the thing they are requesting to be addressed.
There are many ways to provide image support in the application: different ways to use cloud object storage, or upload to a filesystem, etc.
An ideal solution probably looks something like:
This pattern, or a variation of it, is pretty straight forward for file system storage, or AWS S3, and also I think minIO. Need to check if this pattern translates to Azure Blob Storage as we do want to support that (but we can also assume a minIO gateway over Azure Blob Storage as an option).
After some discussion with @amirozer it looks like the simplest, first solution will be:
This solution works probably works in the short term as the current client runs in a privileged environment with access to non-public image upload APIs.
Beta Was this translation helpful? Give feedback.
All reactions