CodeVetter · Repo Unpack · System map
strapi/strapi
The runtime centers on a Strapi dependency container, with a CLI entrypoint and separate HTTP/admin application boundaries. Content persistence passes through the Document Service into a Knex-backed database package. Plugins and providers assemble application capabilities, while Nx coordinates package builds and checks. Architecture diagrams and contributor documentation are separately built artifacts.
- The executable bin delegates to runCLI; createCLI loads command factories, and the start action resolves appDir/distDir before invoking createStrapi(...).start(). TypeScript projects use an existing compiled output fast path or resolveOutDir fallback.
- Strapi extends Container, loads configuration in its constructor, registers internal services, and invokes provider initialization. Its container owns server, authentication, Document Service, database, request context, and event hub services.
- createServer creates a Koa application and HTTP server, separates admin and content-api routers, installs request context, and exposes /_health with status 204. Content API routing defaults to the /api prefix.
- @strapi/admin exports distinct strapi-admin and strapi-server entrypoints. The browser StrapiApp constructs Redux state from stored preferences/token and renders a RouterProvider, keeping browser application state separate from server services.
- Database constructs dialect, Knex connection, metadata, schema, migration, lifecycle, entity-manager, and repair services. init loads model metadata and validates the database; query(uid) rejects unknown models before returning a repository.
- Plugin loading resolves each enabled package's strapi-server export, loads its implementation, merges defaults/configuration, applies application extensions, and registers it. Email providers are dynamically resolved and initialized with providerOptions/settings.
- The root is a private Yarn workspace using yarn@4.12.0; build targets run through Nx, and core packages emit Rollup code plus TypeScript declarations. Nx caches build outputs in package dist directories.
- Architecture is a separate LikeC4 workspace with HTML-build and diagram-export commands; contributor docs use Docusaurus. The contributor-doc workflow builds docs and publishes docs/build to GitHub Pages on develop pushes or manual dispatch.