Plataforma soberana de democracia participativa (PINDORAMA) — participação sem consequência é teatro. Rust + ActivityPub + 70k mandatos reais. https://democracia.social.br
  • Rust 62.1%
  • Svelte 20.1%
  • PLpgSQL 6.9%
  • TypeScript 4.9%
  • Astro 3.8%
  • Other 2.2%
Find a file
Marcos 9b6c35448f
Some checks failed
ci / fmt (push) Failing after 6s
ci / clippy (push) Failing after 2m36s
ci / boundaries (push) Failing after 6s
ci / test (push) Failing after 5s
ci / coverage (push) Failing after 5s
security / deny (push) Successful in 7s
security / audit (push) Successful in 9s
security / secrets (push) Successful in 8s
fix(civic): artefatos por-PID no tempdir (evita colisao de dono em /tmp entre usuarios postgres/popsolutions)
2026-07-27 19:58:29 -03:00
.config ops(smtp): document sovereign relay (mail.autonomia.lat) + fix SMTP_URL → SMTP_HOST/… drift 2026-07-06 04:30:15 +00:00
.forgejo/workflows test(coverage) batch 3: admin surface — 51.2% → 54.2%, ratchet 50 → 53 2026-07-11 02:02:14 +00:00
.sqlx feat(cadastro): domicilio obrigatorio (UF + municipio IBGE) no cadastro do cidadao 2026-07-27 15:52:22 +00:00
brand feat(auth+federation): sovereign CPF+e-mail/senha auth (ADR-0008) and the ActivityPub federation foundation 2026-06-25 22:18:49 -03:00
crates feat(campaign): #69b broadcast SMS consentido por diretorio (SMSGateway proprio, 1/semana) 2026-07-27 18:40:41 -03:00
deploy ops(0.42.0-backup): backup diario cifrado do banco (systemd timer) 2026-07-24 18:28:38 +00:00
docs docs(adr): #72 status entregue (SAPL provado) + ADR-0018 atividade legislativa/destilacao (#73) 2026-07-27 19:06:42 -03:00
migrations feat(civic): #73 extracao de atividade legislativa SAPL (proposicoes/atas/votacoes) — fundacao ADR-0018 2026-07-27 19:47:56 -03:00
scripts fix(civic): artefatos por-PID no tempdir (evita colisao de dono em /tmp entre usuarios postgres/popsolutions) 2026-07-27 19:58:29 -03:00
tests/e2e feat(consequence): SLA por gabinete — a cobrança vale pra todos os destinatários (0538) 2026-07-25 18:28:49 +00:00
web feat(campaign): #69b broadcast SMS consentido por diretorio (SMSGateway proprio, 1/semana) 2026-07-27 18:40:41 -03:00
.editorconfig chore: bootstrap sovereign participatory democracy platform (PINDORAMA) 2026-06-25 17:19:50 -03:00
.gitignore feat(civic): #72 pipeline de extracao de contatos SAPL por plataforma (ADR-0017) 2026-07-27 19:04:44 -03:00
Cargo.lock fix(federation): teto de 10 menções resolvidas por post — WebFinger no handler custa até 2 fetches × 10s cada 2026-07-26 03:48:42 +00:00
Cargo.toml feat(0.33.0-og-cards): o placar circula como imagem — OG card PNG por mandato 2026-07-23 05:09:21 +00:00
CHANGELOG.md feat(foruns): voto a favor/contra/ponderacao nos ARGUMENTOS (estilo StackOverflow) 2026-07-26 03:09:52 +00:00
clippy.toml chore: bootstrap sovereign participatory democracy platform (PINDORAMA) 2026-06-25 17:19:50 -03:00
CONTRIBUTING.md feat(thesis): Wave 2 — the complete consequence loop (mandates, proposals, votes, comments, consequence, scorecard) 2026-06-25 20:12:35 -03:00
deny.toml feat(federation): ator de instância + fetch assinado — busca federada em instâncias AUTHORIZED_FETCH (0539) 2026-07-25 20:32:34 +00:00
LICENSE chore: bootstrap sovereign participatory democracy platform (PINDORAMA) 2026-06-25 17:19:50 -03:00
LICENSE-SOCIAL-CONTRACT.md chore: bootstrap sovereign participatory democracy platform (PINDORAMA) 2026-06-25 17:19:50 -03:00
PLAN.md docs(adr): ADR-0010 — civic-social platform; PLAN.md §3 scoped reversal 2026-06-26 13:23:16 +00:00
README.md docs: modern README + annotated project structure + strategy plan + wiki refresh 2026-07-09 22:42:36 -03:00
rust-toolchain.toml chore: bootstrap sovereign participatory democracy platform (PINDORAMA) 2026-06-25 17:19:50 -03:00
rustfmt.toml chore: bootstrap sovereign participatory democracy platform (PINDORAMA) 2026-06-25 17:19:50 -03:00
SECURITY.md feat(0.28.1-contato): public contact form — no e-mail addresses exposed on the site 2026-07-10 20:32:38 +00:00

democracia-social

Sovereign Participatory Democracy Platform — codename PINDORAMA Stewardship: PopSolutions Cooperativa de Tecnologia · License: AGPL-3.0-or-later (+ Social Contract) Live: https://democracia.social.br

CI Security Web

Critical democratic infrastructure that connects the entire Brazilian political chain — vereadores, prefeitos, deputados, senadores, governadores, the Presidency, and the candidates for every office — directly to the population. ~70,000 real mandates (federal, state and municipal) are indexed from official open data, each with a public accountability scorecard.

Thesis: Participation without consequence is theater. This platform converts citizen demand into visible, time-bound, public accountability an elected official cannot silently ignore.

The full engineering north star is PLAN.md. Read it before writing code. The product strategy for the 2026 election cycle is docs/PLANO-ESTRATEGICO-2026.md (Portuguese).


The core loop

propose ─▶ cluster (consensus) ─▶ vote ─▶ threshold ─▶ notify official ─▶ SLA clock ─▶ answered / public silence ─▶ scorecard
                                                                                              │
                                                                                              └─▶ auto-federated ActivityPub Note

Four subsystems make this not "Decidim in Rust" — they are the point:

Subsystem What it does
consensus Embeds proposals (pgvector), merges duplicates into one real signal
consequence Starts a public SLA clock; records answered / acted / ignored (write-once)
mandates Indexes officials & candidates (official open data) and onboards them via public e-mail
scorecard Permanent public record: promises vs delivery, answered vs ignored

On top of the loop, the platform is a full ActivityPub citizen network: Mastodon-compatible client API (existing apps like Tusky/Elk/Ivory log in via OAuth), S2S federation with HTTP signatures, notes/polls/media/hashtags, feeds, and an admin console with Mastodon-grade moderation (reports queue, domain blocks, invites, webhooks).

Architecture at a glance

  • Language: Rust (Axum + Tokio), Cargo workspace of ~23 tiered crates — the crate boundary is the ownership boundary; cross-crate effects flow only through the durable event log (events_log, Postgres) or the gateway (see PLAN.md §6).
  • DB: PostgreSQL 17 + pgvector, accessed via sqlx (compile-checked where cached, runtime-checked at the gateway surface — no ORM, auditability is a requirement).
  • Auth: sovereign e-mail + password (Argon2id) + CPF check-digit validation (ADR-0008); optional gov.br OIDC (dormant until credentials); session cookie + Mastodon OAuth bearer.
  • Front-end: Astro SSG + Svelte islands (web/), served by the gateway at the same origin (ADR-0009); PWA with Web Push (RFC 8291).
  • Federation: ActivityPub S2S + Mastodon client API (ADR-0005, ADR-0010).
  • Deploy: k3s on a sovereign IPv6-first VM (Caddy TLS front), image built from deploy/docker/Dockerfile; Helm chart for the HA future (ADR-0002). Runbook: docs/ops/.
  • Reliability/audit: CI/CD on a self-hosted Forgejo runner is the primary trust mechanism — see docs/CICD.md.

Repository layout

See docs/PROJECT-STRUCTURE.md for the full annotated tree.

crates/
├── core/  db/  api-contract/        # Tier 0 — frozen contracts (single owner)
├── app/                             # shared AppState (ports: db, clock, storage)
├── platform/                        # Tier 1 — auth, notify, events, consensus,
│                                    #          moderation, admin
├── gateway/                         # Tier 1 — the ONE public HTTP surface + worker
├── spaces/                          # Tier 2 — processes, assemblies, initiatives,
│                                    #          consultations, mandates (+ parties)
├── components/                      # Tier 2 — proposals, votes, comments, debates,
│                                    #          meetings, budgets, surveys,
│                                    #          accountability, consequence, scorecard
└── clients/                         # Tier 3 — federation (ActivityPub)
web/                                 # Astro + Svelte front-end (SSG → gateway image)
migrations/                          # append-only SQL, applied manually in prod
deploy/                              # docker/ k8s/ helm/
docs/                                # architecture, ADRs, ops runbooks, wiki
scripts/                             # CI guards + data seeds (Câmara/Senado/TSE)
tests/                               # cross-crate integration harness

Quickstart (developer)

cp .config/settings.env.example .config/settings.env    # fill in secrets (gitignored)

# Guards the CI enforces (run before pushing):
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
./scripts/check-crate-boundaries.sh && ./scripts/check-migration-numbers.sh \
  && ./scripts/check-fk-targets.sh && ./scripts/check-lints-optin.sh

# Tests need a real PostgreSQL (see docs/TESTING.md):
cargo sqlx migrate run --source migrations
cargo test --workspace --all-features

# Front-end:
cd web && npm install && npm test && npm run build

IPv6-first: every example binds to [::1]. IPv4 is an explicit fallback only.

Documentation

Contributing

See CONTRIBUTING.md. All code, comments, commits, and docs are in English; end-user/civic content is in Portuguese. Conventional Commits; every commit is pushed to main and deployed in thin, independent slices.

Companion repositories

  • git.pop.coop/brasil/democracia-social-app — Flutter mobile app (iOS + Android native), future.