Build-time authorization system using TypeScript's conditional types for zero-cost runtime security.
π Now Available on npm! Published under MIT License.
- Complete Documentation - Full guides and API reference
- Quick Start - Get started in 5 minutes
- Why Induction? - Understand the benefits
- GitHub Pages Setup - Deploy documentation site
Build-time authorization using conditional types
Enforces access control policies at compile-time with zero runtime overhead.
- Location:
packages/framework/ - Status: β Production Ready
- Documentation: packages/framework/README.md
Nx generators for flexible code generation
Create components with ANY naming - no hardcoded "Decider/Interactor" patterns!
- Location:
packages/induction-plugin/ - Status: β Production Ready
- Generators: 5 (project, component, api, policy, validate)
- Tests: 103/103 passing
- Documentation: packages/induction-plugin/README.md
CLI tool for scaffolding Induction projects
Quickly create new projects with the Induction framework pre-configured.
- Location:
packages/create-induction-app/ - Status: β Production Ready
- Version: v3.0.0 - Requires plugin v2.0.0+
- Usage:
npx create-induction-app my-app
# Create project
npx create-induction-app my-app
cd my-app
npm install
# Add components (any names!)
nx g @inductionai/plugin:component user-service --exposes="UserAPI"
nx g @inductionai/plugin:component admin-app --type=application --requires="UserAPI"
# Set authorization
nx g @inductionai/plugin:policy --allow="admin-app:user-service"
# Validate configuration
nx g @inductionai/plugin:validate
# Build and run
npm run buildChoose from four templates:
- quick β - Quick tutorial (~10 files, instant, offline)
- complete - Full example from GitHub (~66 files with tests & docs)
- config-only - Just config library (~8 files, instant)
- empty - Bare workspace (total freedom)
A complete example application is available at /examples/01-basic-framework-app/ demonstrating:
- Compile-time authorization enforcement
- Decider/Interactor pattern
- Service wiring and registration
- Comprehensive test suite (17 tests)
cd examples/01-basic-framework-app
npm install
npm test # Run 17 unit tests (1.2s)
npm run build # Build demo app
npm start # Run demo applicationnpm run example:test # Run example tests
npm run example:build # Build example
npm run example:serve # Run demoWorking examples can be scaffolded using the unified project generator.
# Quick tutorial (instant, offline)
npx create-induction-app my-app --template=quick
# Complete example from GitHub (with tests)
npx create-induction-app my-app --template=complete --include-tests
# Or use the generator directly
nx g @inductionai/plugin:project --template=quick
nx g @inductionai/plugin:project --template=completeBasic authorization pattern demonstration
Demonstrates:
- Compile-time authorization enforcement
- Component configuration with
induction.config.ts - Policy-based access control
- Accessible vs inaccessible component patterns
Structure:
apps/demo/ # Demo application
libs/config/ # Configuration library (IDs, APIs, policy, registry)
libs/deciders/ # Example decision components
accessible/ # Authorized component
inaccessible/ # Unauthorized component
libs/interactors/ # Example interaction components
example/ # Demonstrates authorized API access
libs/wiring/ # Component wiring
Authorization Policy: The example interactor can only access the accessible decider - attempts to access the inaccessible decider will fail at compile-time with a TypeScript error.
Each bundled example is a fully working standalone application that can be:
- Deployed to your workspace with
nx g @inductionai/plugin:example - Used as a reference for authorization patterns
- Customized and extended for your use case
# Build all packages
npm run build:all
# Build specific package
npx nx build framework
npx nx build create-induction-app
# Run tests
npm test
# Watch mode for development
npm run dev:framework
npm run dev:cliThe framework is not published to npm yet - we use npm link for local development.
# 1. Install dependencies
npm install
# 2. Build and link the framework globally
npm run link:framework
# 3. Verify the link
npm run link:status
# Should show: @inductionai/framework@1.0.0 -> .../packages/framework# CLI automatically detects and links to your local framework
npx create-induction-app my-app --template=example
cd my-app
npm install
npm run build
node dist/apps/demo/main.jsWhat happens: CLI detects the global link and automatically runs npm link @inductionai/framework in your project!
Option 1: Watch Mode (Recommended)
# Terminal 1: Run framework in watch mode
npm run dev:framework
# Terminal 2: Work on your app
cd my-app
# Framework automatically rebuilds on changes!Option 2: Manual Rebuild
# Make changes to packages/framework/src/
npx nx build framework
# Changes now available to all linked projects"Cannot find module @inductionai/framework"
# Check if framework is linked
npm run link:status
# If not linked, run:
npm run link:framework"Framework changes not appearing"
# Rebuild the framework
npx nx build framework
# Or use watch mode: npm run dev:framework"Link broken after npm install"
# Verify symlink still exists
ls -la node_modules/@inductionai/framework
# Should show: symlink β .../dist/packages/framework
# Re-link if needed
npm link @inductionai/frameworkinduction/
βββ packages/
β βββ framework/ # @inductionai/framework - Core framework
β βββ create-induction-app/ # CLI tool for project scaffolding
βββ docs/ # Documentation
β βββ archive/ # Historical documentation
βββ nx.json # Nx workspace configuration
βββ tsconfig.base.json # Base TypeScript configuration
βββ package.json # Root workspace configuration
# Install dependencies
npm install
# Build all packages
npm run build:all
# Build with watch mode
npm run dev
# Run tests
npm test
# Lint code
npm run lint
# View dependency graph
npm run graph# Publish framework package
npm run publish:framework
# Publish CLI package
npm run publish:cliThe Induction framework uses TypeScript's type system to enforce authorization policies at compile time. This means:
- Zero runtime overhead - all checks happen during compilation
- Type-safe - violations are caught by the TypeScript compiler
- Composable - policies can be combined and extended
- Testable - full TypeScript support for testing authorization logic
See the framework README for detailed architecture information.
Built with TypeScript β’ Zero Runtime Overhead β‘