feat(admin): scaffold admin area with contagens table - #160
Open
iacapuca wants to merge 1 commit into
Open
Conversation
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>
🚀 Preview deploy
Updates on every push. Production is unchanged. |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stands up an
/adminsection 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 publiccontagensQueryOptions; CRUD wiring is a follow-up once a write API is in place.Routes
GET /admin— dashboard: stat cards (pontos / contagens / ciclistas) + link to contagensGET /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 iconscard,table,input,badge,separator(buttonwas already in)--sidebar*tokens from PR feat: add shadcn/ui (neutral preset, new-york style) #159Wiring
__root.tsx+MainContentskip the public Navbar/Footer and thept-14main padding for/adminand/admin/*(extending the sameConditionalNavbar/Footerpattern already used for/dados/ciclodados)robots.txtnowDisallow: /adminnoindex, nofollowmetaMisc
.tanstack/added to.gitignore(TanStack Start dev tmp dir)Notes
/adminwill 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./dados/contagens/{slug}(the public detail page) as a placeholder. Replace once a real edit page exists./admin/contagensisdisabledfor the same reason.Test plan
pnpm buildsucceedspnpm install --frozen-lockfilesucceeds/adminand/admin/contagensreturn 200 in dev; sidebar links toggle active staterobots.txtincludesDisallow: /admin🤖 Generated with Claude Code