Skip to content

Commit 0ab0548

Browse files
committed
Update README
1 parent cb9242b commit 0ab0548

File tree

3 files changed

+35
-11
lines changed

3 files changed

+35
-11
lines changed

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,27 @@ npm run build
282282

283283
## Performance Notes
284284

285-
- Minimal client state; cart via `react-use-cart`; product data is static for the demo.
286-
- Centralized currency formatting.
287-
- Lazy‑loaded images in catalog views.
285+
A quick look at choices in this codebase that keep it fast and lean in production:
286+
287+
- **Simple state model:** No heavy global store (Redux/MobX). Cart is handled by a small, focused provider (`react-use-cart`), keeping re‑renders localized to consumers.
288+
- **Cart persistence that doesn’t thrash:** Cart data is stored in `localStorage` and updated only on cart actions; guest→user merge runs once at login and de‑duplicates by product id.
289+
- **Auth activated only when needed:** The Auth0 provider is *rendered* only in `auth0` mode; in `local`/`api` modes the app runs without that runtime overhead.
290+
- **Route-centric architecture:** Pages are split into self‑contained components, making it straightforward to adopt route‑level code splitting (`React.lazy`) without restructuring.
291+
- **Production CRA build:** `react-scripts build` outputs content‑hashed, minified bundles with vendor/app chunking via Webpack’s SplitChunks, enabling long‑term HTTP caching.
292+
- **Tailwind kept tight:** In production, unused utility classes are purged, yielding a compact CSS file. The forms/typography plugins add styles only when their classes are used.
293+
- **Tiny icon payloads:** Icons are imported individually (e.g., a single `HiOutlineShoppingCart`), allowing tree‑shaking to avoid shipping entire icon packs.
294+
- **No runtime i18n framework:** Currency and locale formatting rely on the native `Intl.NumberFormat`, avoiding extra dependencies and keeping number formatting fast.
295+
- **Static demo data:** The catalog uses static data for the demo, so the app avoids client‑side waterfalls and remains interactive immediately after load.
296+
- **Clean separation of concerns:** `lib/config`, `lib/auth`, and `lib/format` keep logic isolated, reducing prop‑drilling and keeping components shallow for faster renders.
297+
- **Scroll behavior tuned for UX:** A lightweight `ScrollToTop` resets scroll on navigation without adding heavy scroll management libraries.
298+
- **Accessible-by-default UI:** Semantic markup and form validation reduce layout thrash and improve focus handling without extra JS.
299+
- **Hosting‑friendly SPA:** The output is a static bundle that can be served from any CDN/host with gzip/brotli and cache‑headers for excellent TTFB and repeat‑visit speeds.
300+
301+
### Ready when you need more
302+
If the catalog or pages grow substantially, the structure already supports:
303+
- **Route‑level code splitting** with `React.lazy` and `<Suspense>`.
304+
- **List virtualization** for very long product lists (React Window/Virtual).
305+
- **Image optimization** (AVIF/WebP, responsive `srcset`) on real assets.
288306

289307
---
290308

tailwind.config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/*
2-
* Copyright (C) 2025 Dimitrios S. Sfyris
3-
* SPDX-License-Identifier: GPL-3.0-or-later
4-
*/
51
module.exports = {
62
content: ["./src/**/*.{js,jsx,ts,tsx}"],
73
theme: {

tools/copyright-headers.mjs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* - .env* (e.g., .env, .env.local, .env.example)
1010
* - Shell scripts: .sh, .bash
1111
* - HTML: .html, .htm
12+
* - Specific files: .gitignore, .eslintignore, package-lock.json, tailwind.config.js
1213
*
1314
* Usage:
1415
* node tools/copyright-headers.mjs # apply (write mode)
@@ -155,6 +156,14 @@ const SKIP_EXTS = new Set([
155156
".bash",
156157
]);
157158

159+
// Skip these specific filenames (anywhere in repo)
160+
const SKIP_FILES = new Set([
161+
".gitignore",
162+
".eslintignore",
163+
"package-lock.json",
164+
"tailwind.config.js",
165+
]);
166+
158167
function isLicenseFile(file) {
159168
const n = basename(file).toLowerCase();
160169
return n === "license" || n.startsWith("license.");
@@ -176,17 +185,18 @@ function includeFile(file) {
176185
if (isLicenseFile(file)) return false;
177186
if (isEnvDotfile(file)) return false;
178187

188+
const base = basename(file);
189+
if (SKIP_FILES.has(base)) return false;
190+
179191
const ext = extname(file).toLowerCase();
180192
if (SKIP_EXTS.has(ext)) return false;
181193

182194
// Known styles by extension
183195
if (EXT_STYLE[ext]) return true;
184196

185-
// Dotfiles without extension (e.g., .gitignore, .npmrc)
197+
// Dotfiles without extension (e.g., .gitignore would be caught above)
186198
if (/^\./.test(file)) {
187-
// if it had an extension (e.g., .eslintrc.json), it was already skipped by SKIP_EXTS
188-
// keep plain dotfiles (line style), except .env* which we skipped above
189-
return true;
199+
return true; // keep plain dotfiles like .npmrc, .editorconfig if you want headers there
190200
}
191201

192202
return false;

0 commit comments

Comments
 (0)