react-dapp-starter is a robust and scalable template designed for building decentralized applications (DApps) with modern web technologies. This template is a production-ready foundation currently used in Manta Network, designed to meet the demands of complex and scalable DApp development.
- TypeScript: Strongly-typed language that builds on JavaScript, giving you better tooling at any scale.
- React 19: Latest React version with improved performance and new features.
- React Router 7: A declarative routing library for React that makes it easy to navigate your app.
- Tailwind CSS 4: Utility-first CSS framework with native Vite integration and CSS-first configuration.
- Reown AppKit: The toolkit to build onchain app UX with wallet connection support.
- Wagmi: A set of React Hooks for working with Ethereum.
- Viem: A toolkit for handling Ethereum-related data and logic.
- Shadcn UI: A collection of pre-built UI components for a fast and consistent development experience.
- Zustand: A small, fast, and scalable state management solution for React.
- TanStack Query: Powerful data fetching, caching, and synchronization for server state management.
- React Responsive: Media queries in React with custom breakpoint hooks.
- ESLint & Prettier: Code quality and formatting tools to ensure a clean codebase.
-
Clone the repository:
You can use a tool like degit to scaffold your project with this template.
npx degit Manta-Network/react-dapp-starter#main your-project cd your-project -
Install dependencies (default: yarn):
yarn install
-
Configure WalletConnect Project ID and Metadata:
- Visit Reown Cloud to create a project and obtain your
Project ID. - Open the file
src/config/common.tsin your project. - Locate the
WALLET_CONNECT_PROJECT_IDkey and replaceYOUR_PROJECT_IDwith your actualProject ID. - Update the
WALLET_CONNECT_METADATAsection with your project's details, including the name, description, URL, and icons.
- Visit Reown Cloud to create a project and obtain your
-
Run the development server:
yarn dev
-
Build for production:
yarn build
This template includes comprehensive responsive design support:
// Use responsive prefixes for different screen sizes
<h1 className="text-2xl md:text-4xl lg:text-5xl">Responsive Title</h1>
// Mobile-specific styles with max-md
<div className="block max-md:hidden">Desktop only</div>
<div className="hidden max-md:block">Mobile only</div>import { useResponsive } from '@/hooks/useResponsive';
function MyComponent() {
const { isMobile, isTablet, isDesktop } = useResponsive();
return isMobile ? <MobileView /> : <DesktopView />;
}For smooth font scaling across viewports (390px - 1440px):
<h1 className="text-[clamp(1rem,0.8143rem+0.7619vw,1.5rem)]">
Title smoothly scales from 16px to 24px
</h1>Use the Utopia Fluid Type Calculator to generate custom clamp values.
βββ src/
β βββ abis/ # Smart contract ABIs
β βββ api/ # Optional API endpoints definitions
β βββ assets/ # Static assets like images and fonts
β βββ components/ # Reusable UI components
β β βββ ui/ # Shadcn UI components
β βββ config/ # Application configuration files
β βββ hooks/ # Custom React hooks (useResponsive, etc.)
β βββ lib/ # Utility functions and business logic
β βββ pages/ # Application pages
β βββ store/ # Global state management using Zustand
β βββ types/ # TypeScript types
β βββ AppRouter.tsx # Application routing
β βββ index.css # Global styles & Tailwind CSS configuration
β βββ main.tsx # Main entry point
β βββ vite-env.d.ts # Vite environment variables types
βββ public/ # Static public assets
βββ .gitignore # Git ignore file
βββ .prettierrc # Prettier configuration
βββ CHANGELOG.md # Project changelog
βββ components.json # Shadcn UI components configuration
βββ eslint.config.js # ESLint configuration
βββ index.html # Main HTML file
βββ package.json # Project metadata and dependencies
βββ PROJECT_OVERVIEW.md # Overview of the project
βββ README.md # Project README
βββ tsconfig.app.json # App TypeScript configuration
βββ tsconfig.json # TypeScript configuration
βββ tsconfig.node.json # Node.js TypeScript configuration
βββ vercel.json # Vercel deployment configuration
βββ vite.config.ts # Vite configuration
βββ yarn.lock # Yarn lock file
Contributions are welcome! Please create an issue or submit a pull request if you find any bugs or have suggestions for improvements.
Special thanks to the open-source community and the maintainers of the libraries and tools used in this template.