create-mn-app
v0.3.7
Published
Create Midnight Network applications with zero configuration
Maintainers
Readme
create-mn-app
Scaffold Midnight Network applications.
Installation
Recommended (no install needed):
npx create-mn-app my-app
cd my-app
npm run setupOr install globally:
npm i -g create-mn-app
create-mn-app my-appUsing
npxis recommended - it always runs the latest version without needing updates.
Why create-mn-app?
- Zero Configuration: Start building immediately without complex setup
- Best Practices: Pre-configured TypeScript, hot reloading, and project structure
- Production Ready: Includes wallet generation, environment management, and deployment scripts
- Developer Experience: Interactive prompts, health checks, and helpful error messages
- Stay Updated: Built-in update notifier keeps you on the latest version
Features
- Interactive project setup with template selection
- Auto-detects package manager (npm/yarn/pnpm/bun)
- Smart dependency management:
- Checks Node.js, Docker, and Compact compiler versions
- Automatic Compact compiler updates when version mismatch detected
- Prompts user before updating with clear explanations
- TypeScript with hot reloading
- Pre-configured Compact contracts
- Secure wallet generation
- Environment health checks
Quick Start
Interactive Mode
npx create-mn-appCLI Mode
npx create-mn-app my-app --template hello-world
cd my-app
npm run setupTemplates
Hello World (Default)
Basic message storage contract demonstrating state management and deployment.
npx create-mn-app my-appCounter DApp
Real-world example with increment/decrement state and zkProofs.
npx create-mn-app my-app --template counterCloned from Midnight Network's example-counter. Requires Node.js 22+, Docker, and Compact compiler.
After creation:
cd my-app
npm install
# Follow setup instructions displayedComing Soon
- Bulletin Board - Multi-user interactions with privacy patterns
- DEX - Decentralized exchange using FungibleToken
- Midnight Kitties - NFT-based full stack DApp
Requirements
- Node.js 22+ - Required for all templates
- Docker - Required for running the proof server
- npm/yarn/pnpm/bun - Package manager (auto-detected)
- Compact Compiler 0.23.0+ - Required for Counter template
- Auto-update available: If you have an older version, the CLI will offer to update it automatically
- Version compatibility checked before project creation
- Manual installation: See Compact releases
CLI Options
npx create-mn-app [project-name] [options]
Options:
-t, --template <name> Template: hello-world, counter
--use-npm Use npm
--use-yarn Use Yarn
--use-pnpm Use pnpm
--use-bun Use bun
--skip-install Skip dependency installation
--skip-git Skip git initialization
--verbose Show detailed output
-h, --help Help
-V, --version VersionProject Structure
create-mn-app/
├── bin/
│ └── create-midnight-app.js # CLI entry point
├── src/
│ ├── cli.ts # Main CLI logic
│ ├── create-app.ts # Project scaffolding
│ ├── installers/ # Package & proof server setup
│ └── utils/ # Helpers & templates
├── templates/
│ └── hello-world/ # Bundled template
├── package.json
└── tsconfig.jsonContributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Links
License
Apache-2.0 © 2025 Midnight Foundation
See LICENSE for more information.
