Scaffold Midnight Network applications on Preprod.
npx create-mn-app@latest my-app
cd my-app
npm run setupThe setup command:
- Starts proof server via Docker
- Compiles the Compact contract
- Deploys to Preprod (prompts for faucet funding)
Fund your wallet at faucet.preprod.midnight.network
- Zero Configuration - Start building immediately
- Preprod Ready - Deploys to Midnight Preprod network
- SDK 3.0 - Uses latest Midnight wallet and contract SDKs
- One Command Setup - Single
npm run setuphandles everything - Auto-updates - Built-in notifier for new versions
Templates are organized by category. The interactive flow guides you through category → template selection.
npx create-mn-app@latest my-app # interactive: pick category then template
npx create-mn-app@latest my-app --list # list all templates grouped by category| Template | Description |
|---|---|
hello-world (default) |
Basic message storage contract demonstrating state management |
npx create-mn-app@latest my-app
cd my-app
npm run setup # starts proof server, compiles, deploys
npm run cli # interact with deployed contract| Template | Description |
|---|---|
counter |
Increment/decrement app with zkProofs (source) |
bboard |
Multi-user bulletin board with privacy patterns (source) |
dex |
Decentralized exchange using FungibleToken (coming soon) |
midnight-kitties |
NFT-based full stack DApp (coming soon) |
npx create-mn-app@latest my-app --template counter
npx create-mn-app@latest my-app --template bboardRequires Compact compiler — the CLI will check and offer to install it.
Integration examples and patterns (coming soon).
| Requirement | Version | Notes |
|---|---|---|
| Node.js | 22+ | Required for all templates |
| Docker | Latest | Runs proof server |
| Compact Compiler | 0.28.0+ | Counter and Bboard templates (auto-install offered) |
npx create-mn-app@latest [project-name] [options]| Option | Description |
|---|---|
-t, --template <name> |
Template: hello-world, counter, bboard |
--list |
List all available templates grouped by category |
-y, --yes |
Accept all defaults (non-interactive mode) |
--dry-run |
Preview what will be created without writing files |
--from <owner/repo> |
Create from a custom GitHub repository |
--use-npm/yarn/pnpm/bun |
Force package manager |
--skip-install |
Skip dependency installation |
--skip-git |
Skip git initialization |
--verbose |
Show detailed output |
-h, --help |
Show help |
-V, --version |
Show version |
Use -y or set CI=true / GITHUB_ACTIONS=true to skip all prompts:
npx create-mn-app@latest my-app -y -t counter # defaults, no prompts
CI=true npx create-mn-app@latest my-app # auto-detected in CI
npx create-mn-app@latest my-app --dry-run # preview without writing files
npx create-mn-app@latest my-app --from user/repo # clone any GitHub repomy-app/
├── contracts/
│ └── hello-world.compact # Compact smart contract
├── src/
│ ├── cli.ts # Interact with deployed contract
│ ├── deploy.ts # Deploy contract to Preprod
│ └── check-balance.ts # Check wallet balance
├── docker-compose.yml # Proof server config
├── package.json
└── deployment.json # Generated after deploy (contains wallet seed)
- 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
Apache-2.0 © 2025 Midnight Foundation