StyleLens is a Next.js app for extracting visual style references from URLs and images.
Run the development server:
npm run devOpen http://localhost:3000 in your browser.
Useful local checks:
npm run lint
npx tsc --noEmit
npm testMain app areas:
app/page.tsxHomepage composition layer. Wires auth state, history state, extraction state, page layout and overlays together.hooks/useHistory.tsHistory list state, guest history, account history, guest-to-account migration, rename/delete/undo/pin/search behavior.hooks/useExtraction.tsURL extraction, image extraction, upload preview, drag/paste input, cancel flow, loading states and extraction errors.components/home/HomeSidebar.tsxSidebar history UI.components/home/HomeWorkspace.tsxMain page-mode report container.components/home/HomeOverlays.tsxModal-mode report container and overlays.components/report/*Shared report presentation building blocks.lib/types/index.tsShared app types, including homepage report and history display types.docs/Product and design reference documents.scripts/Local helper scripts.
walkthrough.mdis maintained outside this workflow and should not be touched during normal refactors.- The report uses a "single source, dual view" structure:
- Page mode lives in
HomeWorkspace - Modal mode lives in
HomeOverlays - Shared report content can be reused, but the two containers should not be collapsed into one generic shell if that changes UX details.
- Page mode lives in
- Homepage refactors should prefer low-risk steps:
- preserve behavior first
- preserve UI details first
- split structure before changing logic
Vitest is set up for lightweight logic coverage.
Current test focus:
hooks/useHistory.test.tsxhooks/useExtraction.test.tsx
Run all tests with:
npm test- Screenshot caching and guest history behavior are part of the product cost-control strategy and should be treated carefully.
- AI extraction availability can depend on provider or network constraints, so user-facing errors should stay friendly and should not expose raw backend or provider messages.