This is a Next.js website migration project following modern React/TypeScript best practices. The codebase emphasizes maintainability and simplicity over premature optimization.
- Avoid over-engineering - Don't create separate files/abstractions for single-use items
- Prefer collocation - Keep related code together rather than spreading across multiple files
- Question abstractions - Only extract when there's genuine reuse across multiple files
- ESLint + Prettier for consistent formatting
- TypeScript for type safety with inference over explicit types
- Husky pre-commit hooks to catch issues early
- Meaningful naming over cryptic class names (replace WebFlow-generated names)
src/
├── app/ # Next.js app router pages
├── components/ # Reusable UI components
├── lib/ # Utility functions and configurations
└── types/ # TypeScript type definitions (only when shared)
- App Router for modern React patterns
- TypeScript with strict config for reliability
- Inter font for design system consistency
- Diagnose before fixing — when something looks wrong, find the root cause (e.g. a flex container forcing shrink) rather than layering on overrides or hacks; the right fix is usually fewer lines, not more
- Take extra care with CSS — clean, minimal CSS is a top priority; write as few lines as possible and always review
docs/css-guidelines.mdbefore writing styles - Constraint-based design system — always use utility classes from
globals.cssfirst - CSS variables for all colors — never hardcode hex values
- Base HTML elements (
h1–h3,p) are pre-styled — don't write heading/typography CSS - Utility classes for typography (
paragraph-small,paragraph-xs), colors (color-teal-300), spacing (padding-bottom-24px,margin-top-16px), layout (flex,gap-16px,width-6-col,container-default), display (hide-mobile,cursor-pointer), and shadows (drop-shadow) - Pre-built components:
.button-primary/.button-secondaryfor buttons,.text-field/.checkboxfor forms - New classes only when utility classes can't solve the problem — put them in
ComponentName.module.css(one component),page.module.css(one page), or rarelyglobals.css(truly reusable) - Never create one-off override classes — if a component style needs adjusting for a common pattern (e.g. buttons with icons), fix it at the design system level in
globals.cssso all future instances work automatically - Media queries are handled in
globals.css— only write custom breakpoint styles for explicit overrides
- package-lock.json is critical - always commit
- Node version pinning via .nvmrc for team consistency
- Minimal dependencies - prefer built-in solutions when possible
- Extract shared elements first (navigation, background, layout)
- Keep complex CSS intact - don't try to recreate WebFlow's intricate styles
- Replace simple utilities with
globals.cssutility classes where beneficial - Preserve exact colors - use CSS variables, never hardcode hex values
- Component composition over inheritance
- Props destructuring for cleaner interfaces
- Semantic HTML with proper alt text for accessibility
- File-based routing for predictable URL structure
- Lint early, lint often - fix issues immediately
- Type safety catches bugs before runtime
- Small, focused commits with clear messages
- Test changes locally before committing
- Grep tool failure: If the Grep tool returns "No matches found" for patterns that clearly exist, use
grepvia Bash tool instead. This appears to be due to a missing ripgrep binary that fails silently. (Note: This may be specific to certain development environments and not apply to all users of this repository.)
- Use the same HTML tag for shared classes. When a utility class like
button-primaryis used across the site, prefer using the same element type (e.g. always<a>/<Link>) to avoid browser-default style differences (borders, padding, etc.).
- Hover transitions: All hover transitions use
var(--hover-transition)defined in:root(0.1s ease-in-out). Never hardcode transition values. - Card hover color: Uses
color-mix(in srgb, var(--teal-850) 60%, var(--teal-800))— subtle shift using existing palette colors. - White button hover: Darkens to
var(--off-white)— never use opacity reduction.
- Design tokens & global classes:
src/app/globals.css - Communities map:
src/app/communities/CommunitiesMap.tsx - Communities page:
src/app/communities/page.tsx - Field map page:
src/app/map/page.tsx
// Simple, focused components
interface Props {
// Minimal, specific props
}
export default function Component({ prop }: Props) {
// Local constants at top
const localData = [...]
return (
// JSX with semantic HTML
)
}// Use globals.css utility classes — only add custom classes when utilities can't solve it
<div className="flex items-center gap-16px padding-bottom-24px">
<p className="paragraph-small color-teal-300">Muted small text</p>
<a className="button-primary">Get Started</a>// Prefer inference over explicit typing
const items = [...] // TypeScript infers the type
// Only add explicit types when sharing across files- Monitor bundle size as features are added
- Consider code splitting for large pages only when needed
- Performance optimization should be measurement-driven, not premature
- Documentation should focus on "why" not "what"
- Consistent patterns across similar components
- Regular dependency updates to avoid security issues
- Onboarding docs should emphasize the simplicity philosophy
- Code reviews should question complexity, not just correctness
- Shared understanding of when to extract vs. keep inline
Remember: The best code is often the simplest code that solves the problem effectively.