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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CHAINR AI
|
| 2 |
+
|
| 3 |
+
An intelligent AI assistant that specializes in building decentralized applications (DApps) for Web3. This platform combines conversational AI with automated smart contract deployment, frontend generation, and blockchain integration.
|
| 4 |
+
|
| 5 |
+
## Features
|
| 6 |
+
|
| 7 |
+
- ๐ค AI-powered DApp architecture and code generation
|
| 8 |
+
- โ๏ธ Multi-blockchain support (Ethereum, Polygon, BSC, Arbitrum)
|
| 9 |
+
- ๐ Smart contract creation and deployment
|
| 10 |
+
- ๐จ Automated frontend generation with Web3 integration
|
| 11 |
+
- ๐ฌ Real-time chat interface for development guidance
|
| 12 |
+
- ๐ Wallet connection and authentication
|
| 13 |
+
- ๐๏ธ IPFS integration for decentralized storage
|
| 14 |
+
- ๐ Gas optimization and cost estimation
|
| 15 |
+
- ๐ Contract verification and security auditing
|
| 16 |
+
- โก One-click deployment pipeline
|
| 17 |
+
- ๐งช Automated testing suite generation
|
| 18 |
+
- ๐ฑ Mobile-responsive DApp interfaces
|
| 19 |
+
|
| 20 |
+
## Tech Stack
|
| 21 |
+
|
| 22 |
+
### Backend
|
| 23 |
+
- Node.js with Express
|
| 24 |
+
- MongoDB with Mongoose
|
| 25 |
+
- Socket.IO for real-time communication
|
| 26 |
+
- OpenAI API integration
|
| 27 |
+
- Web3.js/Ethers.js for blockchain interaction
|
| 28 |
+
- Hardhat for smart contract development
|
| 29 |
+
- IPFS client for decentralized storage
|
| 30 |
+
- Docker containerization
|
| 31 |
+
|
| 32 |
+
### Frontend
|
| 33 |
+
- React 18 with hooks
|
| 34 |
+
- Next.js for SSR and optimization
|
| 35 |
+
- Web3Modal for wallet connections
|
| 36 |
+
- Wagmi for React Web3 hooks
|
| 37 |
+
- React Query for state management
|
| 38 |
+
- Tailwind CSS for styling
|
| 39 |
+
- Chart.js for analytics dashboards
|
| 40 |
+
|
| 41 |
+
### Blockchain
|
| 42 |
+
- Solidity for smart contracts
|
| 43 |
+
- Hardhat development environment
|
| 44 |
+
- OpenZeppelin contract libraries
|
| 45 |
+
- Chainlink oracles integration
|
| 46 |
+
- The Graph for indexing
|
| 47 |
+
- MetaMask and WalletConnect support
|
| 48 |
+
|
| 49 |
+
## Quick Start
|
| 50 |
+
|
| 51 |
+
### Using Docker (Recommended)
|
| 52 |
+
|
| 53 |
+
1. Clone the repository:
|
| 54 |
+
```bash
|
| 55 |
+
git clone https://huggingface.co/chainr-ai/CHAINR
|
| 56 |
+
cd CHAINR
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
2. Set up environment variables:
|
| 60 |
+
```bash
|
| 61 |
+
cp .env.example .env
|
| 62 |
+
# Add your API keys and configuration
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
3. Start with Docker Compose:
|
| 66 |
+
```bash
|
| 67 |
+
docker-compose up -d
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
4. Access the application:
|
| 71 |
+
- Frontend: http://localhost:3000
|
| 72 |
+
- Backend API: http://localhost:5000
|
| 73 |
+
- Documentation: http://localhost:3000/docs
|
| 74 |
+
|
| 75 |
+
### Manual Installation
|
| 76 |
+
|
| 77 |
+
1. Install dependencies:
|
| 78 |
+
```bash
|
| 79 |
+
# Backend
|
| 80 |
+
cd backend
|
| 81 |
+
npm install
|
| 82 |
+
|
| 83 |
+
# Frontend
|
| 84 |
+
cd ../frontend
|
| 85 |
+
npm install
|
| 86 |
+
|
| 87 |
+
# Smart contracts
|
| 88 |
+
cd ../contracts
|
| 89 |
+
npm install
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
2. Start MongoDB and Redis:
|
| 93 |
+
```bash
|
| 94 |
+
docker run -d -p 27017:27017 mongo
|
| 95 |
+
docker run -d -p 6379:6379 redis
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
3. Run the development servers:
|
| 99 |
+
```bash
|
| 100 |
+
# Backend (Terminal 1)
|
| 101 |
+
cd backend
|
| 102 |
+
npm run dev
|
| 103 |
+
|
| 104 |
+
# Frontend (Terminal 2)
|
| 105 |
+
cd frontend
|
| 106 |
+
npm run dev
|
| 107 |
+
|
| 108 |
+
# Hardhat node (Terminal 3)
|
| 109 |
+
cd contracts
|
| 110 |
+
npx hardhat node
|
| 111 |
+
```
|
| 112 |
+
|
| 113 |
+
## Environment Variables
|
| 114 |
+
|
| 115 |
+
```env
|
| 116 |
+
# API Keys
|
| 117 |
+
OPENAI_API_KEY=your_openai_api_key
|
| 118 |
+
INFURA_PROJECT_ID=your_infura_project_id
|
| 119 |
+
ETHERSCAN_API_KEY=your_etherscan_api_key
|
| 120 |
+
PINATA_API_KEY=your_pinata_api_key
|
| 121 |
+
|
| 122 |
+
# Database
|
| 123 |
+
MONGODB_URI=mongodb://localhost:27017/chainr-ai
|
| 124 |
+
REDIS_URL=redis://localhost:6379
|
| 125 |
+
|
| 126 |
+
# Blockchain
|
| 127 |
+
PRIVATE_KEY=your_deployment_private_key
|
| 128 |
+
NETWORK=hardhat
|
| 129 |
+
|
| 130 |
+
# Application
|
| 131 |
+
JWT_SECRET=your_jwt_secret
|
| 132 |
+
FRONTEND_URL=http://localhost:3000
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
## Usage
|
| 136 |
+
|
| 137 |
+
### Creating a DApp
|
| 138 |
+
|
| 139 |
+
1. **Chat with AI**: Describe your DApp idea in natural language
|
| 140 |
+
2. **Review Architecture**: AI generates project structure and tech recommendations
|
| 141 |
+
3. **Smart Contracts**: Auto-generated Solidity contracts based on requirements
|
| 142 |
+
4. **Frontend Creation**: React components with Web3 integration
|
| 143 |
+
5. **Testing**: Automated test suite generation
|
| 144 |
+
6. **Deployment**: One-click deployment to chosen blockchain
|
| 145 |
+
|
| 146 |
+
### Example Conversation
|
| 147 |
+
|
| 148 |
+
```
|
| 149 |
+
User: "Create a NFT marketplace with royalties and auction features"
|
| 150 |
+
|
| 151 |
+
CHAINR AI: "I'll help you build an NFT marketplace DApp. Let me break this down:
|
| 152 |
+
|
| 153 |
+
๐ Smart Contracts Needed:
|
| 154 |
+
- ERC721 NFT contract with royalty support (EIP-2981)
|
| 155 |
+
- Marketplace contract with auction functionality
|
| 156 |
+
- Payment splitter for royalty distribution
|
| 157 |
+
|
| 158 |
+
๐จ Frontend Components:
|
| 159 |
+
- NFT gallery and detail pages
|
| 160 |
+
- Auction bidding interface
|
| 161 |
+
- Artist dashboard
|
| 162 |
+
- Wallet integration
|
| 163 |
+
|
| 164 |
+
Would you like me to start with the smart contracts?"
|
| 165 |
+
```
|
| 166 |
+
|
| 167 |
+
## API Endpoints
|
| 168 |
+
|
| 169 |
+
### DApp Generation
|
| 170 |
+
```
|
| 171 |
+
POST /api/dapp/generate
|
| 172 |
+
POST /api/dapp/deploy
|
| 173 |
+
GET /api/dapp/:id/status
|
| 174 |
+
```
|
| 175 |
+
|
| 176 |
+
### Smart Contracts
|
| 177 |
+
```
|
| 178 |
+
POST /api/contracts/compile
|
| 179 |
+
POST /api/contracts/deploy
|
| 180 |
+
GET /api/contracts/:address/verify
|
| 181 |
+
```
|
| 182 |
+
|
| 183 |
+
### IPFS Integration
|
| 184 |
+
```
|
| 185 |
+
POST /api/ipfs/upload
|
| 186 |
+
GET /api/ipfs/:hash
|
| 187 |
+
```
|
| 188 |
+
|
| 189 |
+
## Supported DApp Types
|
| 190 |
+
|
| 191 |
+
- ๐จ **NFT Marketplaces**: Trading, minting, royalties
|
| 192 |
+
- ๐ฆ **DeFi Protocols**: DEX, lending, staking
|
| 193 |
+
- ๐ฎ **GameFi**: Play-to-earn, NFT games
|
| 194 |
+
- ๐ณ๏ธ **DAOs**: Governance, voting, treasury
|
| 195 |
+
- ๐ช **E-commerce**: Decentralized marketplaces
|
| 196 |
+
- ๐ **Education**: Certificate verification, courses
|
| 197 |
+
- ๐ฅ **Healthcare**: Medical records, insurance
|
| 198 |
+
- ๐ฑ **Carbon Credits**: Environmental tracking
|
| 199 |
+
|
| 200 |
+
## Contributing
|
| 201 |
+
|
| 202 |
+
1. Fork the repository
|
| 203 |
+
2. Create a feature branch: `git checkout -b feature/amazing-feature`
|
| 204 |
+
3. Commit changes: `git commit -m 'Add amazing feature'`
|
| 205 |
+
4. Push to branch: `git push origin feature/amazing-feature`
|
| 206 |
+
5. Open a Pull Request
|
| 207 |
+
|
| 208 |
+
## Security
|
| 209 |
+
|
| 210 |
+
- Smart contracts audited by OpenZeppelin
|
| 211 |
+
- Rate limiting and DDoS protection
|
| 212 |
+
- Input sanitization and validation
|
| 213 |
+
- Secure wallet connection handling
|
| 214 |
+
- Private key encryption at rest
|
| 215 |
+
|
| 216 |
+
## Support
|
| 217 |
+
|
| 218 |
+
- ๐ง Email: [email protected]
|
| 219 |
+
- ๐ Website: (chainrai.xyz)
|
| 220 |
+
- ๐ Issues: [GitHub Issues](https://huggingface.co/chainr-ai/CHAINR/discussions)
|