We control the Decidim instance through our Strapi backend. To establish a connection between the backend and Decidim, we incorporate functionality (a Ruby gem) into the Decidim codebase, exposing a private API within a private network. This technique enables us to expose an internal API for Decidim, accessible exclusively by our Strapi backend.
From voca
, we need to execute remote procedures, which are sometimes system calls like bundle exec rails assets:precompile
. To securely run these procedures, we have decided to expose another internal API through a private channel.
This channel is always between the voca
backend and the specific decidim
instance.
gRPC technology has some advantages that are significant for us:
decidim
versions more reliably.voca
wants to use other tools alongside decidim
, this is an added benefit as it eliminates the need to rely on programming languages. For example, we could use Java to create an RPC gateway to Metabase, and the strapi
backend would handle connections in the same way.We use several prototypes for decidim
, which will be managed by our voca
gem.
// region/Settings
rpc GetSettings(google.protobuf.Empty) returns (GetSettingsResponse) { }
rpc SetSettings(SetSettingsRequest) returns (google.protobuf.Empty) { }
// region/Seed
rpc CompileAssets(google.protobuf.Empty) returns (google.protobuf.Empty) {}
rpc SetupDb(google.protobuf.Empty) returns (google.protobuf.Empty) {}
rpc SeedAdmin(SeedAdminRequest) returns (SeedAdminResponse) {}
db:migrate
./system
administrator.On every Decidim environment we create on Jelastic, we add a Docker container that will run a gRPC server. This gRPC server (powered by gruf) has the Rails and Decidim context and will be able to look directly at the data models and Decidim code actions. Being on a separate container allows us to have a private gRPC server (mounted on a private network).