AI-powered DeFi Risk Analysis Platform
A comprehensive blockchain risk analysis platform built with Next.js, Node.js, ElizaOS AI agents, and multi-chain support.
- π€ AI Risk Analysis - ElizaOS-powered intelligent risk assessment
- βοΈ Multi-Blockchain - Ethereum, Chromia, and more
- π Real-time Dashboard - Interactive risk visualization
- π Smart Contracts - On-chain risk management protocols
- ποΈ Microservices - Scalable Docker-based architecture
- Docker (latest version)
- Docker Compose (latest version)
- Git
# 1. Clone repository
git clone https://github.com/uederson-ferreira/riskguardian-ai.git
cd riskguardian-ai
# 2. Setup environment
./scripts/setup.sh
# 3. Access applications
# Frontend: http://localhost:3000
# Backend: http://localhost:8000
# ElizaOS: http://localhost:3001That's it! π
Copy .env.example to .env and fill in:
# AI Services (Required)
OPENAI_API_KEY=sk-your-openai-key
ANTHROPIC_API_KEY=sk-ant-your-anthropic-key
# Authentication (Required)
JWT_SECRET=your-secure-jwt-secret-min-32-chars
# Optional: Advanced features
CHAINLINK_API_KEY=your-chainlink-key
ETHERSCAN_API_KEY=your-etherscan-keyβββββββββββββββββββ¬ββββββββββββββββββ¬ββββββββββββββββββ
β Frontend β Backend β ElizaOS β
β (Next.js) β (Node.js) β (AI Agent) β
β Port: 3000 β Port: 8000 β Port: 3001 β
βββββββββββββββββββ΄ββββββββββββββββββ΄ββββββββββββββββββ
β
βββββββββββββββββββ¬ββββββββββββββββββ¬ββββββββββββββββββ
β PostgreSQL β Redis β Anvil β
β (Database) β (Cache) β (Blockchain) β
β Port: 5432 β Port: 6379 β Port: 8545 β
βββββββββββββββββββ΄ββββββββββββββββββ΄ββββββββββββββββββ
β
βββββββββββββββββββ
β Chromia β
β (Database) β
β Port: 7740 β
βββββββββββββββββββ
# Start development environment
./scripts/start-dev.sh
# Stop all services
./scripts/stop.sh
# View logs
docker-compose logs -f [service-name]
# Restart specific service
docker-compose restart [service-name]riskguardian-ai/
βββ frontend/ # Next.js React application
βββ backend/ # Node.js REST API
βββ elizaos-agent/ # AI risk analysis agent
βββ contracts/ # Smart contracts (Solidity)
βββ chromia/ # Chromia blockchain integration
βββ scripts/ # Automation scripts
βββ docker-compose.yml # Service orchestration
| Service | URL | Description |
|---|---|---|
| Frontend | http://localhost:3000 | React dashboard |
| Backend API | http://localhost:8000 | REST API endpoints |
| ElizaOS Agent | http://localhost:3001 | AI risk analysis |
| Chromia | http://localhost:7740 | Database API |
| Anvil | http://localhost:8545 | Local blockchain |
| PostgreSQL | localhost:5432 | Primary database |
| Redis | localhost:6379 | Cache layer |
# Test all services connectivity
./scripts/test-connectivity.sh
# Test blockchain
curl -X POST \
-H "Content-Type: application/json" \
-d '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}' \
http://localhost:8545
# Test backend API
curl http://localhost:8000
# Test frontend
curl http://localhost:3000./scripts/start-dev.sh./scripts/deploy.sh# Database admin interface
docker-compose --profile tools up -d pgadmin
# Access: http://localhost:5050
# Smart contracts development
docker-compose --profile tools up -d contracts- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open Pull Request
# Setup development environment
./scripts/setup.sh
# Make your changes in:
# - frontend/src/ (React components)
# - backend/src/ (API endpoints)
# - elizaos-agent/src/ (AI agents)
# - contracts/src/ (Smart contracts)
# Test your changes
./scripts/test-connectivity.sh
# Commit and push
git add .
git commit -m "feat: your awesome feature"
git pushPort conflicts:
# Check if ports are in use
lsof -i :3000,:8000,:8545
# Stop conflicting services
docker-compose downAnvil connection issues:
# Check Anvil logs
docker-compose logs anvil
# Restart Anvil
docker-compose restart anvilDatabase connection issues:
# Check PostgreSQL
docker-compose exec postgres pg_isready -U chromia
# Reset database
docker-compose down -v
./scripts/setup.sh| Variable | Required | Description |
|---|---|---|
OPENAI_API_KEY |
β | OpenAI API for AI features |
JWT_SECRET |
β | Authentication secret (32+ chars) |
ANTHROPIC_API_KEY |
Anthropic Claude API (backup) | |
CHAINLINK_API_KEY |
β | Chainlink integration |
ETHERSCAN_API_KEY |
β | Ethereum network data |
# Service status
docker-compose ps
# Live logs
docker-compose logs -f
# Resource usage
docker stats
# System health
./scripts/test-connectivity.shGET /- Service health checkGET /api/risks- Get risk analysis dataPOST /api/portfolio/analyze- Analyze portfolio riskGET /api/health- System health status
GET /health- Agent health checkPOST /analyze- Risk analysis requestGET /status- Analysis status
- Frontend: Next.js, React, TypeScript
- Backend: Node.js, Express, PostgreSQL
- AI: ElizaOS, OpenAI, Anthropic
- Blockchain: Anvil (Foundry), Chromia
- Cache: Redis
- Deployment: Docker, Docker Compose
- Smart Contracts: Solidity, Foundry
MIT License - see LICENSE file for details.
- π§ Email: support@riskguardian.ai
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
Built with β€οΈ by the RiskGuardian team