Architecture
March 10, 2026 · View on GitHub
How the System Works
A user runs:
npx create-awesome-node-app --template <slug> --addons <ext1> <ext2>
CNA resolves each slug to a url in templates.json, downloads the directories, merges them, and writes the final project to disk. The merge order is: base template files → each extension in order.
templates.json Structure
Three top-level keys: categories, templates, extensions.
Every template and extension requires: name, slug, description, url, type, category, labels.
Templates may also have customOptions (interactive CLI prompts — see AUTHORING.md).
The Type System
type is what connects templates to extensions. A template has a single string type. An extension has a string or array of strings. An extension is compatible with a template when the template's type appears in the extension's type list.
compatible = [ext.type].flat().includes(template.type)
Template types
| Slug | Type |
|---|---|
nestjs-boilerplate | nestjs-backend |
nextjs-starter | nextjs |
turborepo-boilerplate | monorepo |
react-vite-boilerplate | react |
web-extension-react-boilerplate | webextension-react |
webdriverio-boilerplate | webdriverio |
Generation Flow
- Resolve
urlfor template and each selected extension fromtemplates.json - Copy static files from template directory
- Process special files (
.template,.append,.if-pnpm) — see AUTHORING.md - Rename
[bracket]/directories based oncustomOptionsanswers - Generate
package.jsonby callingpackage/index.js(or using the staticpackage.json) - Merge extension files and dependencies on top
- Write final project to disk