AI Scaffolding Documentation
This section contains documentation for AI Scaffolding and its packages. Use it to understand the architecture, create new packages, and extend the tool's functionality.
How AI Scaffolding Works
AI Scaffolding is an interactive CLI tool designed to generate customized web3 project templates with a selection of frameworks and libraries.
It follows a modular architecture that makes it easy to extend with new packages.
Core Workflow
The tool operates in two main phases:
1. Prompt Phase
Collects user input through interactive prompts to configure the project:
- Project name and location
- Package manager (npm, yarn, pnpm)
- Packages to include (Hardhat, Vite, Next.js, NestJS)
- Framework-specific options (networks, libraries, etc.)
2. Execution Phase
Generates the project structure based on the collected configuration:
- Creates directory structure
- Copies template files from selected packages
- Processes templates with Handlebars
- Installs dependencies
- Sets up Git repository
Key Components
- Package Templates: Modular code templates in
src/packages/ - Handlebars Templates: Dynamic file generation with conditional logic
- Builder System: Orchestrates the creation of projects and packages
Example Usage
# Install globally
npm install -g @appliedblockchain/ai-scaffolding
# Create a new project
ai-scaffolding my-web3-appDuring the process, you'll be asked to select packages and configure options. The tool will then generate a fully functional project structure with all the selected components properly integrated.
Project Structure
AI Scaffolding generates projects with a standard monorepo structure:
my-web3-app/
├── packages/ # Monorepo packages directory
│ ├── hardhat/ # Smart contract development (if selected)
│ ├── vite/ # Frontend app using Vite (if selected)
│ ├── nextjs/ # Frontend app using Next.js (if selected)
│ └── nestjs/ # Backend service using NestJS (if selected)
├── package.json # Root package.json with workspace configuration
├── .cursorrules # AI assistant rules for development
└── README.md # Project documentationNext Steps
To learn more about extending AI Scaffolding with new features or packages, check out:
- Structure - Detailed overview of the AI Scaffolding codebase
- Development - How to create new packages and extend functionality
- Handlebars - Documentation for Handlebars templates