- Register Explorer:
- Sync search input with URL query param `q` for shareable deep links
- Initialize search from `q` on load; update URL on input; remove `q` when cleared
- Implemented with Next.js `useSearchParams`, `useRouter`, `usePathname`
- File: src/app/registers/RegisterBrowser.tsx
- Documentation:
- Add docs/ hub and initial guides
- docs/index.md (docs index)
- docs/getting-started.md (install/dev/build/start/lint/deploy)
- docs/architecture.md (structure, theming, styling, key paths, scripts)
- docs/registers.md (Register Explorer overview, search, deep links, implementation notes)
- Rewrite README.md with project overview, features, quick start, scripts, and links to docs
Notes:
- Dev server uses port 4000 (Turbopack) via package.json
- Example deep link: /registers?q=vram
Date: 2025-12-11 13:11 (Junie@lucy.xalior.com)
1.3 KiB
1.3 KiB
Architecture
Overview
- Framework: Next.js App Router (React 19)
- Styling: Bootstrap 5 with React-Bootstrap components and project SASS overrides
- Theming: Light/Dark theme set via data-bs-theme on <html>, initialized from a cookie or system preference in
src/app/layout.tsx
Key paths
- App entry/layout:
src/app/layout.tsx - Global styles:
src/scss/nbn.scss(imports Bootstrap, a Bootswatch-like layer, and project styles) - Navbar:
src/components/Navbar.tsx - Register Explorer:
src/app/registers/* - Register parsing utilities:
src/utils/register_parser.tsandsrc/utils/register_parsers/* - Data:
data/nextreg.txt
Styling & SASS
src/scss/nbn.scssimports Bootstrap and local overrides in this order:variables(custom Bootstrap variables)- Bootstrap core
bootswatch(theme tweaks)explorer(project-specific styles)
Theming bootstrap
- On the server,
layout.tsxreads theNBN-themecookie (light/dark) and setsdata-bs-themeon the HTML element. - On the client, an inline script in the head ensures no flash of incorrect theme by immediately setting the attribute based on cookie or user preference.
Development scripts
- Dev:
pnpm dev(port 4000 with Turbopack) - Build:
pnpm build - Start:
pnpm start(defaults to port 3000)