Skip to main content

Strapi

  • strapi/strapi
    • MIT+EE
      • strapi-admin 包含部分 EE 协议 - Strapi Enterprise Edition
    • 生成代码 - 代码在本地
    • 半开发半可视化操作的 Headless CMS
      • 半开发
        • 接口、模型、组件、插件均可以代码操作
        • 首选操作方式是生成项目而不是作为服务使用
        • 区分 开发、预发、生产 环境
        • 一般只有开发环境才能生成模型
      • 半可视化
        • 模型定义可视化
        • 数据编就可视化
        • 组件定义
  • Roadmap
  • 开发
  • 参考
  • ./config/env/{env}/plugins.js
npx -y create-strapi-app@latest --ts --quickstart --use-npm --no-run my-project
cd my-strapi

# pnpm works

# https://docs.strapi.io/dev-docs/plugins/i18n
# https://github.com/strapi/strapi/blob/v4.20.2/packages/plugins/i18n/server/src/constants/iso-locales.json
npm run strapi install i18n graphql documentation
npm install @strapi/plugin-color-picker

# http://localhost:1337/admin
# http://localhost:1337/graphql
npm run develop --watch-admin --bundler=vite --debug

# for db
npm add pg

REST

KEY=
curl -H "Authorization: Bearear $KEY" 127.0.0.1/api/posts

Plugins

Midleware

内置数据库

  • admin_permissions
  • admin_permissions_role_links
  • admin_roles
  • admin_users
  • admin_users_roles_links
  • files
  • files_folder_links
  • files_related_morphs
  • i18n_locale
  • sqlite_master
  • sqlite_sequence
  • strapi_api_token_permissions
  • strapi_api_token_permissions_token_links
  • strapi_api_tokens
  • strapi_core_store_settings
  • strapi_database_schema
  • strapi_migrations
  • strapi_release_actions
  • strapi_release_actions_release_links
  • strapi_releases
  • strapi_transfer_token_permissions
  • strapi_transfer_token_permissions_token_links
  • strapi_transfer_tokens
  • strapi_webhooks
  • up_permissions
  • up_permissions_role_links
  • up_roles
  • up_users
  • up_users_role_links
  • upload_folders
  • upload_folders_parent_links