This version has breaking changes — APIs, conventions, and file structure may differ from training data. Read node_modules/next/dist/docs/ before writing code.
Next.js 16+ landing page for lead capture. TypeScript, Biome (lint/format), TailwindCSS v4, pnpm.
pnpm dev # Dev server
pnpm build # Production build
pnpm start # Production server
pnpm lint # Biome linter
pnpm biome check . # Lint + format check
pnpm biome format --write --organize-imports . # Auto-format + import org
npx tsc --noEmit # Type checksrc/app/ # App Router (page.tsx, layout.tsx, api/)
src/components/ # React components
ui/ # Base UI (Button, Input, Card...)
sections/ # Page sections (Hero, Footer...)
forms/ # Form components
chat/ # AI chat
src/lib/ # Utils, schemas, configs
src/db/ # Drizzle ORM schema
src/actions/ # Server actions
| Type | Convention | Example |
|---|---|---|
| Files | kebab-case | orcamento-form.tsx |
| Components | PascalCase | OrcamentoForm |
| Functions/Variables | camelCase | handleSubmit |
| Constants | SCREAMING_SNAKE | MAX_RETRIES |
| Types/Interfaces | PascalCase | LeadFormProps |
| React Props | camelCase | { name, email } |
- Always define explicit return types
- Use
interfacefor objects,typefor unions - Prefer
unknownoverany - Strict mode enabled
- Use
import typefor types,importfor values
// 1. React/Next 2. External libs 3. Internal @/* 4. Types
import { useState } from 'react';
import { useForm } from 'react-hook-form';
import { zodResolver } from '@hookform/resolvers/zod';
import { Button } from '@/components/ui/button';
import { leadSchema } from '@/lib/schemas';
import type { Lead } from '@/lib/types';- Indent: 2 spaces
- Line width: 80
- Quote: single (JS), double (JSX)
- Trailing commas: es5
- Semicolons: required
pnpm biome format --write --organize-imports .- Functional components (arrow or
function) - Use
use clientonly when needed - Keep components small and focused
- Extract logic to custom hooks
try {
const result = await createLead(data);
return { success: true, data: result };
} catch (error) {
console.error('Failed to create lead:', error);
return { success: false, error: 'Failed to submit lead' };
}- Always validate input with Zod
- Return typed success/error objects
- Use
use serverin action files
- Use Tailwind utilities
- Avoid custom CSS
- Use
cn()for conditional classes
'use client';
import { useForm } from 'react-hook-form';
import { zodResolver } from '@hookform/resolvers/zod';
import { leadSchema } from '@/lib/schemas';
export function OrcamentoForm() {
const form = useForm<z.infer<typeof leadSchema>>({
resolver: zodResolver(leadSchema),
});
// ...
}'use server';
import { db } from '@/lib/db';
import { leads } from '@/db/schema';
export async function createLead(data: z.infer<typeof leadSchema>) {
const validated = leadSchema.parse(data);
await db.insert(leads).values(validated);
}No test framework currently. If added: Vitest or Jest.
Run single test: vitest run --filter "test-name"
- Next.js 16 - Check breaking changes in
node_modules/next/dist/docs/ - Path aliases:
@/*maps to./src/* - Never commit secrets - use
.env.local - Run
pnpm biome check .before committing