MayR Labs Internal: Next.js Standards
File Structure (STRICT)
Each route must follow:
/route
page.tsx
_components/
_hooks.ts
_constants.ts
_types.ts
_utils.ts
Rules
page.tsxmust be thin (composition only)- Business logic → hooks or services
- Components:
- Dumb (UI) vs Smart (logic) separation
- As much as possible, always use data files at
@/lib/data/**.tsto define data used in applications
Rendering
- Prefer Server Components by default
- Use Client Components only when necessary:
- interactivity
- browser APIs
SEO (MANDATORY)
- Every page must define:
metadata- proper titles & descriptions
- No lazy SEO. Ever.
Source: MayR-Labs/skills — distributed by TomeVault.