Documentation site (Next.js 15, App Router, standalone) cataloging 92 Brazilian public data sources for government oversight. PT-BR primary language.
- URL: https://brazilvisible.org
- License: MIT
- Branch de produΓ§Γ£o:
main - Branch de desenvolvimento:
develop
npm installβ install dependenciesnpm run devβ local dev server (http://localhost:3000)npm run buildβ production build (standalone output to.next/)npm run lintβ ESLintnode scripts/validate-frontmatter.mjsβ validate API page frontmatternode scripts/health-check.mjsβ check API availability (generatespublic/health.json)
- Framework: Next.js 15 (App Router,
output: 'standalone') - Styling: Tailwind CSS 3.4 with Brazilian flag color palette
- MDX:
next-mdx-remote/rscwith remark/rehype plugins - Themes:
next-themes(class-based dark mode) - Deploy: Docker (node:22-alpine, standalone) via Coolify
- Standalone pre-rendered β
next buildpre-renders all pages viagenerateStaticParams. Node server (server.js) serves pre-generated content. - Content as data β All content in
.mdfiles with structured YAML frontmatter. TypeScript reads filesystem at build time. - Zero database β Content from
docs/, health check generatespublic/health.json. - SEO-first β Metadata, canonical URLs, JSON-LD, dynamic sitemap on every page.
docs/*.md (Markdown + YAML frontmatter)
-> gray-matter (parse frontmatter)
-> lib/content.ts (sidebar, tags, docs)
-> next-mdx-remote/rsc (render MDX)
-> next build (standalone)
-> .next/standalone/ (server.js + static)
-> Docker (node:22-alpine)
-> Coolify (production)
docs/apis/**/*.md (extract url_base from frontmatter)
-> scripts/health-check.mjs (normalize URLs, deduplicate)
-> HTTP GET with browser headers (3-tier retry)
-> public/health.json (result)
-> GitHub Actions (every 6h, auto-commit)
-> components/status-badge.tsx (client-side fetch + badge)
app/β Next.js App Router pages and layoutscomponents/β React components (navbar, sidebar, search, status-badge, scroll-reveal, etc.)lib/content.tsβ filesystem-based content utilities (memoized)lib/mdx.tsxβ MDX rendering pipeline with remark/rehype pluginslib/remark-admonitions.tsβ custom remark plugin for :::warning/:::tip/:::notedocs/apis/<category>/<source>.mdβ API documentation pages (92 sources across 22 categories)docs/cruzamentos/<recipe>.mdβ cross-referencing recipes (5 recipes)recipes/<name>/β Jupyter notebooks (3 notebooks)scripts/health-check.mjsβ API availability checker (WAF-bypass, 3-tier strategy)scripts/validate-frontmatter.mjsβ frontmatter validationpublic/health.jsonβ health check results (generated, committed by CI)Dockerfileβ multi-stage standalone build (node:22-alpine)
| Token | Hex | Usage |
|---|---|---|
brazil-green |
#009C3B |
Primary, links, buttons |
brazil-green-light |
#00B847 |
Light variant for dark mode |
brazil-green-dark |
#007A2E |
Button hover |
brazil-yellow |
#FFDF00 |
Accents |
brazil-blue |
#002776 |
Secondary accents |
dark-bg |
#0c0c18 |
Dark mode background |
dark-surface |
#14142a |
Dark mode surfaces |
- Every API page MUST have required frontmatter: title, slug, orgao, url_base, tipo_acesso, status
- Optional frontmatter: autenticacao, formato_dados, frequencia_atualizacao, campos_chave, tags, cruzamento_com
- Body sections: O que e, Como acessar, Endpoints/recursos principais, Exemplo de uso, Campos disponiveis, Cruzamentos possiveis, Limitacoes conhecidas
- Content in PT-BR
- Status values: documentado (fully documented), parcial (partial info), stub (metadata only)
- url_base MUST be a URL that returns HTTP 200 (for health check accuracy)
- Frontmatter: title, dificuldade, fontes_utilizadas, campos_ponte, tags
- Body sections: Objetivo, Fluxo de dados, Passo a passo, Exemplo de codigo, Resultado esperado, Limitacoes
- Commit messages follow conventional commits (feat:, docs:, ci:, fix:, refactor:, style:)
- Branch from
develop, PR todevelop, mergedeveloptomainfor releases main= production,develop= development branch- Always run
npm run buildbefore committing to verify no build errors - Run
node scripts/validate-frontmatter.mjswhen modifying API pages - Run
node scripts/health-check.mjswhen modifying url_base values
docker build -t brazil-visible .
docker run -p 3000:3000 brazil-visibleDockerfile multi-stage (3 stages):
- deps (node:22-alpine):
npm ciβ isolated dependency install - builder (node:22-alpine): copy modules + code,
npm run build->.next/standalone/ - runner (node:22-alpine): copies only
public/,.next/standalone/,.next/static/. Runs asnextjsuser (non-root) on port 3000
Security headers in next.config.ts (X-Content-Type-Options, X-Frame-Options, Referrer-Policy).
Deploy via Coolify: push to main -> Coolify detects via GitHub App -> Docker build -> auto deploy.
- Create
docs/apis/<category>/<slug>.md - Fill frontmatter with all required fields
- Write content following the template sections
- Run
node scripts/validate-frontmatter.mjsto validate - Run
npm run buildto verify - Run
node scripts/health-check.mjsto verify url_base - Commit with
docs: add <source name> to <category>
- Create
docs/cruzamentos/<slug>.md - Fill frontmatter (title, dificuldade, fontes_utilizadas, campos_ponte, tags)
- Write content following template sections
- Run
npm run buildto verify - Commit with
docs: add <recipe name> cross-reference recipe
focus-visible:ringon all interactive elementsaria-expandedon collapsible menus/sidebararia-labelon sections and icon-only buttonsrole="combobox"witharia-autocompleteon searchrole="dialog"on mobile menu with focus trapprefers-reduced-motionrespected in hero and scroll-reveal- Touch targets >= 44px (TOC, mobile buttons)
<title>and<meta description>on all pages- Canonical URLs on all pages
hreflangpt-BR on root layout- JSON-LD: WebSite (landing), Article (API pages), BreadcrumbList (breadcrumbs)
- Open Graph and Twitter Card metadata
- Dynamic
sitemap.xmlgenerated at build time - Permissive
robots.txt