This repository contains templates and extensions for the https://www.npmjs.com/package/create-awesome-node-app package.
-
Fork this repository.
-
Add your template or extension to the
templates
orextensions
folder respectively (see below for more details). -
Add your template or extension to the
templates.json
file in thetemplates
orextensions
property respectively with the following format:{ "slug": "template-slug", "name": "Template Name", "description": "Template description", "url": "https://github.com/username/repository/tree/branch/path/to/template", "type": "template_type", "category": "template_category", "labels": ["template", "labels"] }
Check the template properties section for more details.
-
Create a pull request!
The templates.json
file is the core configuration file that defines all available templates, extensions, and categories.
The categories
property provides metadata about the types of templates available. Each category includes:
- slug: A unique identifier for the category.
- name: The display name of the category.
- description: A short description of the category.
- details: Additional details about the category.
- labels: Keywords associated with the category.
{
"categories": [
{
"slug": "frontend-applications",
"name": "Frontend Applications",
"description": "Templates for building modern web interfaces.",
"details": "Discover templates for React, Vue, and other frontend frameworks to build beautiful user interfaces.",
"labels": ["Frontend", "UI", "React", "Vue", "Web"]
}
]
}
When you run create-awesome-node-app
, you can specify a base template and a list of extensions. The CLI uses the templates.json
file to:
- Match the selected template by its
slug
. - Filter compatible extensions based on the
type
of the selected template. - Apply the template and extensions to generate your project.
For example:
create-awesome-node-app --template react-vite-boilerplate --addons material-ui github-setup
- The
react-vite-boilerplate
template is selected as the base. - The
material-ui
andgithub-setup
extensions are added, as they are compatible with thereact
type.
Property | Description | Type |
---|---|---|
slug | A unique identifier for the template or extension, typically a URL-friendly version of the name. | string |
name | The name of the template or extension | string |
description | A short description of the template or extension | string |
url | The URL to the template or extension. For example, if you want to use a template from a GitHub repository, you can use the following format: https://github.com/username/repository/tree/branch/path/to/template |
string |
type | The type of the template or extension. Can be any value that will be used to group templates and extensions. For example, if you want to add a new template and five extensions related to it, you can use the same type for all of them. | string |
category | The category of the template or extension. Can be any value that will be used to group templates and extensions. | string |
labels | An array of labels that will be used to filter templates and extensions. | string[] |
{
"templates": [
{
"name": "React Vite Boilerplate",
"slug": "react-vite-boilerplate",
"description": "A highly opinionated React boilerplate with Vite, TypeScript, ESLint, Prettier, and more.",
"url": "https://github.com/Create-Node-App/cna-templates/tree/main/templates/react-vite-starter",
"type": "react",
"category": "Frontend Application",
"labels": ["React", "Vite", "TypeScript", "ESLint", "Prettier"]
}
],
"extensions": [
{
"name": "Material UI",
"slug": "material-ui",
"description": "Extension to add Material UI to your React app",
"url": "https://github.com/Create-Node-App/cna-templates/tree/main/extensions/react-material-ui",
"type": "react",
"category": "UI",
"labels": ["React", "Material UI"]
}
]
}
To ensure compatibility, the type
property of an extension must match the type
of the template. For example:
- A template with
type: "react"
can use extensions withtype: "react"
. - An extension with
type: ["react", "nextjs"]
can be used with bothreact
andnextjs
templates.
To create a project, use the CLI as follows:
create-awesome-node-app --template <template-slug> --addons <extension-slug-1> <extension-slug-2>
For example:
create-awesome-node-app --template react-vite-boilerplate --addons material-ui github-setup
This will scaffold a React project with Vite and add Material UI and GitHub setup extensions.