Contents tagged with Node.js
-
The Evil Empire Strikes Back
A little more than three years ago, I left Microsoft, and co-founded Nwazet, a hardware company that built cool products for makers. At the end of 2014, we sold our intellectual property to ModMyPi. Since then, I’ve been doing freelance consulting and development under the name Decent Consulting, and I’ve also been building a new CMS based on Node.js: DecentCMS… And today was my first day back at Microsoft as a Senior Program Manager.
-
Node dependency injection library extracted from DecentCMS
There are quite a few DI libraries for Node, I know, and I evaluated many of them before building my own. It’s not that the others are bad, it’s just that I needed a few unique features that I couldn’t find together in a single library. My library, Decent Injection, is exactly what I needed for DecentCMS, because it was built as its foundation, with no other requirement than to be useful to me. My goal by extracting it as its own project is to help those users who have told me that they would like to use it in their own projects. Often, when building exactly the library you need, you end up with something that others will find useful too. It’s pretty cool when it happens.
-
CMS as a service with DecentCMS
No web site should be a silo. A CMS should be great at organizing, syndicating, and presenting your content, but it should also communicate with arbitrary applications outside the CMS. In particular, mobile applications should be able to use the data from the CMS. In DecentCMS, you can enable the
content-api
feature to expose all content items as JSON documents.Content items are then available under two endpoints:
src
andshapes
. -
Querying DecentCMS, part 3: a paginated list of results
In the previous two posts, I exposed the general design of DecentCMS’ search feature, and described its indexing and querying APIs. In this post, we’ll apply what we’ve learned to build a paginated list of search results that will display the list of API documentation topics.
-
Querying DecentCMS, part2: querying the index
In the previous post, we looked at the basic concepts DecentCMS querying are built upon, and at how an index is built. In this post, we’ll examine how to query such an index in order to produce a result set.
-
Querying DecentCMS, part 1: building an index
DecentCMS’s search module provides the infrastructure to build and query search indexes, as well as a file-based implementation that is suitable for small sites. Querying in DecentCMS is based on a simple JavaScript API that is loosely based on the map/reduce pattern. The basic idea is that you first build an index, and then you can run queries on that index. The architecture ensures that querying can scale to very large content stores. It also enables querying to work in a unified way across heterogeneous storage mechanisms. Effectively, storage and querying are entirely separated.
-
Visual Studio Code first impressions
This morning, Microsoft made a surprise announcement (or two): a new cross-platform code editor named Visual Studio Code. It runs on Mac, Linux, and of course Windows. It’s lean, fast, it has IntelliSense, supports multiple languages and dev platforms, has debugging and git built-in. You can get it from the following link:
-
Writing DecentCMS documentation
Documentation is considered a feature in DecentCMS, and as such, it is expected that all modules come with tests, API documentation, and documentation topics. Documentation, like tests, are part of the same code repository as the rest of the application or module.
-
The widget layer file in a DecentCMS site
The widgets layer file can be found under
/sites/name-of-the-site/widget/index.json
. Theindex.json
file describes the layers of widgets for the site. Layers are collections of widgets that can be turned on or off by an expression that is associated with each layer and that gets evaluated for each request against an environment that can be contributed to by modules, and that can use extension rules also contributed by modules. More than one layer can be active on any given page of the site. -
DecentCMS placement files
Placement files describe how to dispatch shapes into zones. They are necessary in order to decouple UI composition from individual templates. Templates can focus on what to render, while placement determine what to render where. In yesterday’s post, I’ve shown one rudimentary example of placement. There can be a placement file at the root of each module and theme. A placement file can either be a
placement.json
file, or aplacement.js
file if the format for JSON placement files is not sufficiently flexible for the problem at hand.Placement works in a relative manner: more than one content item can appear on any given page, for example through lists of content items, or as widgets. Placement can dispatch the shapes created by the parts of a content item into the local zones under a given root shape that is usually the main shape for the content item.