This guide covers how to use the Freshmint CLI tool to create and manage an NFT application on Flow.
npm install -g freshmint
- Install the Flow CLI.
- Verify that the Flow CLI is installed and callable by running:
flow version
Start by creating a new Freshmint project:
fresh start your-project-name
cd ./your-project-name
This command creates a new directory with the following:
- A custom NFT contract, just for you!
- Transactions and scripts to interact with your contract.
- Sample NFTs and image assets (in
nfts.csv
andassets
). - A pre-built Next.js web app for running a live drop.
- A project configuration file (
freshmint.yaml
). - Flow configuration files.
Freshmint uses the Flow emulator and FCL dev wallet for rapid local development.
This command launches the emulator and dev wallet, then deploys all Cadence contracts.
Keep it running while you build!
fresh dev
Freshmint uses NFT.Storage to upload and pin files to IPFS.
- Sign up for a free NFT.Storage account.
- Create a new API key in the dashboard.
- Add the API key to the
.env
file:
# .env
PINNING_SERVICE_ENDPOINT="https://nft.storage/api"
PINNING_SERVICE_KEY="Paste your NFT.Storage key here!"
This command mints the NFTs listed in nfts.csv
(or editions.csv
for edition contracts).
Before minting, it also pins images and other media to IPFS.
Your project comes with a few sample NFTs, but you can edit that file to add your own! We recommend using a spreadsheet tool like Microsoft Excel, Google Sheets, Numbers for Mac or Excel Viewer for VS Code.
fresh mint
Install and run the pre-built Next.js web app:
# Switch to the web app directory
cd ./web
npm install
npm run dev
The start-drop
command creates a new drop that lists all of your minted NFTs for the same price.
Users can purchase NFTs on a first come, first served basis in the same order they were minted.
# Start a drop with a price of 42 FLOW
fresh start-drop 42.0
# Stop a running drop
fresh stop-drop