A Next.js application that allows users to write comments to the Ethereum Comments Protocol (ECP). Built with TypeScript, Tailwind CSS, shadcn/ui, RainbowKit for wallet connection, and the ECP SDK.
- 🔗 Wallet Connection: Connect your Ethereum wallet using RainbowKit
- ✍️ Rich Text Editor: Write comments using the ECP React Editor with support for mentions and file uploads
- 📝 Comment Form: Fill out all required fields for posting comments to the ECP protocol
- 🎨 Modern UI: Beautiful, responsive interface built with shadcn/ui and Tailwind CSS
- 🔒 TypeScript: Full type safety throughout the application
- Framework: Next.js 14 with App Router
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: shadcn/ui
- Wallet Connection: RainbowKit + Wagmi
- Ethereum Comments Protocol: @ecp.eth/sdk + @ecp.eth/react-editor
- Blockchain: Viem for Ethereum interactions
- Node.js 18+
- npm or yarn
- An Ethereum wallet (MetaMask, WalletConnect, etc.)
- Clone the repository:
git clone <repository-url>
cd ecp-share- Install dependencies:
npm install- Set up your environment variables:
cp .env.example .env.localEdit .env.local and add your WalletConnect project ID:
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_project_id_here
- Run the development server:
npm run dev- Open http://localhost:3000 in your browser.
- Connect Your Wallet: Click the "Connect Wallet" button and select your preferred wallet
- Select Channel: Choose a channel for your comment (General, Development, Community)
- Write Your Comment: Use the rich text editor to write your comment
- Add Target URI (Optional): Specify the URL or URI this comment is about
- Add Metadata (Optional): Include additional metadata in JSON format
- Post Comment: Click "Post Comment" to submit your comment to the ECP protocol
src/
├── app/ # Next.js App Router
│ ├── layout.tsx # Root layout with providers
│ ├── page.tsx # Main page component
│ └── providers.tsx # RainbowKit and Wagmi providers
├── components/ # React components
│ ├── comment-form.tsx # Main comment form component
│ └── ui/ # shadcn/ui components
└── lib/ # Utility functions
├── utils.ts # Utility functions
└── wagmi.ts # Wagmi configuration
To use WalletConnect for wallet connections, you need to:
- Go to WalletConnect Cloud
- Create a new project
- Copy your project ID
- Add it to your
.env.localfile
The application is configured to support:
- Ethereum Mainnet
- Sepolia Testnet
You can modify the supported networks in src/lib/wagmi.ts.
This application integrates with the Ethereum Comments Protocol using:
- @ecp.eth/sdk: Core SDK for interacting with the ECP protocol
- @ecp.eth/react-editor: Rich text editor component with mentions and file uploads
Each comment includes:
- Content: The main comment text (rich text format)
- Channel ID: The channel where the comment is posted
- Target URI (Optional): The URL or URI the comment is about
- Metadata (Optional): Additional structured data
- Author: The Ethereum address of the comment author
- App: The application signature for posting
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
To add new shadcn/ui components:
npx shadcn@latest add <component-name>- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details.