Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Commit c3453d1

Browse files
committed
docs: update README with create-mn-app package name and comprehensive documentation
1 parent 1a28564 commit c3453d1

File tree

1 file changed

+177
-13
lines changed

1 file changed

+177
-13
lines changed

README.md

Lines changed: 177 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,209 @@
1-
# create-midnight-app
1+
# create-mn-app 🌙
22

33
Create Midnight Network applications with zero configuration.
44

5+
[![npm version](https://img.shields.io/npm/v/create-mn-app.svg)](https://www.npmjs.com/package/create-mn-app)
6+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7+
58
```bash
6-
npx create-midnight-app my-app
9+
npx create-mn-app my-app
710
cd my-app
811
npm run dev
912
```
1013

1114
## Features
1215

13-
-**Zero configuration** - Works out of the box
16+
-**Zero configuration** - Works out of the box with sensible defaults
1417
- 🔧 **Modern tooling** - TypeScript, hot reloading, auto-compilation
1518
- 🛡️ **Best practices** - Secure wallet generation, proper project structure
1619
- 🚀 **Fast setup** - From zero to working app in 60 seconds
1720
- 🎯 **Developer friendly** - Clear error messages, helpful guides
21+
- 📦 **ES Modules** - Modern JavaScript module system
22+
- 🐳 **Docker integration** - Automated proof server setup
1823

1924
## Quick Start
2025

2126
```bash
22-
# Create new app
23-
npx create-midnight-app my-midnight-app
27+
# Create a new Midnight app
28+
npx create-mn-app my-midnight-app
2429

25-
# Enter directory
30+
# Navigate to your project
2631
cd my-midnight-app
2732

28-
# Start development
33+
# Start development server with hot reloading
2934
npm run dev
3035
```
3136

37+
## What's Included?
38+
39+
Your generated project includes:
40+
41+
- 📝 **Hello World Contract** - A simple Compact contract to get started
42+
- 🔐 **Wallet Setup** - Auto-generated wallet with secure seed phrase
43+
- 🛠️ **Development Environment** - Pre-configured TypeScript, nodemon, and build tools
44+
- 📚 **Provider Setup** - Midnight network providers (indexer, proof, state, ZK config)
45+
- 🎨 **Interactive CLI** - Test your contracts with a user-friendly command-line interface
46+
- 📋 **Environment Config** - `.env` file with network configuration
47+
- 🔄 **Git Ready** - Initialized git repository with proper `.gitignore`
48+
49+
## Available Commands
50+
51+
Once your project is created, you can run:
52+
53+
### `npm run dev`
54+
Starts the development server with:
55+
- Docker-based proof server on port 6300
56+
- File watcher for automatic recompilation
57+
- Hot reloading for contract changes
58+
59+
### `npm run setup`
60+
Complete setup pipeline:
61+
1. Compiles Compact contracts
62+
2. Builds TypeScript to JavaScript
63+
3. Deploys contracts to the network
64+
65+
### `npm run cli`
66+
Opens an interactive command-line interface to:
67+
- Connect your wallet
68+
- Store messages in the contract
69+
- Retrieve stored messages
70+
- Test contract functionality
71+
72+
### `npm run compile`
73+
Compiles your Compact smart contracts from `contracts/` to `contracts/managed/`
74+
75+
### `npm run build`
76+
Builds your TypeScript source code to JavaScript in the `dist/` directory
77+
78+
### `npm run deploy`
79+
Deploys your compiled contract to the Midnight testnet
80+
81+
## Project Structure
82+
83+
```
84+
my-midnight-app/
85+
├── contracts/
86+
│ ├── hello-world.compact # Your Compact smart contract
87+
│ └── managed/ # Compiled contract output
88+
├── src/
89+
│ ├── cli.ts # Interactive CLI application
90+
│ ├── deploy.ts # Contract deployment script
91+
│ ├── providers/
92+
│ │ └── midnight-providers.ts # Network provider configuration
93+
│ └── utils/
94+
│ └── environment.ts # Environment management
95+
├── .env # Environment variables & wallet seed
96+
├── .gitignore
97+
├── package.json
98+
├── tsconfig.json
99+
└── nodemon.json
100+
```
101+
32102
## Templates
33103

34-
- **hello-world** (default) - Simple message storage contract
35-
- More templates coming soon!
104+
### Hello World (Default)
105+
A simple message storage contract demonstrating:
106+
- State management
107+
- Public and private data
108+
- Contract deployment
109+
- Interactive testing
110+
111+
**More templates coming soon!**
36112

37113
## Requirements
38114

39-
- Node.js 18+
40-
- Docker (for proof server)
115+
- **Node.js** 18.0.0 or higher
116+
- **Docker** (for running the proof server)
117+
- **npm**, **yarn**, or **pnpm** package manager
118+
119+
## Package Manager Options
120+
121+
You can use your preferred package manager:
122+
123+
```bash
124+
# npm (default)
125+
npx create-mn-app my-app
126+
127+
# Yarn
128+
npx create-mn-app my-app --yarn
129+
130+
# pnpm
131+
npx create-mn-app my-app --pnpm
132+
```
133+
134+
## Usage Options
135+
136+
```bash
137+
npx create-mn-app [project-name] [options]
138+
139+
Options:
140+
--template <name> Specify a template (default: hello-world)
141+
--yarn Use Yarn as package manager
142+
--pnpm Use pnpm as package manager
143+
--npm Use npm as package manager
144+
--skip-install Skip dependency installation
145+
--skip-git Skip git initialization
146+
-h, --help Display help information
147+
```
148+
149+
## Environment Configuration
150+
151+
Your `.env` file contains important configuration:
152+
153+
```env
154+
# Wallet Configuration
155+
WALLET_SEED=your-generated-seed-phrase
156+
157+
# Network Configuration
158+
MIDNIGHT_NETWORK=testnet
159+
INDEXER_URL=https://indexer.testnet.midnight.network
160+
INDEXER_WS_URL=wss://indexer.testnet.midnight.network
161+
PROOF_SERVER_URL=http://localhost:6300
162+
```
163+
164+
⚠️ **Important**: Never commit your `.env` file or share your wallet seed phrase!
165+
166+
## Troubleshooting
167+
168+
### Port 6300 already in use
169+
If you see "Bind for 0.0.0.0:6300 failed: port is already allocated":
170+
```bash
171+
# Stop the existing proof server
172+
docker ps
173+
docker stop <container-id>
174+
175+
# Or run on a different port (update .env accordingly)
176+
```
177+
178+
### Module resolution errors
179+
Make sure you're using Node.js 18+ and the project was created with the latest version:
180+
```bash
181+
node --version
182+
npx create-mn-app@latest my-app
183+
```
184+
185+
### Docker not running
186+
Ensure Docker Desktop is running before starting the development server:
187+
```bash
188+
docker --version
189+
```
41190

42191
## Learn More
43192

44-
- [Midnight Documentation](https://docs.midnight.network)
45-
- [Getting Started Guide](https://docs.midnight.network/getting-started)
193+
- 📖 [Midnight Documentation](https://docs.midnight.network)
194+
- 🚀 [Getting Started Guide](https://docs.midnight.network/getting-started)
195+
- 💬 [Midnight Discord Community](https://discord.gg/midnight)
196+
- 🐙 [GitHub Repository](https://github.com/Olanetsoft/create-midnight-app)
197+
198+
## Contributing
199+
200+
Contributions are welcome! Please feel free to submit a Pull Request.
201+
202+
## License
203+
204+
MIT © [Olanetsoft](https://github.com/Olanetsoft)
205+
206+
---
207+
208+
Built with ❤️ for the Midnight Network community 🌙✨
209+

0 commit comments

Comments
 (0)