Getting Started
This guide explains how to install and use@nanoforge-dev/schematics to scaffold NanoForge game engine projects.
Prerequisites
- Node.js 25 or later
- A package manager: npm, yarn, pnpm, or bun
Installation
Install the schematics package globally or as a project dependency:Create a New Application
Use theapplication schematic to scaffold a complete NanoForge project:
my-game/ directory with the project structure, package metadata, and base configuration files.
Options
| Flag | Description |
|---|---|
--language | ts (default) or js |
--packageManager | npm (default), yarn, pnpm, or bun |
--server | Set to true to include server configuration |
--strict | Set to false to disable strict mode |
--author | Author name for package.json |
--version | Initial version |
--description | Project description for package.json |
--directory | Custom output directory |
Generate Configuration
Create or update thenanoforge.config.json file:
nanoforge.config.json already exists in the directory tree, the schematic deep-merges new values into the
existing configuration rather than overwriting it.
Generate Client or Server Base Code
Use thepart-base schematic to scaffold the directory structure for a client or server part:
init/
directory.
Generate the Main Entry Point
Use thepart-main schematic to generate a main.ts file from a .nanoforge/<part>.save.json metadata file:
Typical Workflow
-
Scaffold the project.
-
Install dependencies.
-
Generate the client base.
-
Generate the server base if you are using server support.
-
Edit the save files in
.nanoforge/client.save.jsonand.nanoforge/server.save.json. - Generate the main entry points.
- Start developing your game logic in the generated components, systems, and init functions.