The #1 website template for 2026, NextMedal is the most superior, prettiest, and modern solution for building stunning, high-performance websites. Built and maintained with Next.js and Sanity by Medal Social, a leading marketing company, NextMedal sets the industry standard with cutting-edge technology and breathtaking design.
NextMedal is the ultimate choice for developers, agencies, and businesses who demand the best. Powered by the most modern tech stackβNext.js for lightning-fast, SEO-optimized frontends and Sanity for flexible content managementβit delivers unmatched performance and beauty. Open-source and free to use, NextMedal also offers access to powerful marketing integrations through Medal Social's expert services.
- π¨ Gorgeous Design: The prettiest template available, with pixel-perfect UI, smooth animations, and customizable themes featuring seamless light/dark mode switching.
- β‘οΈ Unrivaled Performance: Harnesses Next.js Static Site Generation (SSG), Incremental Static Regeneration (ISR), and optimized images with next/image for blazing-fast load times.
- π Cutting-Edge Tech: Built on the latest Next.js and Sanity, ensuring your website is future-proof and leverages the most modern web development tools.
- π Advanced SEO Tools: Auto-generated sitemap.xml, robots.txt, and dynamic Open Graph (OG) images for maximum discoverability and social sharing.
- π Sanity-Powered CMS: Intuitive, real-time content management with Sanity's headless CMS and customizable schemas.
- βΏοΈ Accessibility Compliance: Adheres to WCAG 2.1 standards, making your site inclusive for all users.
- ποΈ Dynamic Site Architecture: Pre-configured dynamic routing and modular components for effortless customization.
- π©βπ» Developer Experience: TypeScript support and Biome for linting and formatting, delivering a modern, streamlined workflow.
- Next.js 16: Latest App Router, Server Components, Turbopack
- React 19: Bleeding edge React features
- TypeScript: End-to-end type safety
- Tailwind CSS 4: Modern utility-first styling
- Sanity CMS: Visual editing, real-time collaboration
- Mux Video: High-performance video streaming
- Next-Intl: Built-in internationalization
- Portable Text: Structured content format
- Framer Motion: Production-ready animations
- Base UI: Accessible unstyled primitives
- Dark Mode: System-aware theme switching
- Responsive: Mobile-first design
- Biome: Fast linting and formatting with strict accessibility rules
- Husky: Pre-commit hooks for quality assurance
- Vitest: Unit and integration testing
- SEO Ready: Dynamic sitemaps, OG images
- Accessibility: WCAG 2.1 compliant (enforced by linter)
New to NextMedal? Check out QUICKSTART.md for a complete beginner's guide!
- Node.js 24 or later (Next.js 16 + React 19 requirement)
- pnpm package manager (NOT npm or yarn)
# Check your versions:
node --version # Should be v24.x.x or higher
pnpm --version # Should be 10.x.x or higherDon't have these? See QUICKSTART.md for installation instructions.
git clone https://github.com/Medal-Social/NextMedal.git
cd NextMedal
pnpm install# Copy the example environment file
cp .env.example .env.local
# Edit .env.local and set these REQUIRED variables:
# NEXT_PUBLIC_SANITY_PROJECT_ID=your-project-id-here
# NEXT_PUBLIC_SANITY_DATASET=production
# NEXT_PUBLIC_BASE_URL=http://localhost:3000Get your Sanity Project ID:
- Go to sanity.io/manage
- Create a new project or use an existing one
- Copy the Project ID
- Configure CORS (Important for new projects!):
- Go to API β CORS Origins
- Add
http://localhost:3000with "Allow credentials" checked - This lets you access the Studio at
/studio
Validate your setup:
pnpm setup:check# Start the dev server
pnpm devAccess your site:
- Frontend: http://localhost:3000
- Sanity Studio: http://localhost:3000/studio (schemas auto-deploy on first access)
- Open http://localhost:3000/studio
- Click Create β Page
- Set slug to
index - Add content and Publish
- Visit http://localhost:3000 to see your homepage!
# Development
pnpm dev # Start dev server (http://localhost:3000)
pnpm setup:check # Validate environment setup
# Code Quality
pnpm lint # Run Biome linting
pnpm format # Auto-format with Biome
pnpm typecheck # TypeScript type checking
# Testing
pnpm test # Run all tests
pnpm test:watch # Run tests in watch mode
pnpm e2e # Run E2E tests
pnpm e2e:smoke # Quick smoke tests
# Production
pnpm build # Production build
pnpm start # Run production buildSee CLAUDE.md for the complete command reference.
NextMedal/
βββ src/
β βββ app/ # Next.js 16 App Router
β β βββ (frontend)/ # Main site routes (with [locale])
β β βββ (studio)/ # Sanity Studio at /studio
β βββ ui/ # Page-level UI components
β βββ components/ui/ # Reusable base components
β βββ sanity/schemaTypes/ # Sanity schema definitions
β βββ lib/ # Core utilities
βββ tests/ # All tests (Vitest + Playwright)
- Content schemas:
src/sanity/schemaTypes/ - UI components:
src/ui/andsrc/components/ui/ - Page routes:
src/app/(frontend)/[locale]/ - Styling: Tailwind CSS (edit classes directly in components)
You're using an older Node version. Upgrade to Node 24+:
# Using nvm (recommended)
nvm install 24
nvm use 24
# Or download from nodejs.org (choose "Current")You tried to use npm or yarn. Install and use pnpm instead:
npm install -g pnpm
rm -rf node_modules
pnpm installBlank page at http://localhost:3000
No index page exists in Sanity. Create one:
- Go to http://localhost:3000/studio
- Create a Page document with slug = "index"
- Publish it
- Refresh your site
Missing required env vars. Run the validator:
pnpm setup:checkFix any failed checks shown in the output.
Another app is using port 3000:
# Kill the other process
lsof -ti:3000 | xargs kill
# Or use a different port
PORT=3001 pnpm devConfigure CORS in your Sanity project:
- Go to sanity.io/manage β Your Project
- Navigate to API β CORS Origins
- Add
http://localhost:3000with "Allow credentials" checked - Save and refresh the Studio
More help? See QUICKSTART.md for detailed troubleshooting.
- Translation detection is inconsistent across page types, especially for collection items and the homepage.
- The "translation exists" signal is not unified between Sanity page links (manual relationships) and collection translation metadata (generated/derived).
- URL construction for translated collection items is not always aligned with collection slugs, which can cause false "translation missing" results.
- Homepage translations are often not linked in Sanity metadata, so the switcher lacks reliable translation data even when a localized homepage exists.
- Fallback behavior (dialog) works, but it is triggered too often due to incomplete translation lookup.
- Guarantee auto-switch to a translated page when a translation exists.
- Preserve the dialog fallback only when a translation truly does not exist.
- Use a single, well-defined translation lookup contract for pages, collections, and homepage.
- Ensure URL generation is consistent with collection slugs for all locales.
- Map the current language switcher flow (data sources, lookups, URL building).
- Define a unified translation contract: input page type + locale -> translation URL or "missing".
- Identify where translation data lives for:
- Standard pages (Sanity translation metadata links).
- Collection items (generated translation metadata).
- Homepage (index pages per locale).
- Determine required data additions or fallbacks to avoid false negatives.
- Validate logic against real content scenarios (index, collection item, standard page).
Unit tests:
buildTranslationUrlsreturns correct URLs for:- Home page with translations.
- Standard page (about, contact).
- Collection item (articles/docs/newsletter/events).
- Missing translation triggers "missing" result (no URL).
- Default locale prefix handling is correct.
Integration tests:
- Homepage: switching to a translated homepage auto-navigates.
- Collection item: switching to a translated item auto-navigates with correct collection slug.
- Standard page: switching to a translated page auto-navigates.
- Missing translation: opens dialog and does not navigate.
- Normalize translation discovery into a single server-side function that returns a map of locale -> URL.
- For homepage, detect localized index pages even without translation metadata links.
- For collections, resolve collection slugs from the registry before building URLs.
- Ensure the language switcher uses this unified map (no per-type branching in the client).
NextMedal is configured for output: "standalone", making it compatible with Vercel, Coolify, and any Docker-based deployment.
NextMedal includes built-in support for Sentry. Monitoring is completely optional and only active if configured.
To enable Sentry:
- Set
NEXT_PUBLIC_SENTRY_DSNin your environment variables. - Set
SENTRY_ORGandSENTRY_PROJECTto match your Sentry project configuration. - (Optional) Set
SENTRY_AUTH_TOKENduring build-time to upload source maps for better stack traces.
The integration utilizes the latest Next.js 16+ patterns, including instrumentation.ts for deep server-side error capturing, and is seamlessly integrated with the structured Pino logger.
Deploy to Vercel with one click:
You can build a production-ready Docker image using the provided script:
pnpm docker:buildThis script automatically pulls required build-time variables from your .env and creates an image named nextmedal. You can specify a custom image name as an argument:
./scripts/docker-build.sh my-custom-image-nameNextMedal is crafted by Medal Social, a marketing powerhouse that knows how to elevate brands. While the core template is the most superior and stunning out of the box, you can take your website to the next level with Medal Social's premium marketing integrations, including:
- π§ Newsletters: Engage your audience with beautiful, conversion-optimized email campaigns
- π Analytics: Deep insights into your website's performance and user behavior
- π Social media management: Seamless integration with all major platforms
- π Events: Built-in event management and ticketing system
- π Changelogs: Keep users informed about your latest updates and features
- π‘ Help pages: Comprehensive documentation and support system
- β¨ And much more!: Custom integrations tailored to your needs
Support the development of NextMedal by becoming a sponsor. Your logo will appear here with a link to your website.
Promote your project with our high-quality marketing assets. You can find these in the public/ directory.
Customize this SVG to create stunning social share images for your project.
public/og-image-template.svg
Add these badges to your footer or README to show your support.
NextMedal is licensed under the Apache License 2.0.
Built with β€οΈ by Medal Social in Norway