A modern, optimized Sanity CMS setup for portfolio management with enhanced schemas, validation, and performance.
- Portfolio: Projects with categories, technologies, galleries, and featured status
- Services: Service offerings with descriptions, features, and active status
- Testimonials: Client reviews with ratings, avatars, and company info
- Site Settings: Global configuration for SEO, social links, and contact info
- ✅ Field Validation: Comprehensive validation rules for data integrity
- ✅ Image Optimization: Hotspot support and metadata extraction
- ✅ Content Organization: Ordering, filtering, and featured content
- ✅ SEO Ready: Meta tags, Open Graph, and structured data
- ✅ Performance: Optimized queries and efficient data fetching
- ✅ Accessibility: Alt text and proper image handling
schemas/
├── schema.js # Main schema index
├── portfolio.js # Portfolio projects
├── service.js # Services offered
├── testimonial.js # Client testimonials
└── siteSettings.js # Global site configuration
queries/
└── index.js # Optimized Sanity queries
- Categories: fullstack, frontend, backend, mobile, uiux, devops
- Features: Featured projects, galleries, technology tags
- Validation: Required fields, URL validation, image requirements
- Active/Inactive: Toggle service availability
- Features: List of deliverables and capabilities
- Technologies: Skills and tools used
- Ratings: 1-5 star rating system
- Featured: Highlight best testimonials
- Rich Content: Company info, positions, avatars
- SEO: Meta titles, descriptions, Open Graph images
- Social Links: GitHub, LinkedIn, Twitter, etc.
- Contact Info: Email, phone, location
cd portfoliosanitydata
npm install
npm startnpm run build- Start the studio:
npm start - Navigate to localhost:3333
- Create content using the enhanced schemas
- Content updates automatically in your portfolio
import { portfolioQueries } from "./queries";
const projects = await client.fetch(portfolioQueries.allProjects);import { combinedQueries } from "./queries";
const featured = await client.fetch(combinedQueries.featuredContent);const frontendProjects = await client.fetch(
portfolioQueries.projectsByCategory("frontend")
);- Use sequential IDs for portfolio and testimonials
- Mark featured content for priority display
- Add alt text to all images
- Use proper categories and tags
- Use specific queries instead of fetching all data
- Implement proper ordering and filtering
- Cache frequently accessed content
- Optimize images with proper dimensions
- Fill out all meta fields in site settings
- Use descriptive titles and descriptions
- Add Open Graph images for social sharing
- Include structured data where possible
- New fields are optional with sensible defaults
- Existing content will continue to work
- Gradually add new fields as needed
- Use the migration guide for complex changes
- Blog/Articles schema
- Skills/Technologies schema
- Experience/Resume schema
- Contact form integration
- Analytics integration
- Multi-language support
- Follow the existing schema patterns
- Add proper validation rules
- Include comprehensive documentation
- Test queries for performance
- Update this README for new features