Repository navigation
Initial tasks to do. #20
RyannKim327
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
BetterLucenaCity — Tasks & Milestones
Milestones — Accomplished ✓
M0 — Project Scaffolding (2026-08-23)
Initial commit from Create Next App— Next.js + TS + Tailwind 4 setupsrcdirectory adoption, BetterLucena → BetterLucenaCity renameREADME.md,CLAUDE.md,CONTRIBUTING.md,CODE_OF_CONDUCT.md,SECURITY.md,LICENSE.mdM1 — Design System & Layout (2026-08-23 → 08-24)
globals.csstokens,Card/Button/PageHeaderLayout: stickyHeader(backdrop-blur, mobile toggle,ThemeToggle),Footer,Hotlinesbar (red banner)Theme:theme-provider.tsx(light|dark|system+localStorage+matchMedia) +theme-toggle.tsx(menu, outside click)M2 — Home Sections (2026-08-24 → 08-25)
HeroSection(headline +ButtonCTAs +MapClient)AboutSection— 8 cards fromLUCENAconst (population, barangays, etc.) (lib/sources/shared.ts)ServicesSection—lib/data/services.ts(6 services,featuredfilter) +types/services.tslib/data/legal-documents.ts(RA 3271, RA 7160, etc.)M3 — Live Civic Data & Map (2026-08-24 → 08-26)
LiveDataSection(client,PanelStateunion) — 3 panels:Weather(Open-Meteo),Earthquakes(Phivolcs viaearthquakeapi),DPWHprojects/api/weather,/api/earthquakes,/api/dpwh/projects(+lib/sources/*+lib/cache.tsin-memory cache 250 entries, stale-while-revalidate)LucenaMap— Leaflet + react-leaflet,MapContainer[13.9333,121.6167],GeoJSONboundary via/api/geography/boundary(Nominatim R11124741) +map-client.tsxdynamic(ssr:false)M4 — Transparency & Budget (2026-08-25)
lib/sources/budget.ts(getNationalBudget,LATEST_YEAR) +/api/budget/national+NationalBudgetSection(bar charts,formatPeso)Transparencypage (revalidate 3600)M5 — Contributors & Auth (2026-08-26 → 08-28)
Contributorslisting (first 8,next/imagefill) — section +/contributorspageuser_typeenum +userstable + RLS (SELECT public,UPDATE own) +handle_new_user()trigger (username dedup)AuthButtons(Google/GitHubsignInWithOAuth→/auth/callback?next=) +supabase/client.ts+server.ts(createServerClient+cookies())Contributors from DB—GET /api/contribute/members(username, avatar_url, user_type)M6 — Supabase & Migrations Hardening (2026-08-29 → 08-30)
users,ordinances→legals,ordinance_typeenum,announcement→announcements, RLS public read, seeds (6 announcements: traffic 2915, ROAD TF, Undas + 6 legals: RA3271/RA7160/Ord2915/etc.)Contributeform +POST /api/contributevalidation (category/title/details/consent, URL regex) — auth-gated layout(contribute)(admin)/admin(currentlyisAdmin=trueplaceholder)proxy.tsmigration (Supabase SSR session refresh)M7 — Session Refactors (2026-08-30 — uncommitted, this workspace)
announcements,legal,contributorswereServer Component + axios + internalApiUrl()self-calls (fail on Vercel). Migrated tosrc/components/data/*client components (announcements-list.tsx+legal-list.tsx+contributors-grid.tsx) fetching/api/*inuseEffect+Loading/Failedstates. Pages stay Server Components formetadata.types/sources.ts+types/components.ts(deadlib/data/announcements.ts+contributors.tsremoved). Created 10 files:announcements.ts,legal.ts,contributors.ts,services.ts,hotlines.ts,live-data.ts,map.ts(incl.NominatimLookupResponse),budget.ts,ui.ts(PageHeader/Button/Card/AuthButtons),contribute.ts(Category/Payload). Updated all imports (lib/sources,lib/data,api,components).announcementsroute now returns{error}500,legals+contribute/membersalready had 500 shapes consistent with client"error" in data.Backlog — Tasks To Do
P0 — Must-fix (Before next deploy)
[security]src/app/(admin)/layout.tsx: isAdmin=true→ checksupabase.auth.getUser()+users.user_type(Head Maintainer/Maintainer). Gate/admininmiddleware.ts/proxy.ts.[security]src/app/auth/callback/route.ts?next=unvalidated → whitelist[/, /contribute, /admin], reject//evil.com.[data]src/components/data/legal-list.tsxformatDate(doc.date as string)— 3 legals havenulldate → guardformatDate(string|null)→—.[api]src/app/api/contribute/route.tsreturns201 {ok:true}with nosupabase.from("contributions").insert(). Addcontributionsmigration + insert.[a11y]about.tsx+contributors.tsxbothid="about-heading"→ rename second tocontributors-heading.P1 — Should-fix
Security & Headers
CSP,X-Frame-Options,X-Content-Type-Options,Referrer-Policy,Permissions-Policy,HSTSinnext.config.ts/proxy.ts.POST /api/contribute+ honeypot/CAPTCHA; validate env vars without!inproxy.ts.Data & API Consistency
ApiError({error:string}vs{error, allowed[]}vs{error, documents[]}) +zodvalidation forlegals/dpwh/earthquakes/contribute.legalsvslegal:/api/legals(DB) vs/api/legal/documents(static dead for UI) vs/api/legal/types— deprecate or doc.legalDisclaimer(lib/data/legal-documents.tsvsapi/legals/route.ts).src/lib/sources/earthquakes.tsradius validated but never filters;budget.tsLATEST_YEARstale per-request.Caching & Performance
src/lib/cache.tsin-memoryMap(per-invocation on serverless) withunstable_cache/Redis/Nextfetch revalidate.Cache-Controlonannouncements,legals,contribute/members,legal/*; add to all 11 routes.src/app/loading.tsx/error.tsx/not-found.tsx(currently full-page block on fetch).axios(9 uses) +fetch(1) +fetchJson(4) → single client.UI/UX & A11y
hotlines.tsxreturnsundefinedfor non-head, dead// <marquee>, not responsive.legal-listrole="navigation"div →<nav>/role="group";contributors-gridkey={${i}. ${username}`` →username; earthquakes `key={i}` → stable.lucena-map.tsxz-1invalid →z-[1], addaria-label;about/contributorscards style.ContributeForm—(contribute)/contribute/page.tsxis<p>Test</p>orphaned.AbortControllercancel tocomponents/data/*useEffect; addSkip to content.SEO
src/app/sitemap.ts,robots.ts,manifest.ts;layout.tsxmetadataBase/openGraph/twitter/canonical; per-pagedescription.GovernmentOrganization,Dataset(budget),NewsArticle(announcements).Code Health
Processinterface / populateservices[].process; DRYCardvs rawdiv rounded-cardinlive-data-section/national-budget-section.lib/sources/shared.ts:internalApiUrl(0 imports since client migration); purge dead assets (file.svgetc.) + admin placeholder ((admin)/admin/page.tsx).export functionvsexport default(Header/Footer named, Hero/About default).P2 — Nice-to-have / Future
vitest+playwright—formatPeso/formatDate/isLegalDocType/cache/contribute/middleware/auth/callback;gh-testiseslint && buildonly now.announcements/legals/membersserver?limit&pagevs client slice.announcements/legals).Footertel:fix (tel:+042...malformed),Buttona11y,lang="fil"for Filipino eyebrows.leafletpreload tree-shaking.Quick Wins (≤2h each)
formatDate(null)— 5minternalApiUrl— 10msitemap.ts/robots.ts— 20mhotlines.tsxfix — 15mAll reactions