How opensourcepolitics/decidim-app works
This project is a full‐stack, modular Ruby on Rails application built on top of Decidim – a platform for citizen participation. In our case, the “Decidim app by OSP” bundles the core Decidim functionalities (like proposal submissions, citizen initiatives, conferences, etc.) and integrates many additional modules (both official and custom extensions) that extend or override default behaviors. The purpose here is to support a scalable, secure, and extensible digital platform for participatory democracy.
And list the main components
• Application Core: The primary Ruby on Rails application including the “app” directory (controllers, models, views, channels, mailers, jobs, etc.).
• Modules/Extensions: Decidim core modules (decidim-core, decidim-conferences, decidim-initiatives, decidim-templates, etc.) as well as community modules (e.g., module for friendly signup, phone authorization, custom proposal states, etc.). Also note the “lib/decidim” and “lib/extends” directories which contain custom overrides and integration logic.
• Database: The relational database backing the application (with many migrations in the “db/migrate” directory).
• Background Job Processor: Components like Sidekiq (configured in initializers and jobs) that handle asynchronous processing.
• Frontend Assets & Webpack: The “packages”, “public”, and asset management configuration – representing the client-side code running in the browser.
• Deployment & Infrastructure: Dockerfiles, docker-compose files, deploy configuration (Terraform files in deploy/providers) and Kubernetes (evident from the “lib/decidim_app/k8s” directory) illustrate containerization and orchestration.
• External Services/Integrations: External authentication via OmniAuth (with providers such as cultuur_connect, france_connect, etc.), caching, and other integrations like spam detection and phone verification.
Establish Relationships and Interactions
• User Interaction Layer: Start with the user client (browser or mobile) interacting via a web interface. This flows through load balancers (if depicted) into the application servers.
• Rails Controllers and REST/API Endpoints: Illustrate how UI requests hit controllers, which interact with models (business logic) and perform validations according to the Decidim architecture.
• Deployment & DevOps: Create a “Deployment” layer showing Docker containers, orchestration via Kubernetes, CI/CD pipelines (as evidenced by .github/workflows and Makefile), and infrastructure management (Terraform files under deploy/providers).
Architectural Patterns and Design Principles
• Modular Architecture: Very strong emphasis on separation of concerns and modularity. Each Decidim module (or extension thereof) is encapsulated, demonstrating plug-in architecture.
• MVC Pattern: The typical Rails MVC structure is present, so clearly label controllers, models, and views.
• Micro-modules / Overloads: The “lib/extends” and “app/overrides” directories represent how the system is made extensible through overloads and customizations.
• Containerization & Deployment Automation: Docker containers and Kubernetes orchestration should be detailed to show the deployment workflow.
• Integration with external services and APIs: Represent integrations (e.g. OmniAuth, SMS gateways, caching or external translation services).
Technologies, Frameworks, and Libraries
• Ruby on Rails (MVC framework)
• Sidekiq (background job processing)
• PostgreSQL (or similar relational DB)
• Webpack (asset bundling and management)
• Docker and docker-compose (containerization)
• Kubernetes toolchain (via commands in lib/decidim_app/k8s)
• CI/CD tools (GitHub Actions workflows, Makefile)
• OmniAuth for authentication