Simple Blog with microCMS
This is an official microCMS simple blog template.
This blog is built using microCMS, a headless CMS made in Japan, and Next.js.
This template supports authoring and editing the following blog content and information:
- Blog details
- Writer
- Tags
Demo
https://simple-blog-with-microcms.vercel.app/
Configuration
Create an account and a service on microCMS
- Create an account on microCMS.
- Create a new empty service from the dashboard. When creating the service, please select "Create your own".
- Enter any value you like for Service Name and Service ID.
- You now have a new service created that you can access!
Create APIs
You will need to create three APIs, all in the list format.
Create tag API.
The tag API is for creating tags associated with blog content. Blog content can have multiple tags set within the tag API.
- Go to
/create-api(https://your-service-id.microcms.io/create-api) and select "Create your own". - Enter basic API information:
- API Name: tag
- Endpoint: tags
- Select API Type and choose List Format.
- Define API Schema. The
tagAPI has one field:name- Text Field. Field ID and Display Name should be set toname.
- Click "Create" and continue.
Create writer API
The writer API is for creating author information and associating it with each blog article. A blog article can only have one writer set in the writer API.
- Go to
/create-api(https://your-service-id.microcms.io/create-api) and select "Create your own". - Enter basic API information:
- API Name: writer
- Endpoint: writers
- Select API Type and choose List Format.
- Define API Schema. The
writerAPI has three fields:name- Text Field. Field ID and Display Name should be set toname.profile- Text Area. Field ID and Display Name should be set toprofile.image- Image Field. Field ID and Display Name should be set toimage.
- Click "Create" and continue.
Create blog API
The blog API is for creating blog content.
- Go to
/create-api(https://your-service-id.microcms.io/create-api) and select "Create your own". - Enter basic API information:
- API Name: blog
- Endpoint: blog
- Select API Type and choose List Format.
- Define API Schema. The
blogAPI has six fields:title- Text Field. Field ID and Display Name should be set totitle.description- Text Area. Field ID and Display Name should be set todescription.content- Rich Text Editor. Field ID and Display Name should be set tocontent.thumbnail- Image Field. Field ID and Display Name should be set tothumbnail.tags- Multiple Content References - tag. Field ID and Display Name should be set totags.writer- Content Reference - writer. Field ID and Display Name should be set towriter.
- Click "Create" and continue.
Enter Content
-
Enter content for the
tagAPI,writerAPI, andblogAPI. Since thetagAPI andwriterAPI are referenced from theblogAPI, please create theblogAPI content last. -
Go to the
/apis/[tags|writers|blog]/createendpoint, click "+ Add", enter content for each of the following and click publish:
tag
- You just need 1 tag content.
- Use dummy data for the text.
writer
- You just need 1 writer content.
- Use dummy data for the text and image.
blog
- You just need 1 blog content.
- Use dummy data for the text and image.
Running locally
Retrieve API Key
- From the top page of the dashboard, Go to "/api-keys".
- Copy and retrieve the value of the "default" API Key.
This API key will be used to make requests to microCMS from Next.js.
Set environment variables
Create a .env.local file in the root of the project and enter the following microCMS values:
MICROCMS_API_KEY=xxxxxxxxxxMICROCMS_SERVICE_DOMAIN=xxxxxxxxxxBASE_URL=xxxxxxxxxx
MICROCMS_API_KEY: Retrieve the API key from the microCMS dashboard under "Service Settings > API Keys".MICROCMS_SERVICE_DOMAIN: Retrieve the service domain from the microCMS dashboard URL (https://xxxxxxxx.microcms.io).BASE_URL: The deployment URL and protocol. For example:- Development: http://localhost:3000
- Production: https://xxxxxxxx.vercel.app
Run the local development server
This application requires Node.js version 24 or later.
- Install package dependencies
npm install
- Launch the local development web server
npm run dev
- Open http://localhost:3000 in your browser and access your local application!
Deploy your project to Vercel
- Import your repository from GitHub, GitLab, or Bitbucket.
- Click on the environment variables and set
MICROCMS_API_KEY,MICROCMS_SERVICE_DOMAINandBASE_URL. - Click Deploy!
Deploy from Our Template
Alternatively, you can deploy our template by clicking on the Deploy button at the top of this page and setting the same environment variables.
About the Node.js version
This template assumes Node.js 24 or later.
Node.js receives regular security updates. For security reasons, we recommend using the latest patch version of the major version you are using (e.g. 24.x).
For the latest security information, please refer to: https://nodejs.org/en/blog/vulnerability/
Appendix
Page Preview Settings
In order to preview draft content, a page preview must be set up in the microCMS administration page.
Set the following in "API Settings > Page Preview" of the Blog API.
Replace your-domain with your deployed domain. (It also works with localhost)
Once set, the page preview button will be available on the content editing page.


