Building a custom Decidim component

A custom Decidim component or verification handler is built as a module, packaged as a gem and tied to a supported minor release. This page covers what the work includes, the decisions that shape it and what to hand over.

On this page

When a team builds a custom Decidim component

A participation program sometimes needs something Decidim's built-in components do not cover: a process type with its own proposal flow, or a census check that tests participants against a local register. In those cases the answer is a custom component or verification handler, which is a Decidim module packaged as a gem. Any such module must track the supported release lines, currently 0.32.x and 0.31.x, so the team has to plan for it to be rebuilt and retested with each minor release it intends to run. The first decision is whether your own developers will own that cycle or whether a partner will build and maintain it under a written scope.

Building in-house makes sense when the team already runs Ruby on Rails in production, can review changes to Decidim's upstream code, and has someone accountable for the module after launch. The work usually splits into scaffolding the module, defining the component's models, permissions and admin screens, writing the public views, and adding tests that run against the Decidim version in use. Confirm with your developers which Ruby and Node versions each target release requires, using the installation documentation for the release you plan to run, before estimating the build. A partner fits better when the requirement is narrow, the census or flow must be delivered on a fixed date, or the internal team cannot staff upkeep.

Whichever route you choose, price the upgrade cost as a recurring item, not a one-time build. Each minor upgrade can change the APIs the module depends on, and Decidim's update guide says to move one minor version at a time and to back up the database first, so a custom component adds testing and rework to every step. Ask any partner for a quote that covers the initial build, the test suite, the expected effort per upgrade, and who fixes the module when a security patch lands within the disclosure windows described in Decidim's security policy. Keep the gem in version control with a documented test plan so the cost of the next upgrade stays visible.

What a Decidim component module can add

Decidim ships with participatory spaces and a set of built-in components, and a custom component module plugs into that same structure. The cards below cover what the platform already provides, where a custom component fits, and how the authorization system controls who can act inside it. Confirm every specific against the Decidim version you run, because component options and permission names change between minor releases.

Participatory spaces as the container

Decidim groups activity into participatory spaces such as processes, assemblies and initiatives. A component always lives inside one of these spaces, so the first design question is which space types your new component should appear in. Check whether the space types you need are enabled in your organization and whether your component should be available in all of them or only some. Confirm the space model in the documentation for your release before you scaffold anything.

Decidim installation docs

Built-in components as the reference

Decidim includes components such as meetings, surveys, proposals, participatory budgets and accountability tracking. These are the reference implementations most teams read first when they build their own component, because they show how models, admin forms, public pages and permissions are wired together. Review the component that is closest to your use case, then check which of its behaviors you actually need to copy. Avoid copying features you do not need, since each one becomes code you must keep compatible.

Decidim source repository

Custom resources and actions

A custom component typically adds its own resource type, such as a model with fields, states and a public listing, together with the admin and public actions that manage it. This is where most of the logic sits, including validation, ordering and any link to proposals or meetings that already exist. Map each resource and action before you write code, and decide which ones need to appear in search, notifications or exports. Each added resource increases the surface you must test on every upgrade.

Permissions and authorization handlers

Decidim's authorization system lets an organization restrict actions such as voting or signing to verified participants. A component can declare which actions need a verification, and a custom authorization handler can check a participant against your own census or external source. Decide which actions in your component require verification and which stay open. Confirm the permission hooks and handler interface in the release you run, since this is the part of the API most likely to change.

Packaging as a gem

A component built as a Decidim module is packaged as a Ruby gem, which lets you version it, declare its dependency on Decidim, and install it into more than one application. The gem boundary also makes it clear which code is yours and which belongs to the core platform. Plan the gem's version constraints against the supported Decidim minor versions, and confirm the packaging layout the current module generator produces for your release.

Upgrade exposure and supported releases

Decidim supports only its last two minor versions with security updates until version 1.0, so a custom component has to follow the releases you run to stay supported. Every upgrade can change models, helpers or permission names your component depends on, and the update guide asks you to move one minor version at a time. Schedule compatibility tests for each step, and confirm which minor versions your component declares support for before you commit to a release path.

Supported lines
0.32.x and 0.31.x
Decidim update guide

Decisions that shape a custom component

A sub-folder module keeps your code inside the Decidim application repository, under a directory your team owns, so it deploys with the same image and shares the application's configuration. A standalone gem lives in its own repository, carries its own version number and release cycle, and is added to the Gemfile of each installation that uses it. The sub-folder route is quicker to start and easier to debug, while the gem route suits code you want to reuse across several Decidim sites or share with a partner.

  • Single-site work: A sub-folder module fits one organization that will not share the code, because changes stay in one repository and one deployment.
  • Reuse across installations: A gem fits when several sites need the same component, since each installation can pin one tested version.
  • Release control: A gem has its own changelog and version constraints, so you can state which Decidim minor versions it supports. A sub-folder module simply follows the state of the application repository.
  • Test isolation: A gem can run its own test suite against each Decidim release you support, which gives an early signal when an upgrade breaks it.

Confirm who will own the code after launch, how many installations will use it, and whether your legal team has reviewed the license obligations that apply to code built on Decidim, which is licensed under the AGPL-3.0.

How the module is built and released

The sequence starts by pinning the Decidim release and Ruby and Node versions, then moves through scaffolding, data and permission design, tests, packaging and a staging install. Each step leaves a artifact your team can review before the module reaches production.

  1. Confirm the target release and toolchain

    Choose the Decidim minor version the module will target before writing any code, and record the matching runtime versions. Decidim v0.32 requires Ruby 3.4.7 and Node 22.14.x, while v0.31 uses Ruby 3.3.4 and Node 22.14.x. Only the 0.32.x and 0.31.x branches receive security updates today, so a module built for an older branch starts with a support gap. The output is a short compatibility matrix that names the target release, Ruby, Node and PostgreSQL versions, and the lowest Decidim version the module will claim to support. Confirm the PostgreSQL version with your platform team, since the manual installation guide references PostgreSQL 17.4 or later.

  2. Scaffold the module from a clean install

    Generate the component skeleton with the Decidim module generator on a fresh application that matches the target release, so the file layout and base classes come from the same version your production runs. Your developer names the engine, registers the component in the module list and confirms that the generated component appears in a test space in the admin panel. Keep the scaffold in its own repository, separate from your site-specific overrides, so the module can be versioned and reviewed on its own. The step is done when the component loads in a local space without errors and the generated code passes the default linters.

  3. Define models, permissions and admin forms

    Model the resources the component manages, such as entries, votes or submissions, and write the migrations that create their tables. Define who can see, create and moderate each resource through the component permissions, and build the admin forms that let organizers configure the component per space. Where the component depends on verification or census data, decide early which authorization handler gates each action. The output is a reviewed data model, a permissions table that lists each role and action, and a migration set that runs cleanly on an empty database. Migrations are the part of the module most likely to need changes at upgrade time, so keep them small and documented.

  4. Write the public views and behavior

    Build the participant-facing pages, forms and any notifications or background jobs the component needs. Keep the views inside the module and avoid editing core templates, so that upstream changes in later releases do not silently conflict with your code. Test the behavior from a participant's point of view in a local space, including the cases where a user lacks permission. The output is a working public flow that a non-developer can walk through, along with a list of the Decidim core hooks and helpers the module depends on. That dependency list becomes the first thing to re-check at each upgrade.

  5. Write the test suite

    Add model specs, request or system specs for the main participant and admin flows, and permission specs that confirm a user without the right role cannot perform each action. Run the suite against the target release and in CI for every branch the module claims to support. Include at least one test that exercises the verification gate if the component uses one. The step is done when the suite passes on each supported release and a failing permission check reliably fails the build. Record the suite's results with the compatibility matrix, because the test run is the evidence that the claimed support range is accurate.

  6. Package the module as a gem

    Wrap the engine in a gem with a version number, a gemspec that declares its Decidim dependency range, a changelog and a license file that matches your licensing decision. Decidim is licensed under the AGPL-3.0, so confirm with your legal team how the module's license relates to it before publishing. The output is a built gem that installs into a clean Decidim application through the Gemfile, with the dependency range and the changelog reflecting the matrix from the first step. Confirm the packaging with your team's release process before anyone publishes it to a registry.

  7. Install and verify in a staging copy

    Install the packaged gem into a staging copy of your production Decidim application, not a fresh development instance, so that real configuration, custom overrides and existing data are part of the test. Run the database migrations on a restored backup, check the admin and public flows, and confirm that the component works alongside any other modules and themes you run. Record any warnings from the Rails logs. The step is done when the staging check produces a written sign-off with the release, the module version and the list of issues fixed. Only after that sign-off should the module move toward production.

  8. Write upgrade notes for each Decidim release

    Before the module ships, write notes that list the Decidim version it was tested on, the dependencies it touches and the steps needed when the platform moves to the next minor version. Decidim's update guidance asks implementers to move one minor version at a time and to follow each release's upgrade instructions, so the notes should say which upgrade steps apply to the module. Store the notes next to the gem and link them from the compatibility matrix. The output is a document that your upgrade team can use without asking the original developer, and it becomes the starting point for the next upgrade cycle.

Data setup and migration for a new component

Back up the database before you run any migration. A new component adds its own tables, and running its migrations against a live participation database is the step most likely to be hard to reverse. Take a full PostgreSQL backup, confirm you can restore it into a separate environment, and only then run the component's migrations on staging. Decidim's update guide says to back up the database first for the same reason, and the same rule applies when your module ships its own schema changes.

The component's tables are created by migrations in the module's db/migrate folder, which Rails applies with the standard rake task for the environment. Keep each schema change in its own migration file, and keep foreign keys to Decidim's existing records (such as the participatory space and the component record) explicit so that the links survive later changes. If your component must attach to proposals, meetings or users that already exist, decide whether the link is a new reference table or a column on your model, and confirm that the data it points to is migrated before yours. Any import of legacy participation data should run as a separate, repeatable task, not inside a migration, so it can be rerun against a fresh restore.

Decidim's update guide notes that some releases change database structures, so check the migrations at every minor step, not only the final target. Move one minor version at a time, read the upgrade instructions for each release, and run your module's migrations against a restored copy of production before the real upgrade. Confirm with your Decidim contact or the release notes which tables the target version touches, and record which migration version your module expects so a rollback plan is possible. Ask your implementation partner for a written migration checklist that covers backup, restore testing, ordering and the data import step.

What drives the effort and cost of a custom component

This table lists the main drivers of effort in a custom Decidim component, how each one changes the work, and how to keep it down. Read the first columns for scope decisions and the last column for the costs that repeat after launch, since upgrades and patches usually matter more over the life of the module than the initial build.

DriverWhy it changes effort or costHow to keep it downOne-time or recurring
Number of models and admin screensEach model adds migrations, forms, admin controllers, permissions and views that must be built and maintainedStart with the fewest models that meet the use case and reuse existing Decidim resources where possibleOne-time build, then recurring as each screen must follow upgrades
Depth of permissions and verification logicCustom rules for who can create, vote or act interact with Decidim's permission and authorization systems and need careful testingMap the permission rules on paper first and rely on built-in authorization handlers before writing custom onesOne-time design and tests, recurring when core permission APIs change
TranslationsEvery user-facing string needs locale entries in each supported language, and new strings must be added in every releaseLimit visible text, keep the set of supported locales small at launch and agree on a translation workflow earlyInitial translation one-time, recurring for every new or changed string
Test coverageTests for models, commands, permissions and views protect the module during upgrades but take time to write and maintainFocus tests on business rules and permissions, and use Decidim's test helpers instead of building fixtures from scratchOne-time to write, recurring to run and repair on every upgrade
Decidim minor versions to supportEach supported minor line (for example 0.31 and 0.32) can need separate code paths, dependency versions and test runsTarget only the minor versions your platform runs and plan to move forward one step at a timeRecurring, each time a new supported minor version is adopted
Security patches within grace periodsDecidim allows implementers 2 months for standard vulnerabilities and 4 months for critical ones before disclosure, so patches must be applied on a fixed clockKeep the module small, track releases and assign an owner for patch intakeRecurring, and must be planned into operations
Quality of the staging environmentWithout a staging copy that mirrors production data, shape and configuration, defects surface only after launch and upgrade testing takes longerBuild a staging environment with production-like configuration and a recent anonymized data set before the build beginsOne-time setup, recurring to keep it aligned with production
Packaging as a gemA gem needs versioned releases, a documented install path and dependency constraints that match the Decidim versions in usePackage only after the module works in a sub-folder and pin Decidim versions explicitlyOne-time packaging, recurring with each version release

How the module connects to the rest of the platform

A custom component does not run alone. It shares sign-in, verification, background jobs, file storage, email and maps with the core platform, and each of those connection points carries a different upgrade risk. Check which ones you touch through documented extension surfaces and which ones reach into internal code.

Social login providers

Decidim ships with Facebook, Twitter, Google and Decidim-to-Decidim OAuth 2.0 login, configurable globally or per organization. If your module depends on a particular sign-in path, such as restricting an action to accounts from one provider, confirm that the setting is organization-level in your install and that your component reads the user's authorization state rather than the provider name. Test both paths after each upgrade.

Social providers docs

Custom OmniAuth providers

Any other OmniAuth strategy can be added as a custom provider, which makes it the supported route for a non-standard identity source. Treat the provider's callback and user-mapping code as part of your module's maintenance surface. Document which attributes your component expects from the provider, because a change in what the provider returns will break authorization silently.

Verification and authorization handlers

Decidim's verification and authorization system lets organizations restrict actions such as voting or signing to verified participants. A custom component that gates actions should call the authorization checks the platform already provides instead of re-implementing them. Ask whether your handler's interface is documented for the release line you plan to support, and keep the census or data source logic in your own code.

ActiveJob background processing

Production installs configure ActiveJob for background work, so anything your component does after a user action, such as notifications or exports, should be queued. Confirm which queue adapter and worker process your hosting runs. Jobs that call internal model methods are more fragile across releases than jobs that call public service objects.

ActiveStorage file handling

Components that accept uploads or generate files should use ActiveStorage, which production setups configure for file storage. Confirm the storage service in your environment, including how files are backed up and how access is checked before a download is served. Avoid writing files to local disk, because container and multi-server deployments will not share them.

SMTP, maps and geocoding

Email delivery through SMTP and map or geocoding services are configured at the platform level, and a component that sends mail or places locations should use the platform's configured mailer and map settings. Ask which provider keys and sending domains your environment holds, and test notifications against a staging SMTP service before release. Calls to external map APIs from your own code add an outside dependency to your privacy review.

Questions teams ask before building a Decidim component

Can our in-house team build a custom Decidim component without a partner?

Yes, if you have engineers who know Ruby on Rails and can read a Decidim module structure, but the work is more than writing a view. A component touches the admin panel, permissions, translations, the public layout, tests and the release process, so the first build tends to be the slowest. Ask yourself whether someone on the team will own the module after launch, because that ownership is the part most often missed. A partner's written scope should state which of these parts it covers and which remain with your staff.

How long and how much effort does a custom Decidim component take?

No duration is fixed for this work, so treat any single number you hear with caution. Effort is driven mainly by the component's data model, how many admin screens and public pages it needs, how it interacts with permissions and verification, the number of locales, and how much test coverage you require. Integrations with external census or identity systems add more discovery and testing. Ask for the effort broken into design, build, tests, documentation and a post-launch support period, and ask which items are one-time and which recur with each new Decidim release.

What do we need to provide before a Decidim component build starts?

Most delays come from missing inputs rather than from code. Prepare a written description of the component's purpose, the participant roles that can use it, and the rules that decide who may act, such as a census or verification requirement. Provide representative test data, a staging environment where the module can be installed and reviewed, and a named decision-maker for terminology and design. Confirm which Decidim release you will target, since the 0.32.x and 0.31.x branches differ in their required Ruby and Node versions. Ask the provider to list these inputs in the quote.

How do we keep a custom Decidim module compatible with 0.32.x and 0.31.x?

Keep the module within Decidim's public extension points, avoid editing core files, and pin the Decidim dependency to the release line you support. Run the module's test suite against both 0.32.x and 0.31.x in continuous integration, because Decidim supports only the last two minor versions with security updates. Record the Ruby and Node versions each branch requires, and keep the module's own changelog so each release can be checked against it. Confirm with the provider how they structure the gem and which test matrix they will run.

What happens when a new Decidim minor version ships?

Decidim's update guide asks you to move one minor version at a time, such as 0.29 to 0.30 before 0.31, and to follow each release's upgrade instructions because some change database structures. Your module must be retested at every step, and any deprecated hook or changed view must be fixed before you move on. Back up the database before each upgrade. Ask the provider whether upgrade work is included in the initial scope, how many upgrade steps they expect to test, and whether ongoing upgrade support is offered as a retainer.

How do Decidim security reports and patch deadlines affect our module?

Decidim gives implementers a grace period of 2 months to apply patches for standard vulnerabilities and 4 months for critical ones before details are disclosed, according to its SECURITY.md. Your module can inherit or expose a core vulnerability, so you need a process to watch Decidim releases, apply core patches quickly, and check that your module still works after the patch. Security reports about Decidim should go to security@decidim.org or GitHub Security Advisories. Ask the provider how they monitor advisories, how fast they can ship a module update, and who signs off on security fixes.

What does the build cost us over time after launch?

Costs fall into one-time build work and recurring upkeep. The one-time part covers design, development, tests and initial deployment. The recurring part covers patching the module after each Decidim release, fixing deprecations, responding to security advisories, and keeping test environments running. Ask the quote to separate these lines, to state which Decidim versions the upkeep covers, and to describe what is excluded, such as new features requested later. Retainer options for ongoing support and continuous testing are available, and a quote should show how they would apply to this module.

How DeployOpen works on this

DeployOpen plans, builds, tests, documents and supports custom Decidim components and verification handlers inside your own infrastructure. Each engagement starts from a written scope that sets out what the module must do, which Decidim release it targets and how it will be handed over.

How we scope

  • Confirm the Decidim release line the component must run on, since only the last two minor versions receive security updates
  • Define the component's data model, permissions, admin screens and public views in a written scope before build starts
  • List which existing Decidim components, spaces or verification methods the new code must interact with or avoid changing
  • Agree which parts stay inside a sub-folder module and which need a packaged gem, with the upgrade effort each choice implies

How we build

  • Scaffold the component as a Decidim module so generators, translations and component registration follow the framework conventions
  • Keep custom logic in the module and avoid patching core views, so later minor version upgrades stay manageable
  • Write automated tests for permissions, forms, admin actions and any verification handler, run against the targeted release
  • Set Ruby and Node versions to match the chosen release line, as the installation documentation specifies for each version

How we hand over

  • Package the module as a gem with a versioned changelog, dependency constraints and installation notes for your team
  • Document the component's configuration, permissions, database migrations and any background jobs it adds
  • Walk your engineers through the upgrade checklist, including the database backup step and one-minor-version-at-a-time sequence
  • Deliver the source repository and test suite in your own version control so ownership stays with your organization

How we support

  • Track the module against each new Decidim minor release and report what changes in the framework affect your code
  • Apply fixes and retest the component after security updates to the Decidim line your platform runs
  • Offer ongoing support, upgrades and continuous testing as a retainer after the fixed-scope delivery ends
  • Ask for the retainer terms and response expectations in writing so the support boundary is clear before signing

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.