Skip to content
STACK IT FAST

Strapi

Curated OSSClassicHeadless CMS20+ people

Audited from github.com/strapi/strapi

Strapi is an open-source headless CMS built with TypeScript, Node.js, and React, providing auto-generated REST and GraphQL APIs.

Language
TypeScript
Database
PostgreSQL
Hosting
Docker
Running for
8 years
Team
20+ people

Why this architecture

Declarative content modeling paired with a customizable React admin dashboard gives engineering teams full control over content structures and delivery APIs.

Tech stack by layer

8 technologies · audited Sep 17, 2026
Frontend & UI
  • ReactPowers the administrative dashboard, content-type builder, and media asset manager.
  • TypeScriptStrict typing across admin panels, plugin extension points, and content schemas.
Backend & APIs
  • Node.jsServer runtime targeting Node.js 20 or newer across monorepo core services.
  • KoaLightweight HTTP framework underlying middleware stacks, routing, and controller execution.
  • GraphQLGenerates GraphQL schemas and query/mutation resolvers from content models via plugin.
Data & Persistence
  • PostgreSQLPrimary enterprise relational database for content persistence, relations, and RBAC tables.
  • SQLiteDefault embedded database for rapid local development and testing without external servers.
  • MySQLSupported relational database target tested in continuous integration Docker compose suites.
Infrastructure & Deploy
  • DockerDocker Compose orchestration environments in docker-compose.dev.yml for multi-database tests.

Strapi architecture diagram

Open SVG
Strapi architecture diagramAdmin panel → Strapi server (admin API); Frontends & apps → Strapi server (REST); Frontends & apps → Plugins (GraphQL); Strapi server → Plugins (extend); Strapi server → Database (Knex); Plugins → Media library (files)CLIENTSSERVICESDATA & STORAGEAdmin panelReact · content-type builderFrontends & appsREST · GraphQLStrapi serverNode.js · KoaPluginsGraphQL · upload · RBACDatabasePostgres / MySQL / SQLite (Knex)Media libraryuploadsextendadmin APIRESTGraphQLKnexfiles
How the main components of Strapi connect, drawn from the audited repository.
Diagram as text
  • Admin panel (React · content-type builder) → Strapi server (Node.js · Koa): admin API
  • Frontends & apps (REST · GraphQL) → Strapi server (Node.js · Koa): REST
  • Frontends & apps (REST · GraphQL) → Plugins (GraphQL · upload · RBAC): GraphQL
  • Strapi server (Node.js · Koa) → Plugins (GraphQL · upload · RBAC): extend
  • Strapi server (Node.js · Koa) → Database (Postgres / MySQL / SQLite (Knex)): Knex
  • Plugins (GraphQL · upload · RBAC) → Media library (uploads): files

Key architectural decisions

5 decisions
  1. 01

    Modular plugin architecture with dynamic schema composition

    Strapi organizes core capabilities into pluggable modules (packages/plugins/). Plugins can register new database models, extend GraphQL schemas, inject admin UI navigation tabs, and hook into controller lifecycle events.

  2. 02

    Database abstraction via Knex query builder layer

    The custom database layer (packages/core/database) uses Knex to generate database-agnostic SQL queries, allowing seamless operation across PostgreSQL, MySQL, MariaDB, and SQLite without rewriting business logic.

  3. 03

    Declarative Content-Type Schema Builder

    Content models are defined as declarative JSON schemas (schema.json) describing fields, validations, and relational associations, allowing developers to version-control content structures in Git.

  4. 04

    Dual REST and GraphQL API generation

    Defining a content model automatically synthesizes fully typed REST endpoints with filtering, sorting, and pagination, while the optional GraphQL plugin provides corresponding GraphQL queries and mutations.

  5. 05

    Role-Based Access Control (RBAC) enforced across API and admin boundaries

    Strapi implements fine-grained permission evaluation, separating admin console roles (Super Admin, Editor, Author) from public and authenticated API consumer roles.

How Strapi is built

How Strapi is structured

Strapi is developed as a comprehensive TypeScript monorepo managed with Yarn workspaces (package.json, lerna.json, nx.json). The architecture separates the core framework and database adapters from administrative frontend interfaces and official plugin packages:

  • packages/core/strapi/: The central application orchestrator (packages/core/strapi/package.json). It manages server startup, Koa middleware pipelines, routing, lifecycle hooks, and plugin initialization.
  • packages/core/admin/: The single-page React administrative dashboard (packages/core/admin/package.json), providing the Content Manager, Content-Type Builder, Media Library, and User Role interfaces.
  • packages/core/database/: The database abstraction layer managing migrations, schema syncing, and query generation on top of Knex.
  • packages/plugins/: Official core plugins, including @strapi/plugin-graphql, @strapi/plugin-users-permissions, @strapi/plugin-upload, and @strapi/plugin-i18n.
  • packages/providers/: Media upload and email delivery providers (AWS S3, Cloudinary, SendGrid, Nodemailer).
  • docker-compose.dev.yml: Development orchestration environment provisioning PostgreSQL and MySQL databases.

Frontend

The administrative user interface in packages/core/admin is built using React (react, react-dom) and TypeScript.

Key presentation subsystems include:

  • Content-Type Builder: An interactive visual modeling interface that allows non-technical administrators or developers to add collections, components, dynamic zones, and relation linkages without writing manual SQL migrations.
  • Media Library: Supports drag-and-drop asset uploads, image cropping, format conversions, responsive image thumbnail generation, and asset tagging.
  • Strapi Design System: Built on top of styled-components, providing accessibility-tested form controls, modal dialogs, data tables, and dark/light color themes.
  • Extensible Plugin Views: Third-party plugins can inject custom React components into edit views, navigation sidebars, and settings pages via Strapi's admin extension API.

Backend & APIs

The backend server is implemented in TypeScript targeting Node.js 20+ (package.json).

The server leverages Koa (koa, koa-router) as its HTTP layer. Koa's lightweight middleware pipeline handles request parsing, CORS, compression, security headers, and authentication.

When a developer creates a content type (such as Article), Strapi dynamically registers:

  1. REST Endpoints: Standardized endpoints (GET /api/articles, POST /api/articles, etc.) supporting complex filtering (filters[title][$contains]=...), field selection (fields[0]=title), relational population (populate=*), and cursor/offset pagination.
  2. GraphQL Schema: If @strapi/plugin-graphql is installed, Strapi generates GraphQL query types, mutations, and resolver pipelines matching the content structure.
  3. Document Service & Entity Service: Internal programmatic APIs allowing developers to query, create, and update records from custom controllers or cron tasks with lifecycle callbacks (beforeCreate, afterUpdate).

Data & persistence

Data persistence is managed through a custom ORM-like layer (packages/core/database) built on top of Knex:

  • Relational Databases: Strapi supports PostgreSQL, MySQL, MariaDB, and SQLite.
  • Schema Synchronization: When content types change, Strapi compares the declared schema.json files against the live database catalogs, automatically creating tables, foreign keys, and join tables.
  • Internationalization (i18n): Multi-language content localization is supported natively via @strapi/plugin-i18n, maintaining localized versions of records with shared entity pointers.
  • Draft & Publish: Built-in state management allows content editors to author and review drafts before publishing updates to production API consumers.

Build, test & deploy

The monorepo pipeline relies on Yarn and Nx:

  • Compilation: Packages are compiled using TypeScript and Rollup bundlers (rollup.utils.mjs).
  • Testing: Automated testing spans Jest for unit/API tests (jest.config.api.js) and Playwright (playwright.base.config.js) for end-to-end admin UI verification.
  • Local Development: docker-compose.dev.yml provisions PostgreSQL and MySQL services, while examples in examples/kitchensink-ts provide live test applications.

Self-hosting notes

Self-hosting Strapi in production is standard practice across cloud environments:

  1. Build the production application using npm run build or yarn build, which compiles both backend TypeScript sources and static admin dashboard bundles.
  2. Run the application via npm run start or node server.js behind a reverse proxy (Nginx, Caddy, Cloudflare).
  3. Connect to an external managed PostgreSQL or MySQL database via DATABASE_URL or individual host/port environment variables.
  4. Media storage: In production containers, configure an S3 or Cloudinary upload provider to ensure that uploaded assets persist across ephemeral container restarts.

What to copy (and what not to)

Architectural patterns to emulate from Strapi:

  • Declarative JSON schemas for content modeling: Storing content structures as human-readable JSON files allows schema changes to be tracked, reviewed, and versioned in Git alongside application code.
  • Automatic dual API generation: Automatically generating both REST and GraphQL interfaces from a single schema definition satisfies diverse client requirements without double maintenance.
  • Extensible plugin architecture: Allowing extensions to hook into both backend controllers and frontend administration panels fosters a rich community plugin ecosystem.

Avoid storing user-uploaded media files on local container filesystems without a cloud storage provider (like S3), as modern container platforms destroy ephemeral disks during routine redeployments.

Sources & repo audit

Audited
Sep 17, 2026
Commit
3cd7dba
License
NOASSERTION

Independent analysis of repository at github.com/strapi/strapi. Spotted an inaccuracy? Use the claim form to request a correction.

Show this stack on your README or website
Tech stack of Strapi
[![Tech stack of Strapi on STACK IT FAST](https://stackitfast.com/badge/strapi.svg)](https://stackitfast.com/project/strapi)

Paste it into your README. It shows your current stack and links to this page.

Use this stack

Scaffold it with your agent

Paste this prompt into Claude Code, Cursor, Windsurf or AGY to start a project with Strapi's architecture.

  1. 1Copy the promptThe full markdown spec, with every layer and decision.
  2. 2Open your AI toolClaude Code, Cursor, Windsurf or Copilot, in a new repo.
  3. 3Paste and scaffoldUse it as the first instruction; review before you ship.
use-this-stack.md · 59 lines · 6.1 KB
# MISSION: Scaffold "Strapi" Production Architecture
You are an expert Senior Staff Software Architect and Full-Stack Engineer. Your mission is to scaffold and implement a production-grade, highly reliable, and modular codebase following the proven architecture of **Strapi**.
---
## 1. PROJECT SPECIFICATIONS & BENCHMARK
- **Reference Architecture**: Strapi
- **What It Does**: Strapi is an open-source headless CMS built with TypeScript, Node.js, and React, providing auto-generated REST and GraphQL APIs.
- **Domain & Category**: Headless CMS
- **Production Scale**: 20+ people
- **Development Mode**: CLASSIC
- **Architectural Rationale**: Declarative content modeling paired with a customizable React admin dashboard gives engineering teams full control over content structures and delivery APIs.
- **Live Website Reference**: https://strapi.io
- **Source Repository**: https://github.com/strapi/strapi
---
## 2. PRODUCTION TECH STACK
- **Full Stack Array**: Node.js, TypeScript, React, PostgreSQL, SQLite, GraphQL, MySQL, Koa
- **Primary Language(s)**: TypeScript, JavaScript, Handlebars
- **License of the reference repo**: NOASSERTION
- **Frontend**: React — Powers the administrative dashboard, content-type builder, and media asset manager.; TypeScript — Strict typing across admin panels, plugin extension points, and content schemas.
- **Backend & APIs**: Node.js — Server runtime targeting Node.js 20 or newer across monorepo core services.; Koa — Lightweight HTTP framework underlying middleware stacks, routing, and controller execution.; GraphQL — Generates GraphQL schemas and query/mutation resolvers from content models via plugin.
- **Data & persistence**: PostgreSQL — Primary enterprise relational database for content persistence, relations, and RBAC tables.; SQLite — Default embedded database for rapid local development and testing without external servers.; MySQL — Supported relational database target tested in continuous integration Docker compose suites.
- **Infrastructure & deploy**: Docker — Docker Compose orchestration environments in docker-compose.dev.yml for multi-database tests.
---
## 3. KEY ARCHITECTURAL DECISIONS (audited from https://github.com/strapi/strapi @ 3cd7dba)
1. **Modular plugin architecture with dynamic schema composition**: Strapi organizes core capabilities into pluggable modules (packages/plugins/). Plugins can register new database models, extend GraphQL schemas, inject admin UI navigation tabs, and hook into controller lifecycle events.
2. **Database abstraction via Knex query builder layer**: The custom database layer (packages/core/database) uses Knex to generate database-agnostic SQL queries, allowing seamless operation across PostgreSQL, MySQL, MariaDB, and SQLite without rewriting business logic.
3. **Declarative Content-Type Schema Builder**: Content models are defined as declarative JSON schemas (schema.json) describing fields, validations, and relational associations, allowing developers to version-control content structures in Git.
4. **Dual REST and GraphQL API generation**: Defining a content model automatically synthesizes fully typed REST endpoints with filtering, sorting, and pagination, while the optional GraphQL plugin provides corresponding GraphQL queries and mutations.
5. **Role-Based Access Control (RBAC) enforced across API and admin boundaries**: Strapi implements fine-grained permission evaluation, separating admin console roles (Super Admin, Editor, Author) from public and authenticated API consumer roles.
---
## 4. NON-NEGOTIABLE ARCHITECTURAL GUARDRAILS
1. **Monorepo & Modular Separation**:
   - Structure as a Turborepo monorepo with strict package boundaries:
     - `apps/web`: Application UI, routing, layouts, and server endpoints.
     - `packages/ui`: Shared design tokens, CSS variables, and Radix UI primitive components.
     - `packages/db`: Database schemas, client singleton, declarative migrations, and seed scripts.
     - `packages/config`: Shared TypeScript, ESLint, and build configurations.
2. **Strict Type Safety & Zero `any` Policy**:
   - Enable `strict: true`, `noImplicitAny: true`, and `strictNullChecks: true`.
   - Validate ALL external inputs, API request bodies, and query parameters with **Zod** schemas before execution.
3. **Frontend & Rendering Guidelines**:
   - Isolate interactive UI state to leaf components. Keep core pages lightweight and performant.
4. **Design System & Aesthetics**:
   - Keep every color, radius, shadow and font in a single token file (CSS variables) and consume tokens everywhere; never hardcode hex values in components.
   - Prefer crisp 1px borders and one subtle shadow scale over blurry default shadows. Pair one sans-serif for body/headings with one monospace for tags, badges, metrics, and code.
5. **Data Layer & Reliability**:
   - Write declarative schema definitions with foreign keys, composite indexes on queried filters, and automated timestamp triggers.
   - Use connection pooling and prepared statements for serverless database execution.
---
## 5. STEP-BY-STEP SCAFFOLDING ROADMAP
- **Phase 1: Workspace & Root Config**: Initialize package manager, monorepo configuration (`turbo.json`, `tsconfig.base.json`, `package.json`).
- **Phase 2: Database Schema & Client**: Set up the data layer (PostgreSQL, SQLite, MySQL): client, connection pool, models, and migration scripts.
- **Phase 3: Design Tokens & UI Primitives**: Build accessible `Button`, `Input`, `Card`, `Badge`, and layout wrappers inside `packages/ui`.
- **Phase 4: Core Application Routes & Handlers**: Implement primary authentication, user session handling, and application routes.
- **Phase 5: Quality Assurance & Build Verification**: Run `tsc --noEmit`, ESLint, Prettier, and smoke test suites to ensure zero compilation or runtime errors.
---
## 6. EXECUTION INSTRUCTIONS
1. Review all specifications, architectural guardrails, and stack choices above.
2. Present the full monorepo directory tree structure.
3. Systematically generate the complete, production-ready codebase according to the 5-phase roadmap above — starting with the root workspace setup, followed by the database schema, UI design system package, and full-stack application routes until the repository is fully scaffolded and ready to run.
Scaffolded something with this prompt?
Would you pick this stack for a headless cms project?

Frequently asked about Strapi

What is Strapi built with?

Strapi is built in TypeScript on Node.js using Koa for the HTTP layer, React for the admin dashboard, and Knex for relational database abstraction across PostgreSQL, MySQL, and SQLite.

Does Strapi support both REST and GraphQL?

Yes. Every defined content model automatically generates standard REST endpoints, and installing the official @strapi/plugin-graphql generates full GraphQL queries and mutations.

Can Strapi be self-hosted on my own servers?

Yes. Strapi is 100% self-hostable on any cloud provider, container platform, or virtual machine via Docker or direct Node.js processes with zero cloud dependencies.

Which databases does Strapi support?

Strapi officially supports PostgreSQL, MySQL, MariaDB, and SQLite.

One email a month: new deep dives and stack trends

New source-audited architectures, head-to-head comparisons and the monthly stack report. No spam, unsubscribe anytime.

use-this-stack.md