create-induction-app
v3.0.0
Published
Create a new Induction app with build-time authorization
Maintainers
Readme
create-induction-app
Create a new Induction app with build-time authorization using powerful Nx generators.
v3.0.0: Requires @inductionai/plugin@^2.0.0 - simplified, cleaner architecture!
Quick Start
# Interactive
npx create-induction-app my-app
# Direct
npx create-induction-app my-app --template=quickFeatures
- ✅ No Hardcoded Patterns - Use ANY component naming (services, modules, handlers, etc.)
- ✅ Flexible Architecture - Define ANY directory structure
- ✅ Powerful Generators - Add components with one command
- ✅ Configuration Validation - Catch errors early
- ✅ Implementation Boilerplate - Auto-generated code with TODO markers
Usage
Interactive Mode (Recommended)
npx create-induction-app my-appPrompts:
- Project name
- Template selection (quick, complete, config-only, empty)
- Git initialization
- Dependency installation
Direct Mode
# Quick tutorial (instant, offline, ~10 files)
npx create-induction-app my-app --template=quick --git --install
# Complete example from GitHub (~66 files with tests & docs)
npx create-induction-app my-app --template=complete --git --install
# Config library only (instant, ~8 files)
npx create-induction-app my-app --template=config-only
# Empty workspace (minimal)
npx create-induction-app my-app --template=empty
# Custom GitHub repository (latest)
npx create-induction-app my-app --template=user/repo
# Custom with specific version/branch
npx create-induction-app my-app --template=user/repo#v1.0.0
npx create-induction-app my-app --template=user/repo#develop
npx create-induction-app my-app --template=user/repo/subdirectory#branch
# CI mode (no prompts)
npx create-induction-app my-app --template=quick --ciGitHub Template Syntax:
user/repo- Latest from default branchuser/repo#branch- Specific branchuser/repo#v1.0.0- Specific taguser/repo#abc1234- Specific commituser/repo/path- Subdirectory- Complete template is version-locked: fetches from plugin version tag automatically
Templates
quick ⭐ DEFAULT
Quick tutorial demonstrating compile-time authorization (~10 files, instant):
- Simple DemoApp → GreeterService example
- Shows authorization in action
- Works offline
- Perfect for learning
Run with: npm start
complete
Full example from GitHub with tests, docs, and multiple components (~66 files):
- Version-locked to plugin version (reproducible builds)
- Multiple deciders, interactors, wiring
- 17 unit tests (use --include-tests flag)
- Comprehensive WALKTHROUGH.md
- Production-ready patterns
Fetch time: ~5-10s first time, ~1s cached
Note: Fetches from version tag for consistency. For latest:
--template=inductionAI/fwk/examples/01-basic-framework-app
config-only
Just the config library setup (~8 files, instant):
- libs/config/ with all authorization files
- Build your own architecture
- No demo app
Perfect for experienced users.
empty
Bare Nx workspace with Induction marker:
- Just .induction/config.json
- Total freedom to structure as you want
Perfect for complete control.
After Creation
cd my-app
# Add new components
nx g @induction/plugin:component user-service --exposes="UserAPI"
# Manage authorization
nx g @induction/plugin:policy --allow="example-app:user-service"
# Validate configuration
nx g @induction/plugin:validate
# Build and run
npm run buildOptions
--template <type>- Template to use:quick,complete,config-only,empty, or GitHub repo (default: prompt)--git/--no-git- Initialize git repository (default: prompt)--install/--no-install- Install dependencies (default: prompt)--include-tests- Include test files in complete template (default: false)--ci- CI mode (no prompts)--dry-run- Show what would be created without creating
What is Induction?
Induction is a build-time authorization framework that uses TypeScript conditional types to enforce access control at compile time. Unauthorized access attempts fail during development, not at runtime.
Key Features
- Zero Runtime Cost - All authorization checks at compile time
- Type Safety - Impossible to call unauthorized services
- Flexible Architecture - Define ANY structure with generators
- Validation - Check configuration for errors
- Migration - Convert legacy template projects automatically
Migrating from v1.x
If upgrading from earlier versions:
CLI v1.x/v2.x → v3.0.0:
- Now requires
@inductionai/plugin@^2.0.0 - Deprecated generators removed (init, example, minimal, migrate)
- All scaffolding uses
projectgenerator
Plugin v1.x → v2.0.0:
nx g init→nx g project --template=config-onlynx g example→nx g project --template=quickor--template=completenx g minimal→nx g project --template=config-onlynx g migrate→ Removed (was for legacy template migration)
See: Plugin CHANGELOG for full v2.0.0 migration guide.
Examples
E-Commerce Platform
npx create-induction-app my-shop --template=config-only
cd my-shop
# Create services
nx g @induction/plugin:component product-service --exposes="ProductAPI"
nx g @induction/plugin:component order-service --exposes="OrderAPI"
nx g @induction/plugin:component payment-service --exposes="PaymentAPI"
# Create applications
nx g @induction/plugin:component admin-portal --type=application
nx g @induction/plugin:component customer-app --type=application
# Set authorization
nx g @induction/plugin:policy --allow="admin-portal:product-service"
nx g @induction/plugin:policy --allow="admin-portal:order-service"
nx g @induction/plugin:policy --allow="admin-portal:payment-service"
nx g @induction/plugin:policy --allow="customer-app:product-service"
nx g @induction/plugin:policy --allow="customer-app:order-service"
# Note: customer-app does NOT get payment-service access!
# Validate
nx g @induction/plugin:validate
# Build
npm run buildRequirements
- Node.js >= 18.0.0
- npm or yarn
- Network access (for Nx workspace creation)
Documentation
- Generator Plugin: packages/induction-plugin/README.md
- Framework: packages/framework/README.md
- Migration Guide: docs/2025-10-25-2027-TEMPLATE-TO-GENERATOR-MIGRATION-GUIDE.md
- Main Documentation: README.md
License
MIT
