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
.nvmrcandpackage.json.
Useful Scripts
| Script | Description |
|---|---|
bun run build | Production build (cache components + Turbopack). |
bun run start | Serve the production build. |
bun run lint / lint:fix | Biome lint pass (optionally write fixes). |
bun run format | Biome formatter. |
bun run type-check | tsc --noEmit. |
bun test | Unit tests (Vitest). |
bunx vitest run --coverage | Unit tests with coverage report. |
bunx playwright test | E2E suite. |
bun benchmark | Performance benchmarks (API response times). |
bun run check:all | File-size check → architecture lint → Biome → type-check. |
Architecture Snapshot
Routing
/is the AI Assistant home page with full-screen chat interface using vLLM backend./partsis an SSR catalog that callsunstable_noStore()so search/filter responses stay live./parts/[id]exportscache = "no-store"and fetches detail data throughfetchPartById.
Search & Data Access
- All catalog data comes from
lib/search-service/client.ts→searchParts,fetchFilters,fetchAutocomplete,getPartById,getPartBySlug. lib/search-service/adapters.tsmaps API payloads into the unified catalog shape.- Manufacturer metadata lives in
lib/db/manufacturer-config.ts.
Caching & Invalidation
cacheComponents,cacheLife.quarterly, andcacheLife.navLongconfigured innext.config.ts.- Invalidate with
bun run revalidate:tags -- nav:home.
Environment
lib/env.tsvalidates 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