Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Pulse Wall: I Let Sanity Run My Repost Marketplace's Content

说明与用途

作者用 Sanity 替换了复杂的后端,实现了无需重新部署即可实时更新内容,使用 Next.js 和 Render。

问题

Repost marketplace needed a content layer that could be edited without redeploying the site, but the existing backend was too complex to replicate.

结果

The author successfully replaced a complex backend with a Sanity content layer, enabling live content updates without redeploys and simplifying the deployment pipeline.

工作流

  • 1. Point Claude Code at the existing Pulse repo and instruct it to reuse the Next.js UI.
  • 2. Strip out backend‑coupled code (auth, wallet, Paystack, Go API).
  • 3. Define two Sanity schemas: campaign (with vibeScore) and spotlight.
  • 4. Embed Sanity Studio into the Next.js app at /studio using next‑sanity.
  • 5. Add CORS origins (localhost and Render URL) with credentials allowed to resolve Studio load errors.
  • 6. Move export const dynamic = "force-dynamic" into page.tsx to enable runtime revalidation of Sanity data.
  • 7. Deploy the single app to Render using a render.yaml blueprint.
  • 8. Add a GitHub Actions workflow to ping the free‑tier instance every 5 minutes to keep it awake.

证据

After publishing new campaigns in Studio, they weren't showing up on the live site. Turned out Next.js route segment config (revalidate/dynamic) only takes effect in page.tsx/layout.tsx files, not in an arbitrary component I'd put it in.

来源

CORS. Sanity blocks Studio API calls from origins it doesn't recognize, so both localhost and the deployed Render URL had to be explicitly added as CORS origins with credentials allowed before Studio would even load.

来源

  • 记录日期: 2026-09-21T21:30:28.115Z