Codync
免费开源的 1:1 Grok Bot 与 Muse 替代方案。可在 iPhone、Mac 或 Linux 桌面上将 Claude 代码、Codex、Cursor 以及 40 多个编码代理作为持久机器人使用。支持群组聊天、线程、应用。
AI 翻译
The most superior template for building your Sanity & Nextjs site
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗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.
MUX_ENABLED in src/sanity/lib/mux.ts to add the Mux plugin and video sourceNew to NextMedal? Check out QUICKSTART.md for a complete beginner's guide!
⚠️ This project requires:
# Check your versions:
node --version # Should be v24.x.x or higher
pnpm --version # Should be 10.x.x or higher
Don'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:3000
# Needed for forms (contact, newsletter, event registration):
# MEDAL_API_KEY=your-medal-api-key
Form submissions go to Medal Social only, through
@medalsocial/sdk — nothing is stored in Sanity, whose dataset is public.
Without MEDAL_API_KEY the forms tell visitors their message couldn't be sent.
The key needs the scopes read:contacts and write:contacts (dotted:
crm.contact.read, crm.activity.read, write:contacts, crm.contact.note.create).
Get your Sanity Project ID:
http://localhost:3000 with "Allow credentials" checked/studioValidate your setup:
pnpm setup:check
# Start the dev server
pnpm dev
Access your site:
index# 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 build
See 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)
src/sanity/schemaTypes/src/ui/ and src/components/ui/src/app/(frontend)/[locale]/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 install
No index page exists in Sanity. Create one:
Missing required env vars. Run the validator:
pnpm setup:check
Fix 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 dev
Configure CORS in your Sanity project:
http://localhost:3000 with "Allow credentials" checkedMore help? See QUICKSTART.md for detailed troubleshooting.
Unit tests:
buildTranslationUrls returns correct URLs for:
Integration tests:
NextMedal is configured for output: "standalone", making it compatible with Vercel, Coolify, and any Docker-based deployment.
Deploy to Vercel with one click:
You can build a production-ready Docker image using the provided script:
pnpm docker:build
This 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-name
The script resolves a stable deployment ID on the host before Docker excludes
.git: NEXT_DEPLOYMENT_ID, then GITHUB_SHA, then the checked-out commit.
For a source archive without Git metadata, supply the release ID explicitly:
NEXT_DEPLOYMENT_ID=release-2026-09-19 pnpm docker:build
Use a different ID when rebuilding the same commit with different content or
environment values. When invoking Docker directly (including external CI), pass
--build-arg NEXT_DEPLOYMENT_ID="$GITHUB_SHA" alongside the existing Sanity/site
arguments. NEXT_DEPLOYMENT_ID is a public build identifier, not a secret, and
must be present in the build stage; setting it only when starting the image is
not sufficient. Missing IDs fail before an archive build invokes Docker.
NextMedal 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:
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.
Banner
NextMedal is licensed under the Apache License 2.0.
Built with ❤️ by Medal Social in Norway
The Worker blocks malformed or sensitive paths before routing, and canonical-origin redirects preserve the path and query while replacing protocol, hostname, and port. Locale redirects remain on the original origin even when a path has repeated slashes.
Missing static assets return a direct 404. HTML, XML, and JSON document slugs are resolved by the CMS route after a static-asset miss; the application returns 404 when the document is absent. Existing assets and explicit feed routes retain precedence.
OG image responses have a five-second deadline. The Worker passes an abort-aware
request to OpenNext and cancels late response bodies. Cancellation is cooperative:
imports and CPU-bound rendering cannot be forcibly interrupted. Renderer/stream/deadline
failures are logged with their phase; request query strings are not logged by this
boundary. If rendering or the fallback asset lookup fails, the final recovery is a
redirect to /og-fallback.png.
Outside Cloudflare, OG font HTTP loading requires a valid NEXT_PUBLIC_BASE_URL
deployment origin. It never uses the incoming Host, rejects redirects, and caps
font/logo bodies at 2 MiB. Missing settings skip optional fonts.