Skip to content

MeaCore-Enterprise/Distributed-AI-Control-System-Movil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– Chappi - Distributed AI Control System

A Progressive Web App (PWA) for monitoring and controlling distributed AI networks. Built with Next.js 16, featuring real-time WebSocket communication, hardware monitoring, and AI chat interface.

Chappi Dashboard

✨ Features

πŸ“Š Dashboard

  • Real-time system metrics (CPU, RAM, GPU)
  • Network load visualization
  • Node status overview
  • Health score calculation

πŸ–₯️ Node Management

  • Individual node monitoring
  • Hardware profile details
  • Power controls (On/Off/Restart)
  • Process monitoring
  • Command execution

πŸ”— Node Linking

  • QR Code - Scan to link new PCs
  • Manual Code - 8-character codes
  • Hardware profile collection
  • Real-time status updates

🧠 AI Control

  • Chat with Chappi AI
  • Training task management
  • Parameter configuration
  • Progress visualization

πŸ’Ύ Memory System

  • Conversation history
  • Cloud backup
  • Search functionality

πŸ“± PWA Features

  • Installable on Android/iOS/Desktop
  • Offline support
  • Push notifications
  • Background sync

πŸš€ Quick Start

# Clone the repository
git clone https://github.com/your-username/chappi.git
cd chappi

# Install dependencies
bun install

# Generate Prisma client
bun run db:generate

# Start development server
bun run dev

# Start WebSocket service (separate terminal)
cd mini-services/chappi-ws && bun run dev

Open http://localhost:3000 and use the API key: chappi-admin-key

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    CHAPPI PWA                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚Dashboardβ”‚ β”‚ Nodes   β”‚ β”‚AI Controlβ”‚ β”‚   Memory   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚       β”‚          β”‚           β”‚              β”‚           β”‚
β”‚       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β”‚                         β”‚                                β”‚
β”‚                    WebSocket                            β”‚
β”‚                         β”‚                                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚   WebSocket Server     β”‚
              β”‚     (Port 3003)        β”‚
              β”‚                       β”‚
              β”‚  β€’ Node Management    β”‚
              β”‚  β€’ Linking Codes      β”‚
              β”‚  β€’ Training Tasks     β”‚
              β”‚  β€’ Real-time Events   β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚                 β”‚                 β”‚
   β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”
   β”‚ Node 1  β”‚      β”‚ Node 2  β”‚      β”‚ Node N  β”‚
   β”‚ (Agent) β”‚      β”‚ (Agent) β”‚      β”‚ (Agent) β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

chappi/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/              # API Routes
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/         # Authentication
β”‚   β”‚   β”‚   β”œβ”€β”€ linking/      # Node linking
β”‚   β”‚   β”‚   β”œβ”€β”€ nodes/        # Node management
β”‚   β”‚   β”‚   β”œβ”€β”€ conversations/# Chat history
β”‚   β”‚   β”‚   └── backups/      # Memory backups
β”‚   β”‚   β”œβ”€β”€ layout.tsx        # Root layout
β”‚   β”‚   └── page.tsx          # Main app
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ ui/               # shadcn/ui components
β”‚   β”‚   β”œβ”€β”€ dashboard.tsx     # Dashboard view
β”‚   β”‚   β”œβ”€β”€ nodes-view.tsx    # Nodes management
β”‚   β”‚   β”œβ”€β”€ ai-control.tsx    # AI chat & training
β”‚   β”‚   β”œβ”€β”€ memory-view.tsx   # Conversation memory
β”‚   β”‚   β”œβ”€β”€ sidebar.tsx       # Navigation
β”‚   β”‚   β”œβ”€β”€ linking-modal.tsx # QR/Code linking
β”‚   β”‚   └── node-hardware-profile.tsx
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   └── use-websocket.ts  # WebSocket hook
β”‚   └── lib/
β”‚       β”œβ”€β”€ store.ts          # Zustand state
β”‚       └── db.ts             # Prisma client
β”œβ”€β”€ mini-services/
β”‚   └── chappi-ws/            # WebSocket server
β”‚       └── index.ts
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ icons/                # PWA icons
β”‚   β”œβ”€β”€ screenshots/          # PWA screenshots
β”‚   β”œβ”€β”€ manifest.json         # PWA manifest
β”‚   └── sw.js                 # Service worker
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ generate-icons.js     # Icon generator
β”‚   β”œβ”€β”€ generate-screenshots.js
β”‚   └── chappi_agent.py       # PC agent simulator
β”œβ”€β”€ prisma/
β”‚   └── schema.prisma         # Database schema
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── deploy.yml        # CI/CD pipeline
β”œβ”€β”€ vercel.json               # Vercel config
└── next.config.ts            # Next.js config

πŸ”§ Environment Variables

Create .env.local file:

# Database
DATABASE_URL="file:./db/chappi.db"

# Authentication
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-key

# WebSocket
NEXT_PUBLIC_WS_URL=ws://localhost:3003
NEXT_PUBLIC_WS_PORT=3003

# API
CHAPPI_API_KEY=chappi-admin-key

πŸš€ Deploy to Vercel

1. Push to GitHub

git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/your-username/chappi.git
git push -u origin main

2. Configure Vercel

  1. Go to vercel.com
  2. Import your GitHub repository
  3. Configure environment variables:
    • DATABASE_URL - SQLite or PostgreSQL connection
    • NEXTAUTH_SECRET - Random secret for auth
    • NEXTAUTH_URL - Your Vercel URL
    • CHAPPI_API_KEY - Admin API key

3. Configure Secrets for CI/CD

Add these secrets in GitHub repository settings:

  • VERCEL_ORG_ID - From Vercel account settings
  • VERCEL_PROJECT_ID - From project settings
  • VERCEL_TOKEN - Generate from Vercel settings

4. Deploy

Push to main branch - GitHub Actions will automatically deploy!

πŸ“± Install as PWA

Android

  1. Open Chrome
  2. Navigate to your deployed URL
  3. Tap "Add to Home Screen"

iOS

  1. Open Safari
  2. Navigate to your deployed URL
  3. Tap Share β†’ "Add to Home Screen"

Desktop

  1. Open Chrome/Edge
  2. Navigate to your deployed URL
  3. Click install icon in address bar

πŸ”— Node Agent (PC Software)

The PC agent collects hardware data and sends it to the server.

Windows (Python)

# Install dependencies
pip install requests wmi psutil

# Run with linking code
python chappi_agent.py --server https://your-app.vercel.app --code ABCD1234

Hardware Profile Collected

  • CPU: Model, cores, threads, frequency, usage
  • RAM: Total, used, free, available
  • GPU: Model, VRAM, driver, usage
  • Disks: Capacity, type (SSD/HDD), usage
  • System: Hostname, IP, MAC, OS, uptime
  • Access: User, admin status, privileges

πŸ› οΈ Tech Stack

  • Framework: Next.js 16 (App Router)
  • Language: TypeScript 5
  • Styling: Tailwind CSS 4 + shadcn/ui
  • State: Zustand
  • Charts: Recharts
  • Real-time: Socket.IO
  • Database: SQLite + Prisma
  • PWA: Service Worker + Web App Manifest

πŸ“„ License

MIT License - feel free to use this for your own projects!


Built with ❀️ for distributed AI systems

About

CHAPPI Distributed AI Control System

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors