CROP

CROP Front

Next.js 16 customer-facing application for parts catalog, chat assistant, and marketing pages.

CROP Front

Repository: CT-CROP/CROP-front Last updated: 2026-02-28 Last synced to docs: 2026-03-10

Next.js 16 + React 19 application that powers the CROP parts catalog, chat assistant, and marketing entry points. The project runs on Node 22 with Bun for scripts/package management and leans on the App Router with cache components enabled.

Quick Start

bun install          # install deps
bun run dev          # start next dev (Turbopack)

Node 22.x is enforced through .nvmrc and package.json.

Useful Scripts

ScriptDescription
bun run buildProduction build (cache components + Turbopack).
bun run startServe the production build.
bun run lint / lint:fixBiome lint pass (optionally write fixes).
bun run formatBiome formatter.
bun run type-checktsc --noEmit.
bun testUnit tests (Vitest).
bunx vitest run --coverageUnit tests with coverage report.
bunx playwright testE2E suite.
bun benchmarkPerformance benchmarks (API response times).
bun run check:allFile-size check → architecture lint → Biome → type-check.

Architecture Snapshot

Routing

  • / is the AI Assistant home page with full-screen chat interface using vLLM backend.
  • /parts is an SSR catalog that calls unstable_noStore() so search/filter responses stay live.
  • /parts/[id] exports cache = "no-store" and fetches detail data through fetchPartById.

Search & Data Access

  • All catalog data comes from lib/search-service/client.tssearchParts, fetchFilters, fetchAutocomplete, getPartById, getPartBySlug.
  • lib/search-service/adapters.ts maps API payloads into the unified catalog shape.
  • Manufacturer metadata lives in lib/db/manufacturer-config.ts.

Caching & Invalidation

  • cacheComponents, cacheLife.quarterly, and cacheLife.navLong configured in next.config.ts.
  • Invalidate with bun run revalidate:tags -- nav:home.

Environment

  • lib/env.ts validates all env vars via Zod schema.

Testing

  • Unit Tests (Vitest): 93/97 passing (>90% coverage)
  • E2E Tests (Playwright): All critical flows passing
  • Performance Benchmarks: Search <200ms, Autocomplete <100ms targets

On this page