Plataforma digital e site público de Jorge Solla
Find a file
Francisco Solla 7162c65e37
All checks were successful
CI (PR) / checks (pull_request) Successful in 8m36s
PR Ready + auto-merge / ready-automerge (pull_request) Successful in 8m49s
Main merge flips claimed issues to done + in-prod / issue-done (pull_request) Successful in 13s
Promote plan-issue Related on main merge / plan-issue-ready (pull_request) Has been skipped
ops(OPS69): regenera importMap com o S3ClientUploadHandler (admin abria em branco em prod)
O importMap commitado ficou sem a entrada @payloadcms/storage-s3/client#S3ClientUploadHandler
desde o OPS52 (dabc00f4 removeu o handler do blob sem adicionar o do S3, porque o
generate:importmap rodou sem as envs S3_*). Com o plugin s3Storage condicional, sem as
envs o importMap sai consistente (dev/test) mas em produção (envs ativas) o admin falhava
ao montar a view — getFromImportMap: PayloadComponent not found in importMap — login nunca
renderizava. Fix: regenerar com as 4 S3_* dummy inline (loadEnvConfig do @next/env não
sobrescreve envs do processo; iterateConfig não toca DB) — diff de exatamente +2 linhas.
Smoke headless com S3 ativo: /admin/login renderiza, zero erros de console. Gates verdes
(tsc/lint/format/knip/cycles/unit+int 791/build). Sem migration/access/UI. Docs: nota no
AGENTS.md (generate:importmap precisa das S3_* enquanto o plugin for condicional) +
changelog. Guard de CI registrado como OPS70 (#87, depends #77).
2026-08-19 12:45:22 -03:00
.agents fix(OPS64): pin do waitForChecks contra rollup mentiroso + docs — OPS62 eliminou o secundário estruturalmente 2026-08-19 12:11:41 -03:00
.codex chore(agents): reorganiza árvore de skills — .claude/.cursor → .agents 2026-08-03 21:24:11 -03:00
.cursor ops(OPS52): migra a media de produção do Vercel Blob para o Garage S3 2026-08-17 22:36:34 -03:00
.forgejo ops(OPS65): CI do main em janela de 30 min (gate .dockerignore fail-open) + matar agent-pool 2026-08-18 21:08:12 -03:00
.github OPS50: port CI e scripts de agentes do GitHub para o Forgejo 2026-08-16 23:32:20 -03:00
.husky feat(ops): auto-promote stage→main e merge em stage sem exigir head (#68) 2026-07-30 21:12:52 -03:00
.impeccable docs(B124): format intention plan and critique with Prettier 2026-08-02 15:16:23 -03:00
.opencode style(opencode): formata skill e agente solla-comunicacao 2026-08-16 20:33:33 -03:00
.vscode feat: initial commit 2026-02-14 16:11:51 -03:00
.zed Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
docker/postgres/init Isolate local/dev and tests from the production database 2026-07-15 13:52:30 -03:00
docs ops(OPS69): regenera importMap com o S3ClientUploadHandler (admin abria em branco em prod) 2026-08-19 12:45:22 -03:00
private chore: public release tip — All Rights Reserved, sanitize field material 2026-07-31 12:53:12 -03:00
public feat(site): publica home da campanha Jorge Solla 1313 2026-08-16 00:49:24 -03:00
scripts ops(OPS67): retry com backoff nos fetchs do forgejo-api 2026-08-19 13:28:37 +00:00
src ops(OPS69): regenera importMap com o S3ClientUploadHandler (admin abria em branco em prod) 2026-08-19 12:45:22 -03:00
tests fix(OPS64): pin do waitForChecks contra rollup mentiroso + docs — OPS62 eliminou o secundário estruturalmente 2026-08-19 12:11:41 -03:00
.cursorignore docs: agent ops + slice AGENTS.md + kernels + cursorignore + portable hooks + cloud env + PR template 2026-07-30 05:21:35 -03:00
.dockerignore chore(deploy): prepara imagem standalone para homeserver 2026-08-16 01:52:11 -03:00
.env.example ops(OPS52): migra a media de produção do Vercel Blob para o Garage S3 2026-08-17 22:36:34 -03:00
.env.test ops(OPS52): migra a media de produção do Vercel Blob para o Garage S3 2026-08-17 22:36:34 -03:00
.gitignore feat(S2): seção de conteúdos da home de campanha inclui os vídeos do YouTube 2026-08-18 15:23:50 -03:00
.npmrc fix issues to run from cPanel 2026-03-15 14:03:28 -03:00
.nvmrc chore: pin Node to 24.x (CI, Vercel, engines) 2026-07-31 23:47:49 -03:00
.prettierignore feat(S2): seção de conteúdos da home de campanha inclui os vídeos do YouTube 2026-08-18 15:23:50 -03:00
.prettierrc.json Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
.yarnrc feat: initial commit 2026-02-14 16:11:51 -03:00
AGENTS.md ops(OPS69): regenera importMap com o S3ClientUploadHandler (admin abria em branco em prod) 2026-08-19 12:45:22 -03:00
components.json Including page mandato-no-whatsapp 2026-03-14 18:07:40 -03:00
DESIGN.md simplify(B13): corrige classe agregada, bolhas em pane proprio e registra debitos 2026-07-26 05:12:37 -03:00
docker-compose.yml feat(worktree): ambientes isolados por worktree — porta própria, bancos próprios, migrations no provision 2026-08-08 11:33:07 -03:00
Dockerfile ops(OPS66): deploy — migrate antes do build do runner (deadlock de migrations em caminho estático) 2026-08-19 10:06:00 -03:00
eslint-legacy-ignores.mjs feat: AI chat 'Sollinha' — campaign data assistant (v1 read-only) 2026-08-04 06:17:31 -03:00
eslint-local-rules.mjs Add ESLint guard for invalid use server exports and fix plaza staff messages. 2026-07-21 20:07:06 -03:00
eslint.config.mjs fix(ci): ignora artefatos do build e2e 2026-08-16 01:35:49 -03:00
knip.json feat: AI chat 'Sollinha' — campaign data assistant (v1 read-only) 2026-08-04 06:17:31 -03:00
LICENSE chore: public release tip — All Rights Reserved, sanitize field material 2026-07-31 12:53:12 -03:00
next.config.mjs feat(S3): seção de conteúdos da home de campanha inclui os posts do Instagram 2026-08-18 20:29:50 -03:00
opencode.json feat(site): publica home da campanha Jorge Solla 1313 2026-08-16 00:49:24 -03:00
package.json ops(OPS54): allowlist onlyBuiltDependencies migra para pnpm-workspace.yaml — fim do warning do pnpm 10 sobre o campo pnpm ignorado 2026-08-18 09:06:37 -03:00
playwright.config.ts feat(S3): seção de conteúdos da home de campanha inclui os posts do Instagram 2026-08-18 20:29:50 -03:00
pnpm-lock.yaml feat(OPS52-media): recupera os objetos de media de produção do WordPress para o bucket (pnpm media:recover) 2026-08-18 08:20:45 -03:00
pnpm-workspace.yaml ops(OPS54): allowlist onlyBuiltDependencies migra para pnpm-workspace.yaml — fim do warning do pnpm 10 sobre o campo pnpm ignorado 2026-08-18 09:06:37 -03:00
postcss.config.mjs Migrate from unstable_cache to use cache. And start Petition Form 2026-02-17 22:16:53 -03:00
PRODUCT.md B34: editable município chips on the leaderships list. 2026-07-27 22:35:19 -03:00
README.md docs(OPS68): reescreve docs canônicos da era GitHub/Vercel para Forgejo/homeserver 2026-08-19 13:33:05 +00:00
skills-lock.json Add addyosmani agent skills and wire plan-issue to them 2026-08-02 13:28:58 -03:00
tailwind.config.ts feat: add Tailwind CSS integration 2026-02-14 16:47:25 -03:00
test.env feat: initial commit 2026-02-14 16:11:51 -03:00
tsconfig.json fix(ci): isola bundle e2e do servidor de desenvolvimento 2026-08-16 01:25:06 -03:00
vitest.config.mts fix(ci OPS50): matrix estática [1,2] no e2e (Forgejo não passa job results à expansão de matrix — fromJson(needs.*) vira shard vazio) e VITEST_MAX_WORKERS=4 no int (8 CPUs do runner × pool-10 estoura os 100 clients do Postgres do serviço) 2026-08-17 04:17:56 -03:00
vitest.setup.ts feat(worktree): ambientes isolados por worktree — porta própria, bancos próprios, migrations no provision 2026-08-08 11:33:07 -03:00
vitest.unit.config.mts Engineering Pass 3: consolidate patterns and lock them with guards. 2026-07-29 06:11:29 -03:00

Teqo

License: proprietary — All Rights Reserved (© Francisco Ignácio Fontoura Solla). Portfolio / demonstration only. Not open source. Use, copy, or redistribution requires prior written permission (fsolla@pm.me). See LICENSE.

Sensitive field material belongs in /private/ on local checkouts (gitignored). Cloud agents: use public-clean docs; report sensitive deliverables in chat — do not commit them.

Cheatsheet de operação agentic (humanos) — o fluxo em 5 linhas:

  1. O agente roda pnpm agent:claim (ou pnpm worktree next --issue N) e pega a próxima Issue ready por prioridade (prio:P0..P3).
  2. Ele implementa, roda o fast gate (lint + typecheck + unit) e pnpm push -u origin HEAD — abre a PR para main (Ready, Closes #N).
  3. CI verde → o safety net agent-pr-ready-automerge.yml mergea em main por rebase; o verificador ci.yml do main roda a suíte completa na janela fixa de 30 min.
  4. Com mudança de produção → o job deploy publica no homeserver (jorgesolla1313.com.br, self-hosted) — migrações aplicadas antes do rollout.
  5. Secrets humanos (uma vez): FORGEJO_API_TOKEN no Forgejo; envs de prod em ~/stack/teqo-1313.env no homeserver. Branch protection de main já aplicada (reaplicar: pnpm configure:branch-protection).

Comandos: pnpm agent:claim | agent:register | agent:prioritize | agent:file-miss | worktree next e pnpm db:seed:minimal. Labels: estado ready|in-progress|blocked|done|in-prod, prio:P0..P3, kind:*, needs:migration|consent, requirements-changed. Agente faz sozinho: claim → implementar → PR → main. Só humano: envs do homeserver, branch protection, runbook de rollback. Tudo em detalhe: docs/AGENT-OPS.md · CI: .forgejo/workflows/ci-pr.yml + ci.yml.

Teqo starts as the official digital platform for deputado Jorge Solla and evolves into a white-label civic engagement platform for politicians in Brazil.

The goal is to help political teams build direct, durable relationships with their base without depending on Big Tech social platforms as the primary channel.

Mission

  • Strengthen direct communication between representatives and citizens.
  • Reduce platform dependency risk by owning audience and data channels.
  • Provide reusable building blocks so each political team can launch quickly.

Product Direction

Phase 1: Jorge Solla Website

Initial delivery focuses on Jorge Solla's public website, editorial CMS, and the internal /campanha tool:

  • Public-facing content and updates (news/post + tag live)
  • Institutional pages and biography (still pending a Pages collection)
  • Internal campaign operations: municípios (435, pré-definidos), leaderships, estimates, updates, WhatsApp invites
  • Editorial operations through Payload CMS

Phase 2: White-Label Platform

Teqo then becomes a configurable base product for other politicians in Brazil:

  • Multi-tenant and reusable architecture
  • Brand and content customization per mandate/campaign
  • Shared core modules for communication and engagement
  • Operational autonomy with self-hosted owned channels

Local Development

Production safety: the production database is a live Postgres on the homeserver (teqo_1313) holding real citizens' data. Local development and tests run against a local Postgres and must never point at production. pnpm dev refuses to start against a non-local database, and the test suite refuses any database whose name doesn't end in _test.

First-time setup

  1. Install dependencies: pnpm install
  2. Create your env file: cp .env.example .env.local
  3. Start Docker, then start the local database: pnpm db:start
    • This runs Postgres 17 (matching production) and auto-creates a teqo_test database for the test suite.
  4. Make sure DATABASE_URL in .env.local points at local:
    DATABASE_URL=postgresql://teqo:teqo@localhost:5432/teqo
    
  5. Load a schema + content into the local database — pick one:
    • Mirror production content (recommended): PROD_DATABASE_URL="<prod connection string>" pnpm db:pull Copies production's schema and content into local. It only reads production and excludes supporter PII (contact/signature/subscription data). The prod string is the DATABASE_URL of ~/stack/teqo-1313.env on the homeserver (Postgres teqo_1313).
    • Empty schema from migrations: pnpm migrate
  6. Start the dev server: pnpm dev
  7. Open: http://localhost:3000

Useful scripts: pnpm db:start / pnpm db:stop (local Postgres — always the same shared container via -p teqo, from any directory), pnpm db:pull (refresh local content from prod), pnpm db:seed:posts (import news posts/tags fresh from the live jorgesolla.com.br site into the local db; idempotent by slug, refuses a non-local database), pnpm db:seed:tse (import TSE 2014/2018/2022 Bahia election results into the local db; idempotent per year/office/turn scope, refuses a non-local database), pnpm build:election-aggregates (regenerate the committed TSE aggregate artifact in src/lib/electionAggregates/ from locally seeded data).

Parallel worktrees get isolated environments: pnpm worktree next derives a per-branch dev port (3100+slot) and its own databases (teqo_wt<slot> / teqo_wt<slot>_test), so agents never fight over port 3000 or the shared teqo_test. See .agents/skills/local-database.

Content & cache revalidation

Public news pages (/[type], /[type]/[category], articles, and the home news list) are cached under a shared posts tag. Editing a post or tag in the deployed admin self-revalidates via afterChange hooks. Any write that bypasses the deployed runtime — a direct-DB seed (pnpm db:seed:posts), SQL, Onda 0 migrations, or a restore — does not bust production's cache, so afterwards call the secured endpoint:

# News (default tag: posts)
curl -X POST "https://<prod-domain>/api/revalidate" -H "x-revalidate-secret: $REVALIDATE_SECRET"

# Privacy policy after Onda 0 provision (tag: global_privacy-policy)
curl -X POST "https://<prod-domain>/api/revalidate?tag=global_privacy-policy" -H "x-revalidate-secret: $REVALIDATE_SECRET"

REVALIDATE_SECRET must be set in the production env (~/stack/teqo-1313.env on the homeserver — see .env.example). See the "Posts & Tags" section of AGENTS.md for the full model.

Database migrations

Schema is managed by committed Payload migrations (src/migrations/); push is disabled everywhere.

To change the schema:

  1. Edit the collection/global/field config.
  2. Generate a migration: pnpm migrate:create <name>
  3. Review and commit the generated files in src/migrations/ (both .ts and .json, plus index.ts).
  4. Apply it locally: pnpm migrate (check status anytime with pnpm migrate:status).

Deploying to production: merges to main with production changes are deployed by the deploy job of ci.yml (windowed — see docs/AGENT-OPS.md); the remote script (scripts/deploy-homeserver.sh) builds on the homeserver and applies pending migrations through the compose maintenance service teqo-1313-migrate before the rollout. Do not run migrations against production by hand. Runbook (rollback, known failures): docs/ops/teqo-1313-deploy.md.

Running tests

Tests use the isolated teqo_test database (config in .env.test). Prepare its schema once with:

DATABASE_URL=postgresql://teqo:teqo@localhost:5432/teqo_test pnpm migrate

Then run:

  • pnpm test — unit + integration
  • pnpm test:e2e — Playwright (requires the test DB schema and a free port)
  • pnpm test:all — unit + integration + E2E

Quality gates (also enforced by CI on the Forgejo Actions): pnpm lint (zero warnings — --max-warnings=0), pnpm typecheck, and pnpm exec knip (dead files/dependencies fail; delete what your change orphaned). Standards: .agents/rules/engineering-standards.mdc.

Tech Stack

  • Payload CMS
  • Next.js
  • PostgreSQL (via @payloadcms/db-postgres)
  • TypeScript

Campaign (/campanha)

Internal campaign tool for municípios (435 pré-definidos), local leaderships, vote estimates, field updates, and WhatsApp invites. Authenticated separately from /admin via the campaignUser collection (coordinator / advisor / leader / candidate). Operational status and decisions: .agents/rules/projects/nucleos-eleitorais.mdc. Conventions and deploy checklist: AGENTS.md (“Campaign auth” / “Campaign Municípios model”).

Production blocker: do not load real leadership data or enable invites until counsel-approved Consent.key = 'lideranca-autopreenchimento' exists. Absolute invite URLs require NEXT_PUBLIC_SITE_URL as an exact HTTPS DNS origin in production.

Roadmap

Backlog and future plans live as tracked Forgejo Issues (spec + deps + prio + model per issue; flow skills: plan-issue → work-issue → project-status; docs/roadmap.md is a frozen legacy stub).