How keystonejs/keystone works
Main components
– “packages”: This is the heart of the project and includes Keystone’s modular components:
▪ Core: The “core” package houses the schema management, GraphQL API generation, and key business logic.
▪ Admin UI: Found in subdirectories under “packages/core/…” (for example, the internal admin UI components and pages). These are React-based components that power the dynamic management interface.
▪ Authentication and Extensions: Other packages such as “auth”, “cloudinary”, “document-renderer”, & “fields-document” encapsulate extra functionality and integrations.
• Documentation Site: The “docs” folder holds a fully functional documentation website. This part of the system is built with pages split into routes (for blog posts, guides, API docs, etc.) and uses components from “docs/components”. It both consumes and demonstrates the Keystone API.
• Examples: The “examples” directory contains standalone Keystone projects or demos. These illustrate the usage of the framework and help new users understand how to integrate Keystone with various databases, storage solutions, and authentication methods.
• Tests: The “tests” directory shows integration tests for the Admin UI, GraphQL API, CLI, and other operations. Although not part of the production system, this layer verifies system integrity and authorizes core interactions.
• CLI & Build Tools: Some scripts and package directories (e.g., “packages/create”, “packages/core/bin”, and “scripts”) act as the scaffolding for generating new Keystone projects and handling tasks like builds, migrations, and releases.
Architectural Patterns & Design Principles
• Modularity: Each package is a self‐contained unit, making it easier to swap components or extend functionality. Group the “packages” modules together, and show interfaces between them.
• API-driven Design: At its core, Keystone exposes a GraphQL API built dynamically from the schema configuration.
• Monorepo Organization: Highlight that the codebase uses a monorepo strategy where multiple interrelated packages reside. You might visually indicate shared libraries or internal dependencies.