
Strapi is a headless CMS: the admin panel manages content models, editing, permissions, and APIs, while your website or app controls presentation. The first important decision is not which plugin to install. It is whether your content should be a Collection Type, Single Type, Component, or Dynamic Zone.
This guide uses Strapi 5 concepts. Older Strapi 4 examples may use different response shapes and extension paths.
Create a Strapi 5 project
Prepare a supported Node.js version and database environment, then run:
npx create-strapi@latest my-cms
cd my-cms
npm run develop
The quickstart path is fine for local exploration. For a real project, decide the database, deployment environment, and upgrade strategy early. After the first start, create an admin account. The admin UI language is a personal preference; it does not control API content locale.
Collection Type
Use a Collection Type for repeatable independent entities such as articles, authors, products, and categories.
Example Article fields:
title: Text, requiredslug: UID based on titleexcerpt: Textcontent: Rich Text or Blockscover: Media, single imageauthor: Relation to Authorcategory: Relation to Category
If content needs its own URL, permissions, publication state, or relations from other content, it usually belongs in a Collection Type.
Single Type
Use a Single Type for content that exists only once:
- site settings
- homepage configuration
- about page content
- global SEO defaults
Do not put every setting into one huge Single Type. Split settings when ownership, release timing, permissions, or front-end usage differs.
Component
A Component is a reusable group of fields embedded inside another document. It is not an independent content entity.
Good examples:
SEO Component
├── metaTitle
├── metaDescription
├── shareImage
└── noIndex
Use Components for repeated field groups such as SEO data, address blocks, CTA buttons, or image captions.
If content must be updated once and reflected across many articles, use a Relation instead of copying a Component into each document.
Dynamic Zone
Dynamic Zones let editors compose a page from flexible blocks such as hero sections, quote cards, FAQ blocks, and image-text sections.
They are powerful for landing pages and modular content, but they increase front-end rendering branches. Use them when editors truly need block-level freedom. Do not add Dynamic Zones to a simple article model only because "maybe we will need it later."
Five modeling questions
Before creating fields, answer:
- Is this content single or repeatable?
- Does it need its own URL, permissions, or publication state?
- Should data be copied into each document or shared by reference?
- Do editors need to freely reorder content blocks?
- Which fields and relations do list and detail pages actually need?
A small relationship sketch before modeling is safer than repeatedly changing fields after real content exists.
Publish content and test permissions
After creating and publishing an article, test:
GET http://localhost:1337/api/articles
If the response is 403, the endpoint may exist but the Public role lacks read permission. Enable only the required public actions such as find and findOne, or use a limited API Token from your server-side application.
Do not give the Public role create, update, or delete permission just to make local testing pass.
Why relations are missing
Strapi REST API does not automatically expand relations, media, components, and dynamic zones. Use populate:
GET /api/articles?populate[cover]=true&populate[author]=true
Avoid keeping populate=* in production page queries. For details, read Strapi 5 Populate Guide: Relations, Media, and Nested Queries.
Production checklist
- Use persistent database storage and backups.
- Inject
.env, API tokens, and database credentials through the deployment environment. - Keep Public role permissions minimal.
- Add pagination and field limits to list APIs.
- Store media in production-safe persistent storage.
- Read migration docs and back up the database before major upgrades.
Related FreeMac guides
- For Strapi relations and media, read Strapi 5 Populate Guide: Relations, Media, and Nested Queries.
- For Next.js integration, read Next.js with Strapi 5: Fetching, Cache, and Security.
- For backend deployment, read Nginx Reverse Proxy Guide: proxy_pass, Headers, WebSocket, and Logs.
Continue reading
Strapi 5 Populate Guide: Relations, Media, and Nested Queries
Use Strapi 5 REST populate correctly for relations, media, components, nested queries, field selection, qs query builders, and safer production response sizes.
7 min readNestJS Decorators: Class, Method, and Parameter Decorators
Understand NestJS decorators by separating class decorators like Controller and Injectable, method decorators like Get and Post, and parameter decorators like Body, Param, and Query.
11 min readDockerfile and .dockerignore for Node.js Apps
Build cleaner Node.js Docker images by controlling the build context, using cache-friendly COPY order, applying multi-stage builds, and keeping secrets out of image layers.
Subscribe to FreeMac
Weekly picks: free Mac software reviews, trusted source updates, alternatives, and low-friction guides.