Skip to content

tanuj-aelf/aelf-code-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AElf Code Generator

An AI-powered code generator for the AElf ecosystem, built with Next.js, CopilotKit, and Langgraph.

Screenshot 2025-03-06 at 12 48 05 PM Screenshot 2025-03-06 at 12 47 52 PM

Features

  • AI-powered code generation for smart contracts and dApps
  • Real-time code suggestions and completions
  • Built-in examples and templates for common use cases
  • Modern, responsive UI with Tailwind CSS

Prerequisites

  • Node.js 18+ and npm
  • OpenAI API key
  • Gemini API key

Setup

  1. Clone the repository

  2. Install dependencies:

    npm install
  3. Copy .env.local.example to .env.local and add your API keys:

    # UI Environment Variables
    NEXT_PUBLIC_RUNTIME_URL=http://localhost:3000/api/copilotkit
    AGENT_URL=http://localhost:3001/copilotkit/generate 
    GROQ_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxx
    NEXT_PUBLIC_FAUCET_API_URL=https://faucet.aelf.dev
    NEXT_PUBLIC_GOOGLE_CAPTCHA_SITEKEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    
    # Agent Environment Variables
    OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    TAVILY_API_KEY=tvly-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    GOOGLE_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    MODEL=azure_openai
    AZURE_OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    
    # LangSmith Tracing (optional)
    LANGSMITH_TRACING=true
    LANGSMITH_ENDPOINT="https://api.smith.langchain.com"
    LANGSMITH_API_KEY="lsv2_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    LANGSMITH_PROJECT="ai-code-generator"
  4. Set up and run the agent:

    # Navigate to the agent directory
    cd agent
    
    # Create virtual environment
    python3 -m venv venv
    source venv/bin/activate
    
    # Install dependencies
    pip install -e .
    
    # Run the agent
    python3 -m aelf_code_generator
  5. Run the UI development server:

    # Return to the root directory
    cd ../ui
    
    # Start the Next.js server
    npm run dev
  6. Open http://localhost:3000 in your browser

Technology Stack

  • Next.js 14
  • TypeScript
  • Tailwind CSS
  • CopilotKit
  • Gemini embedding withOpenAI API

License

MIT

About

AI code generator for AElf ecosystem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •