Next.js Blog with microCMS

Next.js Blog with microCMS
Type: Code
Framework: Next.js
CSS: CSS Modules

Configuration Steps:

  1. microCMS Account and Service:
    • Sign up for microCMS.
    • Create a new service on the dashboard, selecting “Create your own” with a custom Service Name and ID.
  2. API Creation:
    • Tag API: For blog tags, accessible at /create-api. Requires a name field.
    • Writer API: For author information, accessible at /create-api. Includes fields for name, profile, and image.
    • Blog API: For blog content, accessible at /create-api. Includes fields for title, description, content, thumbnail, tags, and writer.
  3. Content Entry:
    • Populate content for tag, writer, and blog APIs in the specified order.

Running Locally:

  • API Key: Retrieve the “default” API Key from the microCMS dashboard under “/api-keys”.
  • Environment Variables: Create a .env.local file with MICROCMS_API_KEY, MICROCMS_SERVICE_DOMAIN, and BASE_URL.
  • Development Server:
    • Ensure Node.js version 18+ is installed.
    • Install dependencies with npm install.
    • Run the server using npm run dev and access the app at http://localhost:3000.

Deployment:

  • Import your project to Vercel and configure environment variables (MICROCMS_API_KEY, MICROCMS_SERVICE_DOMAIN, BASE_URL).
  • Deploy directly from the provided template by setting the required environment variables.

Appendix:

  • Page Preview: Setup in microCMS “API Settings > Page Preview” for the Blog API to preview draft content.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.