Skip to content

moayaan1911/quickdapp

Repository files navigation

πŸš€ QuickDapp - Web3 dApp Starter Template

Next.js + Foundry + Thirdweb ready - Your complete Web3 dApp starter template with smart contracts and wallet connectivity.

✨ Features

πŸ” Secure - Enterprise-grade security with Thirdweb
πŸš€ Fast - Built with Next.js 15 and Turbopack
β›½ Gasless - Account abstraction with gas sponsoring
🌟 Multi-chain - Support for 50+ blockchain networks
⚑ Modern Stack - TypeScript, Tailwind CSS, Motion animations

πŸ—οΈ Project Structure

quickdapp/
β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ api/ai-chat/             # AI chat API endpoint
β”‚   β”œβ”€β”€ globals.css              # Global styles with Tailwind
β”‚   β”œβ”€β”€ layout.tsx               # Root layout with metadata
β”‚   └── page.tsx                 # Main landing page
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ui/                      # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ HeroSection.tsx      # Hero with typewriter effect
β”‚   β”‚   β”œβ”€β”€ SetupWarning.tsx     # Configuration instructions
β”‚   β”‚   β”œβ”€β”€ DemoSocialCreator.tsx # Video, social links, creator info
β”‚   β”‚   β”œβ”€β”€ Navbar.tsx           # Fixed navigation bar
β”‚   β”‚   β”œβ”€β”€ BackgroundParticles.tsx # Animated background
β”‚   β”‚   └── ClaimAirdrop.tsx     # Airdrop claiming interface
β”‚   β”œβ”€β”€ AiBot.tsx                # AI Bot component
β”‚   β”œβ”€β”€ AIChat.tsx               # AI Chat interface
β”‚   └── ConnectWallet.tsx        # Multi-chain wallet connector
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ client.ts                # Thirdweb client configuration
β”‚   └── contracts.ts             # Smart contract addresses and instances
β”œβ”€β”€ contracts/                   # Foundry smart contracts
β”‚   β”œβ”€β”€ src/                     # Solidity source files
β”‚   β”œβ”€β”€ test/                    # Contract tests
β”‚   β”œβ”€β”€ script/                  # Deployment scripts
β”‚   β”œβ”€β”€ .env.example             # Contracts environment variables
β”‚   └── foundry.toml            # Foundry configuration
β”œβ”€β”€ public/                      # Static assets
└── .env.example                # Frontend environment variables template

πŸš€ Quick Start

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/moayaan1911/quickdapp.git
    cd quickdapp
  2. Install dependencies

    npm install
  3. Set up environment variables

    Frontend (.env.local):

    cp .env.example .env.local

    Edit .env.local and add your Thirdweb credentials:

    NEXT_PUBLIC_THIRDWEB_CLIENT_ID=your_client_id_here
    THIRDWEB_SECRET_KEY=your_secret_key_here

    Contracts (.env):

    cd contracts
    cp .env.example .env
    cd ..

    Edit contracts/.env and add your deployment credentials (RPC URLs, private keys, etc.)

  4. Build smart contracts

    cd contracts
    forge build
    cd ..
  5. Start development server

    npm run dev

Visit http://localhost:3000 to see your dApp! πŸŽ‰

πŸ“œ QuickDapp Scripts

QuickDapp includes custom scripts for streamlined development:

npm run quickdapp-build

Build everything - Compiles smart contracts and builds Next.js app

npm run quickdapp-build

Equivalent to: forge build + next build

npm run quickdapp-dev

Start development - Compiles contracts and starts dev server

npm run quickdapp-dev

Equivalent to: forge compile + next dev --turbopack

npm run quickdapp-test

Run all tests - Tests contracts and lints frontend code

npm run quickdapp-test

Equivalent to: forge test + next lint

npm run quickdapp-clean

Clean build artifacts - Removes all build files

npm run quickdapp-clean

Equivalent to: forge clean + removes .next and out directories

βš™οΈ Configuration

Thirdweb Setup

  1. Visit Thirdweb Dashboard
  2. Create a new project
  3. Copy your Client ID and Secret Key
  4. Add them to your .env.local file

Smart Contracts

The contracts/ directory contains a complete Foundry setup:

  • src/ - Your Solidity contracts
  • test/ - Contract unit tests
  • script/ - Deployment scripts
  • foundry.toml - Foundry configuration

Smart Contract Integration

QuickDapp includes seamless contract integration through lib/contracts.ts:

  • Contract Addresses - Centralized management of deployed contract addresses
  • Contract Instances - Pre-configured Thirdweb contract instances
  • Multi-chain Support - Easy switching between different networks
  • Type Safety - Full TypeScript support for contract interactions

Example usage:

import { simpleUSDContract } from "@/lib/contracts";
import { prepareContractCall, sendTransaction } from "thirdweb";

const transaction = prepareContractCall({
  contract: simpleUSDContract,
  method: "function claimAirdrop()",
  params: [],
});

Wallet Configuration

QuickDapp supports 50+ blockchain networks out of the box:

  • Mainnets: Ethereum, Polygon, BSC, Arbitrum, Optimism, Base, Avalanche
  • Testnets: Sepolia, Mumbai, BSC Testnet, Arbitrum Sepolia, Base Sepolia
  • Layer 2s: Polygon zkEVM, Linea, Scroll, Mantle

Add more chains in components/ConnectWallet.tsx.

πŸ€– AI Features

QuickDapp includes a powerful AI Bot and Chat system powered by Thirdweb AI:

AI Bot Component

  • Smart Integration - Seamlessly integrates with your dApp
  • Context-Aware - Understands wallet connections and chain info
  • Real-time Responses - Instant AI-powered assistance

AI Chat Interface

  • Interactive Chat - Full-featured chat interface with message history
  • Multi-chain Support - Works across all supported blockchain networks
  • Wallet Integration - Automatically includes user's wallet context
  • Error Handling - Graceful handling of API errors and configuration issues

AI Capabilities

  • πŸ” Blockchain Queries - Check balances, transaction history, token info
  • πŸ“Š DeFi Operations - Help with swaps, liquidity, and protocol interactions
  • πŸ“ Smart Contracts - Assistance with contract deployment and interaction
  • πŸ–ΌοΈ NFT Operations - Support for minting, transfers, and NFT analysis
  • πŸ’‘ Web3 Education - Explanations of blockchain concepts and best practices

🎨 UI Components

Hero Section

  • Typewriter animation for "QuickDapp" title
  • Tech stack badges highlighting key technologies
  • Gradient text effects and smooth animations

Wallet Connection

  • 50+ blockchain networks with automatic switching
  • Dynamic theming based on connection status
  • Account abstraction with gas sponsoring
  • ENS support for readable addresses

Airdrop Claiming

  • Conditional visibility - Only appears when wallet is connected
  • Smart contract integration - Directly calls contract functions
  • Transaction handling - Secure transaction preparation and execution
  • Status feedback - Loading, success, and error states with animations
  • One-click claiming - Simple interface for token airdrops

Social Integration

  • GitHub repository linking
  • Creator support via Buy Me Coffee
  • Professional profile with contact information
  • Demo video showcase

πŸ› οΈ Development

Adding New Components

Create components in components/ui/ directory:

// components/ui/MyComponent.tsx
"use client";
import { motion } from "motion/react";

export default function MyComponent() {
  return (
    <motion.div
      initial={{ opacity: 0 }}
      animate={{ opacity: 1 }}
      className="p-4">
      {/* Your component content */}
    </motion.div>
  );
}

Smart Contract Development

  1. Create contract in contracts/src/
  2. Write tests in contracts/test/
  3. Compile with forge build
  4. Test with forge test
  5. Deploy with forge script

Environment Variables

Required environment variables:

# Thirdweb Configuration
NEXT_PUBLIC_THIRDWEB_CLIENT_ID=your_client_id_here
THIRDWEB_SECRET_KEY=your_secret_key_here

πŸ“š Tech Stack

Frontend

  • ⚑ Next.js 15 - React framework with App Router
  • 🎨 Tailwind CSS - Utility-first CSS framework
  • ✨ Motion - Animation library (Framer Motion v12)
  • πŸ”· TypeScript - Type-safe JavaScript
  • 🎯 React Icons - Comprehensive icon library

Web3

  • 🌐 Thirdweb v5 - Web3 development platform
  • ⚑ Ethers.js v6 - Ethereum JavaScript library
  • πŸ”— Multi-chain - 50+ blockchain networks

Smart Contracts

  • βš’οΈ Foundry - Fast Solidity development framework
  • πŸ“ Solidity - Smart contract programming language
  • πŸ§ͺ Forge - Testing and deployment tools

Development

  • πŸ“¦ npm/yarn/pnpm - Package management
  • πŸ”§ ESLint - Code linting and formatting
  • πŸ—οΈ Turbopack - Fast bundler for development

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

⭐ Support

If you found this helpful, please give it a ⭐ on GitHub and consider buying me a coffee!

About

Your complete Web3 dApp starter template with smart contracts, wallet connectivity, and AI assistant.

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •