Skip to content

Utkarsh352/hardcore

Repository files navigation

Hardcore-AI

Next-generation DeFi interface powered by AI and Core Blockchain

Hardcore-AI is an intelligent DeFi assistant that transforms complex blockchain operations into simple, conversational interactions. Built specifically for the Core blockchain ecosystem, it enables users to execute trades, manage portfolios, and interact with DeFi protocols through natural language commands.

🎯 Vision

Democratize DeFi by making blockchain finance accessible through conversational AI.

Key Features

  • πŸ€– Conversational DeFi: Execute trades, swaps, and portfolio management using natural language
  • ⚑ Core Blockchain Integration: Optimized for Core network's speed and security
  • πŸ›‘οΈ Safety First: Built-in confirmation systems and transaction previews
  • πŸ“± Intuitive Interface: Chat-based interactions that require no technical expertise
  • πŸ”— Multi-Protocol Support: Interact with various DeFi protocols through a unified interface

Supported Operations

  • Token swaps and exchanges
  • Portfolio balance checking
  • Asset transfers and payments
  • Yield farming opportunities
  • Cross-chain asset bridging
  • DeFi protocol exploration

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ - Download here
  • Package Manager - npm, pnpm, or yarn
  • Core Wallet - MetaMask or compatible wallet configured for Core network

Installation

  1. Clone the repository

    git clone https://github.com/hardcore-ai/hardcore-ai.git
    cd hardcore-ai
  2. Install dependencies

    # Using pnpm (recommended)
    pnpm install
    
    # Or using npm
    npm install
  3. Configure environment

    cp .env.example .env

    Update .env with your configuration:

    OPENROUTER_API_KEY=your_openrouter_api_key
    NEXT_PUBLIC_PROJECT_ID=your_walletconnect_project_id
  4. Start development server

    # Using pnpm
    pnpm dev
    
    # Or using npm
    npm run dev
  5. Access the application

    Open http://localhost:3000 in your browser

πŸ—οΈ Architecture

Tech Stack

Component Technology Purpose
Frontend Next.js 14 React framework with App Router
Styling Tailwind CSS Utility-first CSS framework
UI Components shadcn/ui Radix UI + Tailwind components
Animations Framer Motion Smooth interactions and transitions
State Management Zustand Lightweight state management
Blockchain Wagmi + Viem Ethereum-compatible blockchain interactions
Wallet Connection RainbowKit Multi-wallet connection support
AI Integration Vercel AI SDK Language model interactions
Icons Lucide React Consistent icon library

Core Blockchain Integration

  • Network: Core DAO Mainnet (Chain ID: 1116)
  • RPC URL: https://rpc.coredao.org
  • Explorer: CoreScan
  • Native Token: CORE

πŸ› οΈ Development

Project Structure

hardcore-ai/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                    # Next.js App Router pages
β”‚   β”‚   β”œβ”€β”€ (landing)/         # Landing page group
β”‚   β”‚   β”œβ”€β”€ api/               # API routes
β”‚   β”‚   β”œβ”€β”€ home/              # Main application
β”‚   β”‚   └── layout.tsx         # Root layout
β”‚   β”œβ”€β”€ components/            # React components
β”‚   β”‚   β”œβ”€β”€ chat/              # Chat interface components
β”‚   β”‚   β”œβ”€β”€ landing/           # Landing page components
β”‚   β”‚   └── ui/                # Reusable UI components
β”‚   β”œβ”€β”€ constants/             # Application constants
β”‚   β”œβ”€β”€ hooks/                 # Custom React hooks
β”‚   β”œβ”€β”€ lib/                   # Utility libraries
β”‚   β”œβ”€β”€ providers/             # Context providers
β”‚   └── utils/                 # Helper functions
β”œβ”€β”€ public/                    # Static assets
└── docs/                      # Documentation

Available Scripts

# Development
pnpm dev          # Start development server
pnpm build        # Build for production
pnpm start        # Start production server
pnpm lint         # Run ESLint
pnpm type-check   # Run TypeScript check

Environment Configuration

Create a .env.local file with the following variables:

# AI Configuration
OPENROUTER_API_KEY=your_openrouter_api_key

# Wallet Configuration  
NEXT_PUBLIC_PROJECT_ID=your_walletconnect_project_id

# Optional: Local AI Model
OLLAMA_URL=http://localhost:11434  # If using Ollama locally

πŸ”§ Configuration

AI Model Setup

The application supports multiple AI providers:

  1. OpenRouter (Recommended)

    • Create account at OpenRouter
    • Get API key and add to .env
    • Currently using: moonshotai/kimi-k2:free
  2. Ollama (Local, Optional)

    • Install Ollama
    • Pull a compatible model: ollama pull llama2
    • Update configuration in API routes

Wallet Configuration

  1. MetaMask Setup

    • Install MetaMask extension
    • Add Core network manually or through ChainList
  2. Network Details

    Network Name: Core Blockchain
    RPC URL: https://rpc.coredao.org
    Chain ID: 1116
    Currency Symbol: CORE
    Block Explorer: https://scan.coredao.org
    

🌐 Deployment

Vercel (Recommended)

  1. Connect Repository

    npx vercel
  2. Configure Environment Variables

    • Add all environment variables in Vercel dashboard
    • Ensure production API keys are properly set
  3. Deploy

    vercel --prod

Other Platforms

The application can be deployed to any platform supporting Next.js:

  • Netlify
  • Railway
  • Render
  • DigitalOcean App Platform

πŸ” Security

Best Practices

  • Never commit private keys or sensitive data
  • Use environment variables for all configuration
  • Validate all user inputs before blockchain interactions
  • Implement proper error handling for failed transactions
  • Use confirmation dialogs for all financial operations

Audit Considerations

  • Smart contract interactions are limited to well-established protocols
  • All transactions require explicit user confirmation
  • Private keys never leave the user's wallet
  • Application follows Web3 security best practices

🀝 Contributing

Getting Started

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and commit: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Development Guidelines

  • Code Style: Follow ESLint and Prettier configurations
  • Commits: Use conventional commit messages
  • Testing: Add tests for new features
  • Documentation: Update relevant documentation

Areas for Contribution

  • Additional DeFi protocol integrations
  • UI/UX improvements
  • Performance optimizations
  • Mobile responsiveness
  • Accessibility enhancements
  • Internationalization (i18n)

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ”— Resources

Official Links

Developer Resources

AI & Blockchain


Built with ❀️ for the Core blockchain ecosystem

Enabling the future of conversational DeFi

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages