Skip to content

feat(admin): scaffold admin area with contagens table - #160

Open
iacapuca wants to merge 1 commit into
mainfrom
feat/admin-area
Open

feat(admin): scaffold admin area with contagens table#160
iacapuca wants to merge 1 commit into
mainfrom
feat/admin-area

Conversation

@iacapuca

@iacapuca iacapuca commented May 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stands up an /admin section with its own chrome (sidebar + topbar) so it doesn't inherit the public Navbar/Footer. Read-only UI scaffold for now — data is fetched from the existing public contagensQueryOptions; CRUD wiring is a follow-up once a write API is in place.

Routes

  • GET /admin — dashboard: stat cards (pontos / contagens / ciclistas) + link to contagens
  • GET /admin/contagens — searchable, sortable table of all counts (Ponto / Data / Ciclistas / ações)

Components

  • app/components/Admin/{AdminSidebar,AdminTopbar,ContagensTable}.tsx — built on shadcn primitives + lucide icons
  • shadcn primitives added: card, table, input, badge, separator (button was already in)
  • Sidebar uses the new --sidebar* tokens from PR feat: add shadcn/ui (neutral preset, new-york style) #159

Wiring

  • __root.tsx + MainContent skip the public Navbar/Footer and the pt-14 main padding for /admin and /admin/* (extending the same ConditionalNavbar/Footer pattern already used for /dados/ciclodados)
  • robots.txt now Disallow: /admin
  • Both admin routes emit noindex, nofollow meta
  • Sitemap uses an explicit allowlist, so admin is naturally excluded

Misc

  • .tanstack/ added to .gitignore (TanStack Start dev tmp dir)

Notes

  • No auth. This is a UI shell — anyone visiting /admin will see it. We need to gate it before this becomes useful for writes. Easy follow-ups: HTTP basic auth at the Worker, Cloudflare Access, or a real auth provider.
  • The "Editar" button on each row currently links to /dados/contagens/{slug} (the public detail page) as a placeholder. Replace once a real edit page exists.
  • The "Nova contagem" button on /admin/contagens is disabled for the same reason.

Test plan

  • pnpm build succeeds
  • pnpm install --frozen-lockfile succeeds
  • /admin and /admin/contagens return 200 in dev; sidebar links toggle active state
  • Public chrome (Navbar/Footer) does not leak into admin routes
  • robots.txt includes Disallow: /admin

🤖 Generated with Claude Code

Adds an /admin section with its own chrome (sidebar + topbar) so the existing
public Navbar/Footer don't render there. Read-only UI scaffold for now —
data is fetched from the existing public contagensQueryOptions; CRUD wiring
is a follow-up once a write API is in place.

Routes
- /admin              — dashboard with stat cards + link to contagens
- /admin/contagens    — searchable, sortable table of all counts

Components
- app/components/Admin/{AdminSidebar,AdminTopbar,ContagensTable}.tsx
- shadcn primitives added: card, table, input, badge, separator
- Uses ~/lib/utils cn() and shadcn neutral tokens

Wiring
- __root.tsx + MainContent skip the public Navbar/Footer and the pt-14 main
  padding for /admin and /admin/* (same pattern as /dados/ciclodados).
- robots.txt now Disallows /admin
- /admin and /admin/contagens emit `noindex, nofollow` meta
- Sitemap is an explicit allowlist, so admin is naturally excluded.

Misc
- .tanstack/ added to .gitignore (TanStack Start dev tmp dir)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown

🚀 Preview deploy

URL https://808027ea-ameciclo.ti-8b9.workers.dev
Version 808027ea-1237-4ada-a443-1b37a824140e
Commit 0ce7d0917cc89971e13bec66fc5b39c527a82b5a

Updates on every push. Production is unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant