Skip to content

Why Apostrophe?

Overview

We developed Apostrophe because we found ourselves repeating the same tasks, making the same changes, and expressing the same complaints whenever we started a project with another framework or CMS.

So what are the advantages of Apostrophe, and how do they make CMS development more efficient and effective? We'll answer those questions here.

One programming language: no context switching

Apostrophe is written entirely in JavaScript. Server-side, Apostrophe is powered by the Node.js runtime environment. Unless you choose to use Apostrophe as a headless CMS, the editor and administration experience is delivered by the popular Vue.js framework. No switching between languages means less mental work for the developer.

JavaScript is ubiquitous

The developer communities for JavaScript and Node.js are huge, which means there is a large amount of expertise and resources available to speed development. Current versions of Node.js provide access to modern JavaScript language features. And with a customizable webpack build at project level, you can achieve the same results for all browsers. Good examples include async/await, the spread syntax, and the const and let keywords. For more, watch ES6 and Beyond: writing better code with Modern JavaScript.

Vue.js: Javascript in the UI

Vue.js is a popular, performant, and versatile framework for building reactive web user interfaces. It builds components on top of standard HTML, CSS, and JavaScript, allowing developers to create dynamic and interactive interface components with ease.

It boasts a large and active community of developers, contributing to a rich ecosystem of libraries and tools. This community-driven approach ensures that there are plenty of resources available, from tutorials to plugins, to support both new and experienced developers. Vue's flexibility and community support make it an excellent choice within Apostrophe's architecture.

Apostrophe's built-in webpack allows developers to utilize the latest JavaScript features and CSS preprocessors, aligning with Apostrophe's emphasis on modern, efficient development. By using Vue, Apostrophe offers a unified, JavaScript-centric development environment, furthering the goal of "no context switching" and enabling developers to focus on what matters most: building great web experiences.

MongoDB: JavaScript in the database layer

Apostrophe takes this goal of "no context switching" all the way to the database layer. Rather than a relational database such as Postgres or MySQL, Apostrophe is built on MongoDB, which has a query language directly based on JavaScript objects. This means there are no code injection attacks. But it also means the developer doesn't have to switch mental gears between two languages when making a database query.

Apostrophe's own built-in query builder uses chainable methods, similar to ORMs (Object-Relational Mappers) you may have used, to build queries while automatically taking care of fundamentals like choosing the right type of document and enforcing permissions. However, the door is open to including MongoDB queries to filter data as you see fit.

Performance

Because Apostrophe is written in JavaScript on both the front and the back end, it can leverage Node.js, which is powered by the same open-source "v8" runtime that powers Chrome. Due to browser competition, the performance of v8 is far superior to that of PHP and most other languages that are traditionally chosen for CMS work.

MongoDB also contributes to the performance of Apostrophe. Because it is designed from the beginning to support structured documents rather than just table rows, MongoDB can efficiently represent and query an entire page as a single document in the database.

DRY (Don't Repeat Yourself)

In some frameworks, CMS work requires a lot of boilerplate code and repetition. Apostrophe is designed from the start to avoid repetition.

Pieces: reusable content for your site

When you want to create a new content type, you can use Apostrophe's object-oriented features to extend our @apostrophecms/piece-type module to create a new "piece type" module with all the functionality of the base module but still independently customizable. This is perfect for content types like blog posts or products. Creation of a new module immediately gives you a user interface for managing content, a database layer to store and access said content, and the option of also extending our @apostrophecms/piece-page-type module to present the content to your site's audience. All of these features automatically draw on the same schema, avoiding code repetition.

Widgets: editable content on the page

Similarly, Apostrophe offers a widget-type "base class module" that can be extended to create smaller units of editable content with custom functionality without copy-and-paste, hard-to-maintain code generators or boilerplate. Apostrophe's areas allow the user to create and manage a series of widgets through a friendly interface. As a developer, all you have to do is define the fields your widget needs, a template to render it, and optionally a JavaScript "player" to add interactive features. Apostrophe manages all of this functionality for you and gives you clear guidance on where to put the code.

Flexible schemas

Apostrophe's schemas provide a way to define the fields that make up your content types in a single place. Schema field types include the usual choices, like strings, integers, floats, and booleans, but also array fields which can have their own schemas, and relationships that connect documents. This lets you take advantage of MongoDB's support for building nested documents.

Smart media handling

We understand that content creators often struggle to manage media on CMS sites. This can lead to real problems when images of the wrong size or type are inserted into the design.

This is why Apostrophe has built-in features to scale images to a set of suitable sizes, crop images, enforce aspect ratios, and pick "focal points" for better responsive results. Apostrophe also includes a helper function to generate srcset attributes for the best responsive outcome.

Scalability

Not all CMSes are designed to scale up smoothly for the largest audiences. While Apostrophe starts out configured for simple development and production environments, Apostrophe's uploadfs module already includes support for storing media with Amazon Web Services, Azure, or Google Cloud Storage. With the addition of a MongoDB Atlas cloud database, Apostrophe becomes "stateless," allowing you to load-balance as many instances as you need for a high-traffic site.

Better for your content creators

All the features in the world won't help if content creation is an unpleasant process. Apostrophe's user interface provides an intuitive way to edit content right on the page. Throughout Apostrophe, care has been taken to keep the interface clear and friendly for the editor.

Extensibility

Apostrophe is designed to be extended. Any Apostrophe module or group of modules can be publicly or privately published for reuse as an npm module, like @apostrophecms/form or @apostrophecms/blog.

In addition, Apostrophe's improve feature allows us to ship "improvements" to core functions without code duplication and maintenance problems. This takes object-oriented programming and inheritance a step further than most frameworks. The @apostrophecms/piece-type-exporter npm module is a good example, adding the ability to export CSV and Excel files from any "piece-type" (content type).

A rich library of optional modules

Taking advantage of its extensibility, Apostrophe maintains an official library of optional npm modules. You can learn more about our official npm modules here.

Approvals, localization, and internationalization

Apostrophe provides an approval flow for content, as well as localization and internationalization capabilities (l10n and i18n) right out of the box. Any document can be translated into multiple languages, with no performance impact on the rest of the site.