This document explains the distinction between packages and plugins in the Checkstack monorepo.
The Checkstack platform uses a two-tier architecture for code organization:
| Directory | Purpose | Examples |
|---|---|---|
core/ |
Essential platform components that cannot be removed | Auth, Catalog, Queue, Notifications |
plugins/ |
Replaceable providers and strategies | Auth providers (GitHub, LDAP), Queue backends (BullMQ) |
Use this guide when deciding where to place new code:
core/ when:Examples:
auth-*: Authentication is fundamentalcatalog-*: Entity management is core to the platformqueue-*: Job queue abstraction layernotification-*: Platform notificationshealthcheck-*: Platform health monitoringtheme-*: UI theming infrastructureplugins/ when:Examples:
auth-github-backend: One of many auth providersauth-ldap-backend: Alternative auth providerqueue-bullmq-backend: One queue implementationqueue-memory-backend: Alternative queue implementationhealthcheck-http-backend: One health check strategy| Type | Backend | Common (Shared) | Frontend |
|---|---|---|---|
| Package | core/{name}-backend |
core/{name}-common |
core/{name}-frontend |
| Plugin | plugins/{name}-backend |
plugins/{name}-common |
plugins/{name}-frontend |
core/
├── backend/ # Core backend server
├── frontend/ # Core frontend app
├── backend-api/ # Backend plugin API
├── frontend-api/ # Frontend plugin API
├── common/ # Shared types/utilities
│
├── auth-backend/ # Core auth service
├── auth-common/ # Auth contracts
├── auth-frontend/ # Auth UI
│
├── catalog-*/ # Entity management
├── notification-*/ # Notifications
├── queue-*/ # Queue abstraction
├── healthcheck-*/ # Health monitoring
├── theme-*/ # UI theming
└── ...
plugins/
├── auth-github-backend/ # GitHub OAuth provider
├── auth-credential-backend/ # Username/password auth
├── auth-ldap-backend/ # LDAP auth provider
│
├── queue-bullmq-backend/ # BullMQ implementation
├── queue-bullmq-common/
├── queue-memory-backend/ # In-memory implementation
├── queue-memory-common/
│
└── healthcheck-http-backend/ # HTTP health strategy
Plugins implement interfaces defined in packages:
// core/queue-api/src/types.ts
export interface QueuePlugin {
type: "queue";
createQueue(name: string, options: QueueOptions): Queue;
}
// plugins/queue-bullmq-backend/src/index.ts
export default createBackendPlugin({
metadata: pluginMetadata,
register(env) {
env.registerService(queuePluginRef, {
type: "queue",
createQueue: (name, options) => new BullMQQueue(name, options),
});
},
});
When using the CLI to create new code:
# Create a core package
bun run cli create package auth-oauth
# Create a replaceable plugin
bun run cli create plugin auth-okta-backend
The CLI will prompt for confirmation if creating in the “wrong” directory based on naming patterns.