# Strapi — Leading Open Source Headless CMS > Strapi is the most popular open-source headless CMS with 71K+ stars. Visual content-type builder, REST & GraphQL APIs, RBAC, and extensive plugin marketplace. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: ## Quick Use ```bash npx create-strapi@latest my-project cd my-project npm run develop ``` Open `http://localhost:1337/admin` — register your admin account and start building content types. ## Intro **Strapi** is the leading open-source headless CMS, built with Node.js and fully customizable with JavaScript/TypeScript. It provides a visual content-type builder, auto-generated REST & GraphQL APIs, role-based access control, and a rich plugin marketplace — making it the go-to choice for developers building content-driven applications. With 71.8K+ GitHub stars, Strapi is by far the most popular open-source headless CMS, powering thousands of production applications from personal blogs to enterprise content platforms. ## What Strapi Does Strapi provides a complete content management solution: - **Content-Type Builder**: Visual interface to define content models with fields, relations, and components - **Auto-generated APIs**: REST and GraphQL APIs created automatically from your content types - **Media Library**: Upload, organize, and transform images and files with built-in asset management - **Authentication & RBAC**: User management with role-based permissions at field and content-type level - **Internationalization (i18n)**: Built-in multi-language content management - **Content Versioning**: Draft/publish workflow with content history - **Marketplace**: 100+ community plugins for SEO, email, search, and more - **Customization**: Extend with custom controllers, services, middlewares, and policies ## Architecture ``` ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ Your App │────▶│ Strapi │────▶│ SQLite / │ │ (Next.js / │ │ Server │ │ PostgreSQL /│ │ Nuxt / etc) │ │ (Koa.js) │ │ MySQL │ └──────────────┘ └──────┬───────┘ └──────────────┘ │ ┌──────┴───────┐ │ Admin Panel │ │ (React) │ └──────────────┘ ``` ## Getting Started ### Create a Project ```bash npx create-strapi@latest my-project # Choose database: SQLite (default), PostgreSQL, or MySQL # Choose TypeScript or JavaScript ``` ### Content Types via UI The Content-Type Builder lets you visually create: - **Collection Types**: Repeatable content (Articles, Products, Users) - **Single Types**: Unique content (Homepage, Settings, About Page) - **Components**: Reusable field groups (SEO, Address, Social Links) ### Content Types via Code ```typescript // src/api/article/content-types/article/schema.json { "kind": "collectionType", "collectionName": "articles", "info": { "singularName": "article", "pluralName": "articles", "displayName": "Article" }, "attributes": { "title": { "type": "string", "required": true }, "content": { "type": "richtext" }, "slug": { "type": "uid", "targetField": "title" }, "cover": { "type": "media", "allowedTypes": ["images"] }, "category": { "type": "relation", "relation": "manyToOne", "target": "api::category.category" }, "author": { "type": "relation", "relation": "manyToOne", "target": "plugin::users-permissions.user" } } } ``` ## API Usage ### REST API ```bash # List articles curl http://localhost:1337/api/articles?populate=* # Get single article curl http://localhost:1337/api/articles/1?populate=cover,category # Create article (authenticated) curl -X POST http://localhost:1337/api/articles -H "Authorization: Bearer YOUR_JWT" -H "Content-Type: application/json" -d '{"data": {"title": "My Post", "content": "Hello World"}}' # Filter and sort curl "http://localhost:1337/api/articles?filters[category][name][$eq]=tech&sort=publishedAt:desc&pagination[limit]=10" ``` ### GraphQL API ```graphql query { articles( filters: { category: { name: { eq: "tech" } } } sort: "publishedAt:desc" pagination: { limit: 10 } ) { data { id attributes { title content slug cover { data { attributes { url } } } } } } } ``` ## Self-Hosting ### Docker Compose ```yaml services: strapi: image: strapi/strapi:latest ports: - "1337:1337" environment: DATABASE_CLIENT: postgres DATABASE_HOST: postgres DATABASE_PORT: 5432 DATABASE_NAME: strapi DATABASE_USERNAME: strapi DATABASE_PASSWORD: strapi JWT_SECRET: your-jwt-secret ADMIN_JWT_SECRET: your-admin-jwt-secret APP_KEYS: key1,key2,key3,key4 depends_on: - postgres volumes: - strapi-data:/opt/app postgres: image: postgres:16-alpine environment: POSTGRES_USER: strapi POSTGRES_PASSWORD: strapi POSTGRES_DB: strapi volumes: - pg-data:/var/lib/postgresql/data volumes: strapi-data: pg-data: ``` ## Strapi vs Alternatives | Feature | Strapi | Payload | Directus | Contentful | |---------|--------|---------|----------|------------| | Open Source | Yes | Yes (MIT) | Yes | No | | GitHub Stars | 71.8K | 41.7K | 34.7K | N/A | | Config | GUI + code | Code-first | GUI | GUI | | Language | JavaScript/TS | TypeScript | JavaScript | N/A | | Database | SQLite/PG/MySQL | MongoDB/PG | Any SQL | Hosted | | Plugin marketplace | 100+ | Growing | Extensions | Apps | | Community | Very large | Growing fast | Large | Large | ## FAQ **Q: Is Strapi suitable for large enterprise projects?** A: Yes. Strapi v5 strengthens enterprise features including audit logs, SSO, approval flows, and content publishing workflows. Many enterprises run Strapi in production. **Q: What's different between Strapi v5 and v4?** A: v5 improves the API response format (flatter), introduces the Document Service API, improves TypeScript support, and optimizes database query performance. Migrating from v4 requires updating API call patterns. **Q: Does the content editor support Markdown?** A: The default rich text editor is WYSIWYG. Community plugins can swap it for a Markdown editor, or you can use the CKEditor 5 plugin for a more powerful editing experience. ## Source & Thanks - GitHub: [strapi/strapi](https://github.com/strapi/strapi) — 71.8K+ ⭐ - Website: [strapi.io](https://strapi.io) --- Source: https://tokrepo.com/en/workflows/strapi-leading-open-source-headless-cms-f454ef61 Author: Script Depot