Skip to content

Repository files navigation

πŸš€ MiMo DePIN Node Copilot

AI-powered assistant untuk install, debug, dan monitor DePIN nodes dengan mudah.

Next.js TypeScript Tailwind CSS License


πŸ“‹ Table of Contents


🎯 Overview

MiMo DePIN Node Copilot adalah AI assistant yang membantu node operators untuk:

  • πŸ” Analyze error logs β€” Paste log, dapat diagnosis + fix commands
  • πŸ₯ Health monitoring β€” Generate checklist, analyze node health
  • βš™οΈ Automation β€” Generate systemd/pm2/docker configs
  • πŸ“Š History tracking β€” Simpan semua analyses + fixes
  • πŸ—‚οΈ Node management β€” Manage multiple nodes dalam satu dashboard

Problem

Node operators kesulitan:

  • Troubleshoot error yang kompleks
  • Setup automation (systemd, pm2, docker)
  • Track health node secara konsisten
  • Manage multiple nodes sekaligus

Solution

Paste error log β†’ AI analisis β†’ actionable fix + automation commands + health checklist.


✨ Features

🏠 Dashboard

  • Quick stats: Total nodes, healthy nodes, recent errors
  • Quick action cards untuk semua fitur
  • Empty state dengan CTA
  • Responsive grid layout

πŸ” Log Analyzer

  • Paste error log dari VPS/node
  • AI diagnosis dengan Groq (Llama 3.3 70B)
  • Root cause analysis
  • Severity level (Critical/High/Medium/Low)
  • Step-by-step recommended fix
  • Copy-paste ready shell commands
  • Save to history

πŸ₯ Health Checker

  • Select node dari registry
  • Generate health checklist (CPU, memory, disk, network, process)
  • Node-type specific checks (Zcash, Filecoin, Arweave)
  • Paste command output untuk analysis
  • Health score (0-100)
  • Visual status indicators

βš™οΈ Automation Generator

  • Support 3 process managers: systemd, pm2, docker
  • Support 4 node types: Zcash, Filecoin, Arweave, Other
  • Generate config file (service/config.js/docker-compose.yml)
  • Generate startup script
  • Copy & download buttons
  • Step-by-step deployment instructions

πŸ“Š History

  • Timeline view semua analyses
  • Search by error keyword
  • Filter by severity
  • Filter by node
  • Export to JSON
  • Export to CSV
  • Shows: timestamp, severity, root cause, commands

πŸ—‚οΈ Node Registry

  • Add/edit/delete nodes
  • Fields: name, type, IP, port, process manager
  • Node list dengan quick actions
  • Empty state dengan CTA
  • Persistent storage (localStorage)

🎬 Demo

Live Demo

Screenshots

Dashboard Log Analyzer
Dashboard Log Analyzer
Quick stats + action cards AI diagnosis + fix commands
Health Checker Automation Generator
Health Checker Automation Generator
Health checklist + score systemd/pm2/docker config
History Node Registry
History Node Registry
Search + filter + export Add/edit/delete nodes

Demo Video

Demo GIF

6-second animated demo showing all features in action

To record your own demo video:

  1. Run npm run dev
  2. Screen record the app (30-60 seconds)
  3. Upload to YouTube/Vimeo
  4. Update README with video link

πŸ› οΈ Tech Stack

Frontend

State Management

  • Store: Zustand 5.0
  • Persistence: localStorage (client-side)

AI Integration

  • Primary: Groq API (Llama 3.3 70B, free tier 30 RPM)
  • Fallback: MiMo API (future)

Deployment

  • Platform: Netlify
  • Build: Next.js static export
  • CDN: Global edge network

πŸš€ Getting Started

Prerequisites

  • Node.js: 18.x or higher
  • npm: 9.x or higher (or yarn/pnpm)
  • Git: For version control

Installation

# 1. Clone repository
git clone https://github.com/yourusername/mimo-depin-node-copilot.git
cd mimo-depin-node-copilot

# 2. Install dependencies
npm install

# 3. Setup environment variables
cp .env.example .env.local
# Edit .env.local and add your GROQ_API_KEY

# 4. Run development server
npm run dev

# 5. Open browser
# Navigate to http://localhost:3000

Quick Commands

# Development
npm run dev          # Start dev server (http://localhost:3000)

# Production
npm run build        # Build for production
npm start            # Start production server

# Code Quality
npm run lint         # Run ESLint
npm run type-check   # Run TypeScript compiler (no emit)

# Clean
rm -rf .next node_modules
npm install          # Fresh install

πŸ“ Project Structure

mimo-depin-node-copilot/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                      # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ layout.tsx            # Root layout + metadata
β”‚   β”‚   β”œβ”€β”€ page.tsx              # Dashboard (home)
β”‚   β”‚   β”œβ”€β”€ globals.css           # Global styles + design tokens
β”‚   β”‚   β”œβ”€β”€ analyzer/
β”‚   β”‚   β”‚   └── page.tsx          # Log analyzer page
β”‚   β”‚   β”œβ”€β”€ health/
β”‚   β”‚   β”‚   └── page.tsx          # Health checker page
β”‚   β”‚   β”œβ”€β”€ automation/
β”‚   β”‚   β”‚   └── page.tsx          # Automation generator page
β”‚   β”‚   β”œβ”€β”€ history/
β”‚   β”‚   β”‚   └── page.tsx          # Analysis history page
β”‚   β”‚   └── nodes/
β”‚   β”‚       └── page.tsx          # Node registry page
β”‚   └── lib/
β”‚       β”œβ”€β”€ types.ts              # TypeScript interfaces
β”‚       β”œβ”€β”€ store.ts              # Zustand store (state management)
β”‚       └── api/
β”‚           └── groq.ts           # Groq API integration
β”œβ”€β”€ public/                       # Static assets
β”‚   └── favicon.ico
β”œβ”€β”€ docs/                         # Documentation
β”‚   β”œβ”€β”€ PRD.md                    # Product requirements
β”‚   β”œβ”€β”€ design.md                 # Design system + UI specs
β”‚   β”œβ”€β”€ IMPLEMENTATION.md         # Technical details
β”‚   └── QUICKSTART.md             # Quick start guide
β”œβ”€β”€ .eslintrc.json                # ESLint config
β”œβ”€β”€ .gitignore                    # Git ignore rules
β”œβ”€β”€ .env.example                  # Environment variables template
β”œβ”€β”€ next.config.ts                # Next.js config
β”œβ”€β”€ tailwind.config.ts            # Tailwind CSS config
β”œβ”€β”€ tsconfig.json                 # TypeScript config
β”œβ”€β”€ postcss.config.js             # PostCSS config
β”œβ”€β”€ package.json                  # Dependencies
└── README.md                     # This file

πŸ“– Usage Guide

1. Add Your First Node

1. Navigate to "Node Registry" page
2. Click "Add New Node"
3. Fill in:
   - Node Name: my-zcash-node
   - Node Type: Zcash
   - IP Address: 192.168.1.100
   - Port: 8232 (optional)
   - Process Manager: systemd
4. Click "Add Node"

2. Analyze Error Log

1. Navigate to "Log Analyzer" page
2. Paste your error log in textarea
3. Click "Analyze with MiMo"
4. Review:
   - Root cause
   - Severity level
   - Recommended fix steps
   - Shell commands
5. Copy commands and run on your VPS
6. Click "Save to History" (optional)

3. Generate Health Checklist

1. Navigate to "Health Checker" page
2. Select node from dropdown
3. Click "Generate Health Checklist"
4. Copy all commands
5. Run commands on your VPS
6. Paste output back to "Paste Output" textarea
7. Click "Analyze Health"
8. Review health score + warnings

4. Generate Automation Config

1. Navigate to "Automation Generator" page
2. Select:
   - Node Type: Zcash
   - Process Manager: systemd
   - Node Name: my-zcash-node
3. Click "Generate Config"
4. Download or copy:
   - Config file (my-zcash-node.service)
   - Startup script (my-zcash-node-startup.sh)
5. Upload to VPS and run startup script

5. View History

1. Navigate to "History" page
2. Use filters:
   - Search by keyword
   - Filter by severity
   - Filter by node
3. Export data:
   - Click "Export JSON" or "Export CSV"

πŸ”Œ API Integration

Groq API Setup

  1. Get API Key

  2. Add to Environment

    # .env.local
    GROQ_API_KEY=gsk_your_api_key_here
    NEXT_PUBLIC_APP_URL=http://localhost:3000
  3. Update API Function (src/lib/api/groq.ts)

    export async function analyzeLogWithGroq(request: GroqAnalysisRequest) {
      const response = await fetch('https://api.groq.com/openai/v1/chat/completions', {
        method: 'POST',
        headers: {
          'Authorization': `Bearer ${process.env.GROQ_API_KEY}`,
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({
          model: 'llama-3.3-70b-versatile',
          messages: [
            {
              role: 'system',
              content: 'You are a DePIN node expert. Analyze error logs and provide actionable fixes.',
            },
            {
              role: 'user',
              content: `Analyze this node error log and provide: root cause, severity (critical/high/medium/low), recommended fix steps, and shell commands.\n\nLog:\n${request.log}`,
            },
          ],
          temperature: 0.7,
          max_tokens: 1000,
        }),
      })
      
      const data = await response.json()
      // Parse response and return GroqAnalysisResponse
      return parseGroqResponse(data)
    }

Rate Limits

  • Groq Free Tier: 30 requests per minute
  • Recommendation: Implement queue system for high traffic
  • Fallback: Add MiMo API as secondary provider

🌐 Deployment

Deploy to Netlify

Option A: Via GitHub (Recommended)

# 1. Push to GitHub
git init
git add .
git commit -m "Initial commit: MiMo DePIN Node Copilot MVP"
git branch -M main
git remote add origin https://github.com/yourusername/mimo-depin-node-copilot.git
git push -u origin main

# 2. Connect to Netlify
# - Login to Netlify
# - Click "Add new site" β†’ "Import an existing project"
# - Choose GitHub β†’ Select repository
# - Configure build settings:
#   - Build command: npm run build
#   - Publish directory: .next
# - Add environment variables:
#   - GROQ_API_KEY: your_key_here
#   - NEXT_PUBLIC_APP_URL: https://your-site.netlify.app
# - Click "Deploy site"

Option B: Via Netlify CLI

# 1. Install Netlify CLI
npm install -g netlify-cli

# 2. Login
netlify login

# 3. Initialize site
netlify init

# 4. Deploy
netlify deploy --prod

# 5. Set environment variables
netlify env:set GROQ_API_KEY "your_key_here"
netlify env:set NEXT_PUBLIC_APP_URL "https://your-site.netlify.app"

Deploy to Vercel

# 1. Install Vercel CLI
npm install -g vercel

# 2. Deploy
vercel

# 3. Set environment variables
vercel env add GROQ_API_KEY
vercel env add NEXT_PUBLIC_APP_URL

# 4. Deploy to production
vercel --prod

Custom Domain

# Netlify
netlify domains:add yourdomain.com

# Vercel
vercel domains add yourdomain.com

βš™οΈ Configuration

Environment Variables

Variable Description Required Default
GROQ_API_KEY Groq API key for AI analysis Yes -
NEXT_PUBLIC_APP_URL Public URL of your app No http://localhost:3000

Tailwind Config

Customize design tokens in tailwind.config.ts:

theme: {
  extend: {
    colors: {
      primary: {
        500: '#3b82f6',  // Change primary color
        700: '#1d4ed8',
      },
    },
  },
}

Next.js Config

Modify next.config.ts for custom settings:

const nextConfig: NextConfig = {
  reactStrictMode: true,
  swcMinify: true,
  // Add custom config here
}

πŸ’» Development

Code Style

  • Formatter: Prettier (recommended)
  • Linter: ESLint (configured)
  • Type Checking: TypeScript strict mode

Adding New Features

  1. Create new page

    mkdir src/app/newfeature
    touch src/app/newfeature/page.tsx
  2. Add to navigation (update src/app/page.tsx)

  3. Update store (src/lib/store.ts)

  4. Add API functions (src/lib/api/)

Testing

# Type checking
npx tsc --noEmit

# Linting
npm run lint

# Build test
npm run build

Performance Optimization

  • Code splitting (automatic per-page)
  • Image optimization (Next.js Image component)
  • CSS minification (Tailwind)
  • Tree shaking (unused code removal)

πŸ› Troubleshooting

Dev server won't start

# Clear cache and reinstall
rm -rf .next node_modules package-lock.json
npm install
npm run dev

Build fails with TypeScript errors

# Check errors
npx tsc --noEmit

# Common fixes:
# - Check import paths
# - Verify type definitions
# - Update dependencies

localStorage not persisting

  • Check browser privacy settings
  • Ensure cookies/storage enabled
  • Try incognito mode to test
  • Check browser console for errors

API calls failing

  • Verify GROQ_API_KEY is set correctly
  • Check API rate limits (30 RPM free tier)
  • Review browser console for errors
  • Test API key with curl:
    curl https://api.groq.com/openai/v1/chat/completions \
      -H "Authorization: Bearer $GROQ_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"model":"llama-3.3-70b-versatile","messages":[{"role":"user","content":"test"}]}'

πŸ—ΊοΈ Roadmap

Phase 1: MVP βœ… (Current)

  • Dashboard
  • Log analyzer
  • Health checker
  • Automation generator
  • History
  • Node registry
  • localStorage persistence
  • Mock API responses

Phase 2: Real API Integration

  • Integrate actual Groq API
  • Add MiMo API fallback
  • Implement rate limiting
  • Add error handling + retry logic
  • Response caching

Phase 3: Database & Auth

  • Supabase integration
  • User authentication
  • Multi-user support
  • Cloud sync across devices
  • Team collaboration

Phase 4: Advanced Features

  • Real-time monitoring dashboard
  • Webhook alerts (Slack, Discord, Telegram)
  • Advanced analytics
  • Custom node types
  • Batch operations
  • API rate limit dashboard

Phase 5: Mobile & Desktop

  • React Native mobile app
  • Electron desktop app
  • Push notifications
  • Offline mode

Phase 6: Monetization

  • Premium tier (unlimited API calls)
  • Custom integrations
  • Priority support
  • White-label solution

🀝 Contributing

Contributions welcome! Please follow these steps:

  1. Fork the repository
  2. Create feature branch
    git checkout -b feature/amazing-feature
  3. Commit changes
    git commit -m "Add amazing feature"
  4. Push to branch
    git push origin feature/amazing-feature
  5. Open Pull Request

Contribution Guidelines

  • Follow existing code style
  • Add TypeScript types for new code
  • Update documentation
  • Test thoroughly before PR
  • Write clear commit messages

πŸ“„ License

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


πŸ™ Acknowledgments

  • Groq β€” Fast AI inference
  • Next.js β€” React framework
  • Tailwind CSS β€” Utility-first CSS
  • Zustand β€” State management
  • Lucide β€” Beautiful icons

πŸ“Š Project Stats

  • Pages: 6 (all functional)
  • Components: Inline (ready to extract)
  • API Functions: 3 (analyzeLog, generateChecklist, generateConfig)
  • Store: 1 (Zustand with persistence)
  • Build Size: ~107 KB per page
  • TypeScript: 100% type-safe
  • Responsive: Mobile-first design

Built with ❀️ for DePIN node operators
by sahruldolkenkai2

⬆ Back to Top

About

πŸš€ AI-powered assistant untuk install, debug, dan monitor DePIN nodes. Paste error log β†’ AI diagnosis + fix commands + health checklist + automation config.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages