Last reviewed: 2026-04-30
BookStore is a portfolio-oriented commerce project, but the public deployment is treated like a production surface: secrets stay outside Git, public responses are sanitized, dependency audits are run, and health checks avoid leaking operational detail.
- Frontend dependency audit reports 0 known vulnerabilities at the moderate threshold and above.
- Public catalog, promotions, flash sale, health, and chatbot paths are covered by Playwright smoke/audit tests.
- Public health responses avoid raw provider exception text and private user data.
- Render secrets are generated or configured through environment variables, not committed source defaults.
- Same-origin
/apiproxy is used by the frontend to keep browser traffic consistent and reduce CORS exposure.
- Removed production-like secret defaults from public configuration.
- Required
JWT_SECRETexplicitly in production/render profiles. - Required production
DB_PASSWORDandAPP_BASE_URLso the prod profile cannot silently fall back to local demo values. - Moved portfolio demo account passwords out of source defaults; Render generates demo passwords through environment values.
- Kept
.env, provider keys, database credentials, mail credentials, VNPay keys, Grok keys, and deploy hooks out of Git.
- Frontend auth state restores from cookies and
/users/meinstead of persisting the authenticated user object inlocalStorage. - Browser-managed auth cookies include
SameSite=Lax,path=/, and HTTPS-onlySecurebehavior when appropriate. - Email test endpoints are restricted to admin-authenticated users when the test controller is enabled.
- Chatbot statistics require admin authorization.
- Added frontend security headers for CSP, frame blocking, HSTS, and browser permissions policy.
- Aligned backend CSP and Permissions-Policy values across Spring Security and the global security header filter.
- Removed broad wildcard default CORS origins from backend security defaults.
- Hardened Next.js SVG image handling with
contentDispositionType: "attachment"and an image CSP that blocks scripts in served SVGs. - Replaced broad remote image patterns with explicit allowed hosts.
- Tightened request-body validation so chunked over-limit payloads are rejected instead of truncated silently.
- Skipped multipart body scanning in the input validation filter; upload validation is handled by
StorageService. - Hardened upload storage path resolution and delete handling so files must remain under the configured upload root.
- Kept
GROK_ENABLED=falseby default. - Shortened shared
RestTemplatetimeouts to reduce provider-related storefront stalls. - Recorded Grok fallback responses separately from provider-backed responses.
- Sanitized public chatbot health messages so provider failures do not expose raw exception text or provider URLs.
- Removed user email from the context sent to the chatbot provider; the prompt uses display name and order count only.
- Added same-origin API proxy fallback behavior for public storefront endpoints.
- Added portfolio-safe fallback payloads for public catalog proxy endpoints so Render cold starts do not surface avoidable
429or timeout responses on public pages. - Added frontend error reporting endpoint and client error reporter for lightweight operational visibility.
- Added generated PNG/ICO app icons so browser/PWA metadata does not depend only on the legacy SVG icon.
- Upgraded frontend runtime/tooling to Next.js 16, React 19, ESLint 9, and Vitest 4.
- Added a frontend
postcssoverride to keep Next's internal PostCSS dependency on the patched line. - Upgraded the mobile workspace to Expo SDK 55, React Native 0.83, and React 19.2.
- Added mobile dependency overrides for
postcssanduuid. - Removed unused legacy mobile dependencies after confirming there are no app imports.
Most recent local production audit:
npm run lint: passnpm run test:run: 150 tests passingnpm run build: passnpm audit --audit-level=moderate: 0 vulnerabilitiesnpm run test:e2e:portfolio-audit: 49 tests passingnpm run test:e2e:journey: 5 passing, 1 intentional mobile-only skipnpm run test:e2e:admin-portfolio: 6 tests passingnpm run monitor:health: frontend, backend, and databaseUPmvn -q -DskipTests compile: pass
- Move browser auth tokens to HttpOnly cookies with CSRF protection in a future auth-flow change.
- Tighten frontend CSP further by removing
unsafe-inlineandunsafe-evalonce the app has nonce/hash support for Next runtime scripts. - Keep
management.endpoint.health.show-details=when-authorizedor stricter in public environments. - Keep chatbot provider integration disabled unless
GROK_API_KEYis present and provider latency is acceptable. - Run a real Android/iOS EAS build before treating the mobile workspace as store-release ready.
- Rotate deploy hooks immediately if they are copied into screenshots, logs, tickets, or chat.
.envfiles with real credentials- Render deploy hook URLs
- JWT secrets
- Mail provider credentials
- VNPay credentials
- Grok or other AI provider API keys
- Production database URLs or passwords
- Exported user data, order data, or logs containing customer information