create-mn-app
v0.3.19
Published
Create Midnight Network applications with zero configuration
Maintainers
Readme
create-mn-app
Scaffold Midnight Network applications on Preprod.
Quick Start
npx create-mn-app 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
Why create-mn-app?
- 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
Hello World (Default)
Basic message storage contract demonstrating state management.
npx create-mn-app my-app
cd my-app
npm run setup # starts proof server, compiles, deploys
npm run cli # interact with deployed contractCounter
Increment/decrement counter with zkProofs. Cloned from midnightntwrk/example-counter.
npx create-mn-app my-app --template counter
cd my-app
npm install
# follow displayed instructionsRequires Compact compiler - the CLI will check and offer to install it.
Bulletin Board (Bboard)
Multi-user bulletin board with privacy patterns. Includes CLI and Web UI. Cloned from midnightntwrk/example-bboard.
npx create-mn-app my-app --template bboard
cd my-app
npm install
# follow displayed instructionsRequires Compact compiler and Lace wallet extension (for Web UI).
Coming Soon
- DEX - Decentralized exchange using FungibleToken
- Midnight Kitties - NFT-based full stack DApp
Requirements
| Requirement | Version | Notes | | ---------------- | ------- | -------------------------------------------- | | Node.js | 22+ | Required for all templates | | Docker | Latest | Runs proof server | | Compact Compiler | 0.23.0+ | Counter template only (auto-install offered) |
CLI Options
npx create-mn-app [project-name] [options]| Option | Description |
| ------------------------- | ---------------------------------- |
| -t, --template <name> | Template: hello-world, counter |
| --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 |
Project Structure
my-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)Contributing
- 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
