bởi Tobias W.

ApostropheCMS is a full-stack CMS built on Node.js and MongoDB with in-context editing, headless API support, and a rich ecosystem of modules for forms, blogs, events, AI content generation, and more.
ApostropheCMS is a full-stack Node.js/MongoDB CMS framework that provides in-context content editing, document management, schema-driven content types, REST APIs, and a modular admin UI. It is intended for developers building structured content sites or headless CMS backends who want a production-ready, extensible foundation rather than building content infrastructure from scratch.
index.js - Main entry point; initializes the Apostrophe application, wires all modules, handles clustering and OpenTelemetrydefaults.js - Default configuration values applied to every Apostrophe instanceeslint.config.js - ESLint configuration for the projectlib/ - Low-level utilities: glob, moog (class system), moog-require, image helpers, locale utilities, OpenTelemetry setup, stream proxy, safe JSON script outputlib/universal/ - Universal (browser + Node) utilities including check-if-conditions.mjsmodules/@apostrophecms/ - All built-in Apostrophe modules (admin-bar, doc, page, piece-type, asset, attachment, login, permission, i18n, etc.)scripts/ - Build and maintenance scriptstest-lib/ - Shared test helpers used in the upstream test suiteclaude-tools/ - Internal diagnostic/hang-detection scripts; not needed in productionnpm install apostrophe
npm install lodash boring common-tags resolve @paralleldrive/cuid2
npm install mongodb mongoose
Note: ApostropheCMS requires a running MongoDB 6.0+ instance. There is no native build step, but the asset pipeline (
@apostrophecms/asset) runs Webpack/Vite during the first start. EnsureNODE_ENVis set correctly before running.
Drop the source into your project root as source/ or install via npm install apostrophe and reference node_modules/apostrophe.
Create your app entry point (app.js):
// app.js
require('./source/index.js')({
shortName: 'my-project',
modules: {
// your custom modules here
}
});
Khởi chạy sandbox cách ly và chạy phía máy chủ — không cần cài đặt cục bộ.
Tetrees AI Review cho phiên bản này
This Express backend / api completed archive review. Structure, dependency manifests, documentation, functional source, and common risk patterns were checked by the Tetrees verification pipeline; runtime phases are stated separately.
Deterministic AVCP artifact review
Quy trình avcp-2026-08-04.1 · SHA-256 ed51a800ec91df89…
This version-scoped review deterministically inspects the submitted archive for structure, dependencies, documentation, functional source, and common malicious or high-risk signals. Build and test phases are reported as passed only after an isolated sandbox audition. It is not a guarantee of perfect security.
Đã đánh giá 4 thg 8, 2026
Đưa sản phẩm này thẳng vào AI IDE, trình tạo web hoặc cloud IDE của bạn.
Kết nối Tetrees với AI IDE tương thích để liệt kê sản phẩm bạn sở hữu và nhận ZIP đã xác minh mà không cấp quyền tải lên của người bán.
Chưa có đánh giá.
Sign in to join the discussion
Loading discussion…
.env or your environment:APOS_MONGODB_URI=mongodb://localhost:27017/my-project
APOS_BASE_URL=http://localhost:3000
NODE_ENV=development
# Optional cluster mode:
# APOS_CLUSTER_PROCESSES=2
package.json:{
"scripts": {
"dev": "node app.js",
"start": "NODE_ENV=production node app.js"
}
}
TypeScript projects: ApostropheCMS is CommonJS. If you need type safety, wrap calls in .js files and import via require. There is no official @types/apostrophe; use JSDoc annotations or a d.ts shim.
MongoDB: Start a local instance or point APOS_MONGODB_URI to MongoDB Atlas before running.
apostrophe(options) — top-level factoryfunction apostrophe(options: {
shortName: string;
modules?: Record<string, object>;
cluster?: boolean | { processes: number };
openTelemetryProvider?: object;
beforeExit?: () => Promise<void>;
}): Promise<AposInstance>;
Called once at startup. Returns the fully initialized Apostrophe instance. shortName is used for cookie names, collection prefixes, and asset namespacing. Pass cluster: true to fork one worker per CPU core; pass cluster: { processes: -1 } to reserve one core for MongoDB on a single-server deployment.
adminBar.add(name, label, permission?, options?) — register an admin bar button// Accessible via apos.adminBar.add(...)
function add(
name: string,
label: string,
permission?: string | null,
options?: { after?: string; contextUtility?: boolean }
): void;
Registers a button or menu item in the top admin bar. Called in the init section of any module. permission restricts the button to users holding that permission. Use options.after to position the button relative to another named item.
anyDocType.find(req, criteria, options) — query any document type// Accessible via apos.anyDocType.find(...)
function find(
req: AposRequest,
criteria?: object,
options?: object
): AposQuery;
Returns a query builder that matches across all document types by removing the implicit type filter (.type(false)). Used when you need to search or relate to any doc regardless of type, such as a universal search feature.
anyPageType.getAutocompleteTitle(doc, query) — format autocomplete labelsfunction getAutocompleteTitle(
doc: { title: string; slug: string },
query: { field: object }
): string;
Returns a display string ("Title (/slug)") for page-type autocomplete fields in relationship schemas. Deprecated in favor of the autocomplete() query builder; shown here for legacy project awareness.
Initialize a bare-bones Apostrophe site with a custom home page module and the default admin UI.
// app.js
const apostrophe = require('./source/index.js');
apostrophe({
shortName: 'demo-site',
modules: {
'default-page': {
extend: '@apostrophecms/page-type',
options: {
label: 'Default Page'
}
},
'@apostrophecms/page': {
options: {
types: [
{ name: 'default-page', label: 'Default Page' }
]
}
}
}
});
Add a custom button to the admin bar that only appears for users with the admin permission.
// modules/my-tool/index.js
module.exports = {
init(self) {
self.apos.adminBar.add(
'my-tool',
'My Tool',
'admin',
{ after: '@apostrophecms/page' }
);
}
};
// app.js
const apostrophe = require('./source/index.js');
apostrophe({
shortName: 'demo-site',
modules: {
'my-tool': {}
}
});
Fetch all published documents regardless of type from within a custom module method.
// modules/my-search/index.js
module.exports = {
methods(self) {
return {
async searchAll(req, text) {
const results = await self.apos.anyDocType
.find(req, {
$text: { $search: text }
})
.project({ title: 1, slug: 1, type: 1 })
.toArray();
return results;
}
};
},
apiRoutes(self) {
return {
get: {
async search(req) {
const q = req.query.q || '';
return self.searchAll(req, q);
}
}
};
}
};
index.js - Entry point. Parses CLI args, sets up clustering via Node.js cluster, registers the OpenTelemetry provider, loads all modules through moog-require, and calls apostrophe().defaults.js - Baseline options object merged into every Apostrophe instance before user config is applied.eslint.config.js - Flat ESLint config for the monorepo; not needed in consumer projects.lib/moog.js - The "moog" class/mixin system powering Apostrophe's module inheritance. Modules extend each other through this.lib/moog-require.js - Wraps moog to resolve module definitions from the filesystem, npm packages, and project-level overrides.lib/glob.js - Sync/async glob wrapper used internally for file discovery.lib/opentelemetry.js - Registers a global OpenTelemetry TracerProvider if configured; no-ops otherwise.lib/image.js - Image dimension and focal-point utilities.lib/locales.js - Locale string normalization helpers.lib/safe-json-script.js - Escapes JSON for safe inline <script> emission.lib/stream-proxy.js - HTTP stream proxy utility used by the attachment pipeline.lib/import-fresh.js - require wrapper that bypasses the module cache.lib/universal/check-if-conditions.mjs - ESM utility for evaluating conditional visibility rules in schemas; runs in both Node and browser.modules/@apostrophecms/ - All built-in content modules. Each sub-directory is a self-contained Apostrophe module with index.js, optional ui/src/, and optional views/.scripts/ - Database migration runners and build helpers; invoked by npm scripts.test-lib/ - Shared utilities for writing Apostrophe module tests (not for production).claude-tools/ - Diagnostic scripts for detecting event loop hangs and MongoDB connection leaks; not for production use.APOS_MONGODB_URI points to a live instance before running node app.js.shortName collision across environments: Cookie names and session keys are prefixed with shortName. Two apps on the same domain with the same shortName will share sessions. Fix: use distinct shortName values per app.lib/universal/*.mjs: These files use .mjs extension and ES module syntax. If your bundler sees them, configure it to handle .mjs as ESM. In Node, require() cannot load .mjs; use dynamic import().node app.js once and wait; subsequent starts use cached bundles unless source changes.cluster: true spawns multiple workers; file watchers (e.g., nodemon) may restart only the primary. Fix: disable clustering in development (NODE_ENV=development sets it off by default).extend resolution order: A module that extends another must be loaded after it. If you see "base class not found" errors, check that the extended module is listed or auto-discovered before the extender in your modules config.I have the ApostropheCMS core source in ./source/ and its integration guide
in ./source/USAGE.md. The upstream package is `apostrophe`.
Please integrate ApostropheCMS into my existing Node.js project step by step:
1. Read USAGE.md and the file excerpts in source/index.js,
source/modules/@apostrophecms/admin-bar/index.js, and
source/modules/@apostrophecms/any-doc-type/index.js to understand the
real API surface.
2. Create app.js that calls the apostrophe() factory with shortName,
a MongoDB URI from process.env.APOS_MONGODB_URI, and the modules listed
below: [YOUR MODULES HERE].
3. Add a custom piece type module named "article" that extends
@apostrophecms/piece-type with title and body fields.
4. Register an admin bar button for the article manager using
apos.adminBar.add() inside the article module's init() function.
5. Add a REST API route on the article module that queries all articles
using self.find(req).toArray() and returns JSON.
6. Show me the final directory structure and all new/modified files.
Do not invent APIs. Only use methods and options visible in the file excerpts
and USAGE.md.
ApostropheCMS is released under the MIT License (see source/LICENSE.md). The upstream project is maintained by the ApostropheCMS team at https://github.com/apostrophecms/apostrophe. Documentation is available at https://docs.apostrophecms.org/.
This product’s unique contribution is clean room implementation of valuable code block into AVCP compatible standard.
Hướng dẫn cài đặt đầy đủ và prompt tích hợp sẽ mở khóa sau khi mua.
CRM, ERP, Admin & Internal Tools
Miễn phí