
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
create-universal-dapp
Advanced tools
CLI tool to scaffold Push Chain universal applications with Next.js or Vite
A CLI tool to scaffold Push Chain applications with your choice of framework and tooling.
npm install -g create-universal-dapp
create-universal-dapp my-app
Or use npx:
npx create-universal-dapp my-app
Run the CLI without arguments to enter interactive mode:
create-universal-dapp
You'll be prompted to:
create-universal-dapp my-app --framework nextjs --eslint
Available options:
-f, --framework <framework>
: Choose 'nextjs' or 'vite'--eslint / --no-eslint
: Include/exclude ESLint configurationmy-app/
├── src/
│ ├── app/
│ │ ├── globals.css
│ │ ├── layout.tsx
│ │ └── page.tsx
│ ├── components/
│ └── lib/
│ ├── pushchain.tsx # Push Chain provider
│ └── utils.ts # Utility functions
├── package.json
├── next.config.js
├── tsconfig.json
└── tailwind.config.js
my-app/
├── src/
│ ├── components/
│ ├── lib/
│ │ ├── pushchain.tsx # Push Chain provider
│ │ └── utils.ts # Utility functions
│ ├── App.tsx
│ ├── main.tsx
│ └── index.css
├── index.html
├── package.json
├── vite.config.ts
├── tsconfig.json
└── tailwind.config.js
The generated project includes:
A React context provider that manages the Push Chain connection:
import { usePushChain } from '@/lib/pushchain'
function MyComponent() {
const { pushChain, isConnected, connect, disconnect, error } = usePushChain()
// Use Push Chain methods here
}
A working example showing how to:
Configure your Push Chain settings:
# Next.js
NEXT_PUBLIC_PUSHCHAIN_API_KEY=your_api_key_here
NEXT_PUBLIC_PUSHCHAIN_NETWORK=testnet
# Vite
VITE_PUSHCHAIN_API_KEY=your_api_key_here
VITE_PUSHCHAIN_NETWORK=testnet
To work on this CLI tool:
git clone https://github.com/pushchain/create-universal-dapp
cd create-universal-dapp
npm install
npm run build
npm link
Then you can test it:
create-universal-dapp test-app
npm run build
- Build the CLInpm run dev
- Run in development modenpm start
- Run the built CLIAfter creating your project:
Contributions are welcome! Please feel free to submit a Pull Request.
MIT
FAQs
CLI tool to scaffold Push Chain universal applications with Next.js or Vite
We found that create-universal-dapp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.