Complete architecture guide and deployment instructions
# Clone repository
git clone https://github.com/mikagit25/neurogrid.git
cd neurogrid
# Start full stack
docker-compose up -d
# Health check
curl http://localhost:3001/health
# Access dashboards
# Coordinator API: http://localhost:3001
# Web Interface: http://localhost:3000
# Required Environment Variables
NODE_ENV=production
PORT=3001
DATABASE_URL=postgresql://user:pass@db:5432/neurogrid
REDIS_URL=redis://redis:6379
JWT_SECRET=your-super-secret-key
# Optional Configuration
LOG_LEVEL=info
RATE_LIMIT_ENABLED=true
CACHE_ENABLED=true
WEB_CONCURRENCY=4
version: '3.8'
services:
coordinator:
image: neurogrid/coordinator:latest
ports:
- "3001:3001"
environment:
- NODE_ENV=production
- DATABASE_URL=${DATABASE_URL}
depends_on:
- db
- redis
web-interface:
image: neurogrid/web:latest
ports:
- "3000:3000"
depends_on:
- coordinator
# Add NeuroGrid Helm repository
helm repo add neurogrid https://charts.neurogrid.network
helm repo update
# Install with custom values
helm install neurogrid neurogrid/neurogrid \
--set coordinator.replicaCount=3 \
--set database.enabled=true \
--set monitoring.enabled=true
| Component | Software | Version | Purpose |
|---|---|---|---|
| Coordinator | Node.js | 18.0+ | JavaScript runtime |
| Database | PostgreSQL | 14.0+ | Primary database |
| Cache | Redis | 7.0+ | Caching & sessions |
| Node Client | Python | 3.9+ | AI model execution |
| Containers | Docker | 20.0+ | Task isolation |
id UUID PRIMARY KEY
email VARCHAR(255) UNIQUE NOT NULL
password_hash VARCHAR(255) NOT NULL
role ENUM('client', 'provider', 'admin')
balance DECIMAL(18,8) DEFAULT 0
created_at TIMESTAMP DEFAULT NOW()
id UUID PRIMARY KEY
user_id UUID REFERENCES users(id)
name VARCHAR(255) NOT NULL
gpu_model VARCHAR(255)
vram_gb INTEGER
status ENUM('online', 'offline', 'busy')
performance DECIMAL(3,2) DEFAULT 1.0
last_seen TIMESTAMP
id UUID PRIMARY KEY
user_id UUID REFERENCES users(id)
node_id UUID REFERENCES nodes(id)
model VARCHAR(255) NOT NULL
prompt TEXT NOT NULL
status ENUM('queued', 'processing', 'completed')
cost DECIMAL(18,8)
created_at TIMESTAMP DEFAULT NOW()
completed_at TIMESTAMP
id UUID PRIMARY KEY
user_id UUID REFERENCES users(id)
task_id UUID REFERENCES tasks(id)
type ENUM('debit', 'credit')
amount DECIMAL(18,8) NOT NULL
description VARCHAR(255)
created_at TIMESTAMP DEFAULT NOW()
# Monitoring Stack
prometheus:
- metrics collection
- alerting rules
- service discovery
grafana:
- dashboards
- visualization
- alerting
elk-stack:
- elasticsearch: log storage
- logstash: log processing
- kibana: log visualization
jaeger:
- distributed tracing
- performance analysis
Port conflicts, missing dependencies, or configuration issues
# Check logs
docker-compose logs coordinator
# Check port usage
netstat -tulpn | grep :3001
# Verify environment variables
env | grep NEUROGRID
PostgreSQL connectivity or authentication issues
# Test database connection
psql -h localhost -U neurogrid -d neurogrid
# Check database status
docker-compose exec db pg_isready
# Verify connection string
echo $DATABASE_URL
Memory leaks or inefficient processing
# Monitor memory usage
docker stats
# Check Node.js memory
curl http://localhost:3001/health
# Restart if needed
docker-compose restart coordinator
# Overall health
curl http://localhost:3001/health
# API status
curl http://localhost:3001/api/info
# Database health
curl http://localhost:3001/api/health/db
# Network status
curl http://localhost:3001/api/network/status
# Node connectivity
curl http://localhost:3001/api/nodes/health
# Performance metrics
curl http://localhost:3001/metrics