SEO Architecture
Each application type handles SEO differently:- @workspace/web (Next.js): Server-side metadata generation
- @workspace/spa (React): Client-side metadata management with Unhead
Next.js SEO (@workspace/web)
Meta Tags with createMetadata
Use thecreateMetadata helper to generate comprehensive metadata:
- Basic meta tags (title, description)
- Open Graph tags for social sharing
- Twitter Card metadata
- Apple Web App configuration
- Mobile-optimized tags
Generated Metadata
ThecreateMetadata function automatically includes:
Structured Data (JSON-LD)
Add structured data for better search engine understanding:Dynamic Open Graph Images
Generate dynamic OG images using the built-in API route:- Dynamic title rendering
- Light/dark mode detection
- Next.js and React logo variations
- 1200x630px (optimal for social platforms)
React SPA SEO (@workspace/spa)
Meta Tags with useSeo
The SPA uses theuseSeo hook for runtime metadata management:
Generated Metadata
TheuseSeo hook automatically generates:
Structured Data
The hook also creates JSON-LD structured data automatically:Sitemap Generation
Next.js (@workspace/web)
Next.js supports automatic sitemap generation:The sitemap will be automatically available at
/sitemap.xmlReact SPA (@workspace/spa)
For the SPA, generate the sitemap manually:scripts/gen-sitemap and updates public/sitemap.xml.
Robots.txt
Both applications should include arobots.txt file:
SEO Checklist
Page Metadata
Ensure every page has:
- Unique, descriptive title (50-60 characters)
- Compelling meta description (150-160 characters)
- Proper Open Graph tags
- Twitter Card metadata
Structured Data
Add JSON-LD structured data for:
- WebSite schema
- WebPage schema
- Breadcrumbs (where applicable)
- Article/BlogPosting (for content pages)
Images
Optimize social sharing images:
- Use 1200x630px for Open Graph images
- Include descriptive alt text
- Compress images for fast loading
Sitemap & Robots
Configure crawling:
- Generate and submit sitemap to search engines
- Configure robots.txt properly
- Set canonical URLs for duplicate content
Performance
See Performance for:
- Core Web Vitals optimization
- Loading performance
- Mobile responsiveness
Testing Tools
Rich Results Test
Test your structured data for Google Search
Schema.org Validator
Validate your JSON-LD structured data
JSON-LD Playground
Test and debug JSON-LD markup
OG Image Playground
Preview and test Open Graph images
Zhead Database
Discover new meta tags for SEO and performance
Twitter Card Validator
Validate Twitter Card implementation
Best Practices
Use descriptive, unique titles
Use descriptive, unique titles
Each page should have a unique title that accurately describes the content:
- ✅ “Product Analytics Dashboard | MyApp”
- ❌ “Dashboard | MyApp” (too generic)
- ❌ “MyApp” (not descriptive)
Write compelling descriptions
Write compelling descriptions
Meta descriptions should entice users to click:
- Include primary keywords naturally
- Clearly state the page’s value proposition
- Keep it between 150-160 characters
- Use active voice
Implement structured data correctly
Implement structured data correctly
Follow schema.org guidelines:
- Use appropriate schema types
- Include all required properties
- Validate with Google’s Rich Results Test
- Keep structured data up to date
Optimize for social sharing
Optimize for social sharing
Resources
Next.js Metadata
Official Next.js metadata documentation
Unhead
Document head management for React
Schema.org
Structured data vocabulary reference
Google Search Central
Google’s SEO and search documentation
