mirror of
https://github.com/luxdao/stack.git
synced 2026-10-30 18:13:59 +00:00
5.6 KiB
5.6 KiB
LuxDAO Stack
Complete DAO infrastructure for the Lux Protocol ecosystem.
Overview
LuxDAO Stack provides a comprehensive decentralized autonomous organization (DAO) platform with:
- 🏛️ Governance: On-chain voting and proposal management
- 💰 Treasury: Multi-sig treasury management
- 🔐 Security: Role-based access control with Hats Protocol
- 📊 Analytics: Real-time DAO metrics and insights
- 🌐 Multi-chain: Support for Ethereum, Optimism, Polygon, Base
Quick Start
# Clone the repository
git clone https://github.com/luxdao/stack.git
cd stack
# Install all dependencies
make install-all
# Start infrastructure (Anvil, Postgres, Redis, IPFS)
make up
# Start the application
make dev
# OR start everything in Docker
make up-full
Services
| Service | Port | Description |
|---|---|---|
| Frontend | 3000 | React-based DAO interface |
| API | 4000 | Backend API server |
| Anvil | 8545 | Local Ethereum blockchain |
| PostgreSQL | 5432 | Database |
| Redis | 6379 | Cache layer |
| IPFS | 8080 | Decentralized storage |
| Grafana | 3001 | Monitoring dashboard |
Development
Deployment Options
Option 1: Basic Infrastructure + Local App
make up # Start infrastructure (Anvil, DB, Redis, IPFS)
make dev # Start app locally with hot reload
Option 2: Full Docker Stack
make up-full # Start everything in Docker
Option 3: Local Development
make local # Run everything locally without Docker
Running Tests
make test # Run all tests
make test-unit # Unit tests only
make test-e2e # E2E tests only
make test-ui # E2E tests with UI
Deploying Contracts
make deploy-local # Deploy to local Anvil
make deploy-testnet # Deploy to testnet
Architecture
luxdao/stack/
├── dao/
│ ├── app/ # Frontend React application
│ ├── contracts/ # Smart contracts (Solidity)
│ ├── api/ # Backend API
│ ├── sdk/ # TypeScript SDK
│ └── subgraph/ # Graph Protocol integration
├── docker-compose.yml
├── Makefile
└── README.md
Key Features
Smart Contracts
- LinearERC20Voting: Token-based voting mechanism
- Governor: Modular governance framework
- LuxAutonomousAdmin: Autonomous admin functions
- LuxHats: Role management with Hats Protocol
- KeyValuePairs: On-chain key-value storage
Frontend Features
- Web3 wallet integration (MetaMask, WalletConnect, etc.)
- Real-time proposal tracking
- Treasury management interface
- Role-based access control UI
- Multi-chain support
Backend Services
- GraphQL API
- WebSocket subscriptions
- IPFS integration
- Database indexing
- Event processing
Commands
# Stack Management
make up # Start the stack
make down # Stop the stack
make logs # View logs
make health # Check service health
# Development
make dev # Start development mode
make build # Build Docker images
make clean # Clean all artifacts
make reset # Reset entire stack
# Testing
make test # Run all tests
make test-unit # Run unit tests
make test-e2e # Run E2E tests
# Deployment
make deploy-local # Deploy locally
make deploy-testnet # Deploy to testnet
# GitHub
make github-init # Initialize repository
make github-push # Push to GitHub
Configuration
Environment Variables
Create a .env file in the root directory:
# Network Configuration
CHAIN_ID=1337
RPC_URL=http://localhost:8545
# API Configuration
API_URL=http://localhost:4000
DATABASE_URL=postgresql://luxdao:luxdao123@localhost:5432/luxdao
REDIS_URL=redis://localhost:6379
# IPFS Configuration
IPFS_GATEWAY=http://localhost:8080
# Contract Addresses (auto-populated after deployment)
GOVERNANCE_TOKEN=0x...
GOVERNOR=0x...
TREASURY=0x...
Testing
Unit Tests
cd dao/contracts && npm test
cd dao/app && npm test
E2E Tests
npx playwright test
npx playwright test --ui # With UI
Manual Testing
- Start the stack:
make up - Visit http://localhost:3000
- Connect your wallet
- Create a test DAO
- Submit proposals
- Vote on proposals
Deployment
Local Deployment
make up # Uses Docker Compose
Production Deployment
- Configure environment variables
- Deploy contracts to mainnet
- Update contract addresses
- Deploy frontend to CDN
- Deploy API to cloud provider
Monitoring
Grafana Dashboard
Access at http://localhost:3001 (admin/admin)
Health Checks
make health # Check all services
Troubleshooting
Common Issues
Port conflicts:
# Check for conflicting services
lsof -i :3000
lsof -i :8545
Clean restart:
make reset # Clean everything and restart
View logs:
make logs # All services
make logs-frontend # Specific service
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
make test - Submit a pull request
Security
- Smart contracts audited by [Audit Firm]
- Bug bounty program: [email protected]
- Security policy: SECURITY.md
License
MIT License - see LICENSE file
Links
- Website: https://lux.vote
- Documentation: https://docs.lux.vote
- Discord: https://discord.gg/luxdao
- Twitter: https://twitter.com/luxdao
Support
For support, please:
- Check the documentation
- Search existing issues
- Create a new issue if needed
- Join our Discord community
Built with ❤️ by the Lux Protocol team