Repository Guidelines
Project Structure & Module Organization
- Next.js App Router lives in
src/app;layout.tsxwires global styles,page.tsxrenders the snow forecast shell, andglobals.cssholds global styles. - Reusable UI sits in
src/components; mark interactive pieces with'use client'(e.g.,CustomChart.tsxuses MUI X Charts). - Data fetching and server actions belong in
src/data;getWeatherData.tsxpulls NOAA snowfall data with a 10s revalidate window and the required user agent header. - Keep feature-specific assets near their feature; prefer co-locating helpers beside the component that consumes them.
Build, Test, and Development Commands
npm run dev— start the local dev server athttp://localhost:3000.npm run build— production build for CI or preview.npm run start— serve the built app.npm run lint— Next/ESLint checks; run before pushing to catch style and safety issues.
Coding Style & Naming Conventions
- TypeScript-first; default to server components, add
'use client'only when browser APIs or client-only libraries (MUI X Charts) are needed. - Components and React files use PascalCase filenames (
CustomChart.tsx); helpers and server utilities use camelCase (getWeatherData). - Never use
useMemo,useCallback, orReact.memo(). React Compiler automatically applies the optimal memoization, ensuring the app only re-renders when necessary. - Favor concise functions, async/await for data access, and keep fetch headers/caching explicit.
- Use MUI components +
sxfor layout/styling; keep global styles minimal and scoped throughglobals.csswhen necessary. - Follow ESLint defaults (run
npm run lint); keep imports ordered by origin (React/Next → third-party → local).
Testing Guidelines
- No tests exist
- For now, verify changes by running eslint, use MCP if available
- When testing data code, capture a fixture of the NOAA response to avoid network flakiness.