🌟 Revolutionary Web3 ecosystem combining traditional coffee ordering with DeFi trading, AI automation, and enterprise-grade infrastructure
🚀 Quick Start • 📚 Documentation • 🏗️ Architecture • 🤖 AI Agents • 🌐 Web3 Features • 🛡️ Security
🔥 Modern Go Architecture • 🌐 Multi-Chain Web3 • 🤖 AI-Powered Automation • 🏗️ Enterprise-Ready • 🔒 Security-First
Go Coffee represents the future of coffee commerce, seamlessly blending traditional hospitality with cutting-edge technology. Our comprehensive ecosystem delivers:
| Component | Description | Technology Stack |
|---|---|---|
| ☕ Coffee Ordering | High-performance microservices architecture | Kafka, gRPC, PostgreSQL |
| 🌐 Web3 Integration | Multi-chain DeFi platform with crypto payments | Ethereum, Solana, Smart Contracts |
| 🤖 AI Automation | Intelligent agent network for operations | Gemini, Ollama, LangChain |
| 🏗️ Enterprise Infrastructure | Production-ready, globally distributed | Kubernetes, Terraform, Prometheus |
- 🔥 Performance-First: Built with Go 1.24+ for maximum concurrency and efficiency
- 🛡️ Security-Hardened: Enterprise-grade security with comprehensive threat protection
- 📈 Scalable Architecture: Designed to handle millions of transactions per day
- 🌍 Global Ready: Multi-region deployment with automatic failover
- 🔮 Future-Proof: Modular design supporting emerging technologies
- Microservices Architecture - Producer, Consumer, Streams, API Gateway
- Kafka Integration - Asynchronous message processing
- gRPC Communication - High-performance inter-service communication
- RESTful APIs - Easy client integration
- Real-time Processing - Kafka Streams for event processing
- Multi-Chain Support - Ethereum, BSC, Polygon, Solana
- Cryptocurrency Payments - BTC, ETH, USDC, USDT for coffee purchases
- DeFi Trading Bots - Automated arbitrage, yield farming, grid trading
- Smart Contracts - Coffee Token with staking rewards
- DEX Integration - Uniswap V3, Aave, 1inch, Raydium, Jupiter
- 9 Specialized Agents - Automated coffee shop operations
- Multi-Provider AI - Gemini, Ollama, LangChain integration
- Event-Driven Communication - Kafka-based agent coordination
- External Integrations - ClickUp, Slack, Google Sheets, Airtable
- Multi-Region Deployment - Global load balancing and failover
- Kubernetes Orchestration - Container management and scaling
- Terraform IaC - Infrastructure as Code for GCP
- Comprehensive Monitoring - Prometheus, Grafana, distributed tracing
graph TB
subgraph "Global Layer"
GLB[Global Load Balancer]
CDN[Content Delivery Network]
WAF[Web Application Firewall]
end
subgraph "AI Agent Network"
BIA[Beverage Inventor]
TCA[Tasting Coordinator]
IMA[Inventory Manager]
NA[Notifier Agent]
FAA[Feedback Analyst]
SA[Scheduler Agent]
ILCA[Inter-Location Coordinator]
TMA[Task Manager]
SMCA[Social Media Content]
end
subgraph "Core Coffee Services"
AG[API Gateway]
PS[Producer Service]
CS[Consumer Service]
STS[Streams Service]
end
subgraph "Web3 Services"
WS[Wallet Service]
DS[DeFi Service]
TS[Transaction Service]
SCS[Smart Contract Service]
SS[Security Service]
end
subgraph "Infrastructure"
K[Kafka Cluster]
PG[PostgreSQL]
R[Redis Cluster]
BC[Blockchain Networks]
end
GLB --> AG
AG --> PS
PS --> K
K --> CS
K --> STS
BIA --> K
TCA --> K
IMA --> K
WS --> BC
DS --> BC
TS --> BC
CS --> PG
AG --> R
- Go 1.22+ - Latest Go version
- Docker & Docker Compose - Container runtime
- Kafka - Message broker (or use Docker setup)
- PostgreSQL 15+ - Primary database
- Redis 7+ - Caching layer
-
Clone the repository
git clone https://github.com/DimaJoyti/go-coffee.git cd go-coffee -
Start infrastructure services
docker-compose up -d kafka postgres redis
-
Run core coffee services
# Terminal 1: Producer Service cd producer && go run cmd/producer/main.go # Terminal 2: Consumer Service cd consumer && go run main.go # Terminal 3: Streams Service cd streams && go run main.go # Terminal 4: API Gateway cd api-gateway && go run main.go
-
Start Web3 services
cd web3-wallet-backend && go run cmd/api-gateway/main.go
-
Launch AI agents
cd ai-agents # Start individual agents cd beverage-inventor-agent && go run main.go cd ../inventory-manager-agent && go run main.go # ... other agents
# Build and run all services
docker-compose up --build
# Run in background
docker-compose up -d
# Scale specific services
docker-compose up --scale producer=3 --scale consumer=2# Deploy to Kubernetes
kubectl apply -f kubernetes/manifests/
# Check deployment status
kubectl get pods -l app=go-coffee
# Scale deployment
kubectl scale deployment coffee-producer --replicas=3Go Coffee features 9 specialized AI agents that automate coffee shop operations:
| Agent | Purpose | Integrations |
|---|---|---|
| Beverage Inventor | Creates new drink recipes | AI/LLM, Recipe Database |
| Tasting Coordinator | Schedules tasting sessions | Calendar, Staff Management |
| Inventory Manager | Tracks real-time inventory | Supply Chain, Alerts |
| Notifier Agent | Sends alerts and notifications | Slack, Email, SMS |
| Feedback Analyst | Analyzes customer feedback | Google Sheets, Sentiment Analysis |
| Scheduler Agent | Manages daily operations | Calendar, Staff Scheduling |
| Inter-Location Coordinator | Coordinates between locations | Delivery, Resource Sharing |
| Task Manager | Creates and tracks tasks | ClickUp, Project Management |
| Social Media Content | Generates social content | Twitter, Instagram, Facebook |
graph LR
subgraph "Event Sources"
E1[New Recipe] --> K[Kafka Topics]
E2[Inventory Alert] --> K
E3[Customer Feedback] --> K
E4[Schedule Change] --> K
end
subgraph "AI Agents"
K --> A1[Beverage Inventor]
K --> A2[Inventory Manager]
K --> A3[Task Manager]
K --> A4[Social Media Agent]
end
subgraph "External Systems"
A1 --> S1[Recipe Database]
A2 --> S2[Supply Chain]
A3 --> S3[ClickUp]
A4 --> S4[Social Platforms]
end
sequenceDiagram
participant C as Customer
participant P as POS System
participant W as Wallet Service
participant B as Blockchain
participant D as DeFi Service
C->>P: Order Coffee ($5.50)
P->>W: Request Payment Options
W->>P: Return Crypto Prices
P->>C: Show QR Code (0.001 ETH)
C->>B: Send Transaction
B->>W: Transaction Confirmed
W->>D: Auto-invest Profits
D->>B: Execute DeFi Strategy
W->>P: Payment Complete
P->>C: Serve Coffee ☕
| Strategy | Description | Expected Returns | Risk Level |
|---|---|---|---|
| Arbitrage | Cross-DEX price differences | 15-30% annually | Low |
| Yield Farming | Liquidity provision rewards | 8-25% APY | Medium |
| Grid Trading | Range-bound trading | 10-20% annually | Medium |
| DCA Bots | Dollar-cost averaging | 12-18% annually | Low |
go-coffee/
├── 📁 Core Coffee Services
│ ├── api-gateway/ # Unified API entry point
│ ├── producer/ # Order processing service
│ ├── consumer/ # Order fulfillment service
│ ├── streams/ # Kafka Streams processing
│ └── pkg/ # Shared libraries
│
├── 🌐 Web3 Backend
│ ├── cmd/ # Service entry points
│ ├── internal/
│ │ ├── defi/ # DeFi protocol integration
│ │ ├── wallet/ # Wallet management
│ │ ├── ai/ # AI service integration
│ │ └── telegram/ # Telegram bot
│ ├── pkg/ # Blockchain clients
│ └── contracts/ # Smart contracts
│
├── 🤖 AI Agents
│ ├── beverage-inventor-agent/
│ ├── inventory-manager-agent/
│ ├── task-manager-agent/
│ └── ... (6 more agents)
│
├── 🏗️ Infrastructure
│ ├── terraform/ # Infrastructure as Code
│ ├── kubernetes/ # K8s manifests
│ ├── monitoring/ # Prometheus & Grafana
│ └── docker-compose.yml # Local development
│
└── 📚 Documentation
├── docs/ # Comprehensive docs
├── README.md # This file
└── project_plan.md # Detailed project plan
- Language: Go 1.22+ (High-performance, concurrent)
- Frameworks: Gin (REST), gRPC (Inter-service)
- Message Queue: Apache Kafka (Event streaming)
- Databases: PostgreSQL 15+ (Primary), Redis 7+ (Cache)
- Ethereum: go-ethereum, ethclient
- Solana: Solana Go SDK
- DeFi Protocols: Uniswap V3, Aave V3, 1inch, Raydium
- Price Feeds: Chainlink oracles
- AI Providers: Google Gemini, Ollama, LangChain
- Natural Language: Multi-provider AI integration
- Automation: Event-driven agent coordination
- Containers: Docker, Docker Compose
- Orchestration: Kubernetes (GKE)
- IaC: Terraform (GCP modules)
- Monitoring: Prometheus, Grafana, Jaeger
- CI/CD: GitHub Actions, ArgoCD
Experience the power of Redis 8 with our comprehensive visual interface:
# Quick start - launches complete Redis 8 visual stack
./scripts/start-redis-visual.sh
# Seed with sample data for testing
cd scripts && go run seed-redis-data.go
# Test all functionality
./scripts/test-redis-visual.sh
# Stop the stack
./scripts/stop-redis-visual.sh🎯 Access Points:
- 🌐 Web UI: http://localhost:3000 (Redis Dashboard)
- 🔧 Redis MCP API: http://localhost:8080
- 📊 RedisInsight: http://localhost:8001
- ⚡ Redis Direct: localhost:6379
✨ Key Features:
- 🔍 Visual Data Explorer: Browse Redis keys and data structures
- 🛠️ Query Builder: Build Redis commands visually with templates
- 📊 Real-time Monitoring: Live metrics and performance tracking
- 🤖 AI-Powered Search: Natural language to Redis queries
- 📈 Data Visualization: Interactive charts and graphs
- 🔄 WebSocket Streaming: Real-time data updates
- 🎨 Modern UI: Built with React, TypeScript, and Tailwind CSS
-
Install dependencies
# Install Go 1.22+ go version # Install Docker docker --version # Install kubectl (for K8s) kubectl version --client
-
Start local infrastructure
# Start Kafka, PostgreSQL, Redis docker-compose up -d kafka postgres redis # Verify services are running docker-compose ps
-
Initialize databases
# Run database migrations cd web3-wallet-backend go run db/migrate.go
# Terminal 1: API Gateway (Port 8080)
cd api-gateway && go run main.go
# Terminal 2: Producer Service (Port 3000)
cd producer && go run cmd/producer/main.go
# Terminal 3: Consumer Service
cd consumer && go run main.go
# Terminal 4: Streams Processor
cd streams && go run main.go# Terminal 5: Web3 API Gateway (Port 8081)
cd web3-wallet-backend && go run cmd/api-gateway/main.go
# Terminal 6: DeFi Service (Port 8082)
cd web3-wallet-backend && go run cmd/defi-service/main.go
# Terminal 7: Wallet Service (Port 8083)
cd web3-wallet-backend && go run cmd/wallet-service/main.go# Start all AI agents
cd ai-agents
# Terminal 8: Inventory Manager
cd inventory-manager-agent && go run main.go
# Terminal 9: Task Manager
cd task-manager-agent && go run main.go
# Terminal 10: Beverage Inventor
cd beverage-inventor-agent && go run main.go
# ... start other agents as needed# Start all core services (Linux/macOS)
./run.sh
# Start all core services (Windows)
run.bat
# Start Web3 services
cd web3-wallet-backend && ./run.sh# Traditional coffee order
curl -X POST http://localhost:3000/order \
-H "Content-Type: application/json" \
-d '{
"customer_name": "John Doe",
"coffee_type": "Latte"
}'
# Response
{
"success": true,
"msg": "Order for John Doe placed successfully!",
"order_id": "uuid-12345"
}curl http://localhost:3000/health
# Response
{
"status": "ok",
"timestamp": "2024-01-01T12:00:00Z",
"services": {
"kafka": "healthy",
"database": "healthy"
}
}# Create order with crypto payment
curl -X POST http://localhost:8081/api/v1/coffee/orders \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"shop_id": "shop-uuid",
"items": [
{
"product_id": "latte-large",
"quantity": 2,
"customizations": {
"milk": "oat",
"shots": 2
}
}
],
"payment_currency": "ETH"
}'
# Response
{
"order_id": "order-uuid",
"total_usd": 11.00,
"payment_options": {
"ETH": {
"amount": "0.003456",
"address": "0x742d35Cc6634C0532925a3b8D4C9db96590e4CAF",
"qr_code": "data:image/png;base64,..."
},
"USDC": {
"amount": "11.00",
"address": "0x742d35Cc6634C0532925a3b8D4C9db96590e4CAF",
"qr_code": "data:image/png;base64,..."
}
},
"expires_at": "2024-01-01T12:15:00Z"
}# Get arbitrage opportunities
curl http://localhost:8082/api/v1/defi/arbitrage/opportunities \
-H "Authorization: Bearer $TOKEN"
# Execute yield farming
curl -X POST http://localhost:8082/api/v1/defi/yield/stake \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"pool_id": "uniswap-usdc-eth",
"amount": "1000",
"strategy": "auto_compound"
}'# Request new beverage invention
curl -X POST http://localhost:9001/api/v1/agents/beverage-inventor/create \
-H "Content-Type: application/json" \
-d '{
"ingredients": ["dragon fruit", "espresso", "coconut milk"],
"theme": "tropical",
"target_location": "mars-base-shop"
}'# Check inventory across all locations
curl http://localhost:9002/api/v1/agents/inventory/status
# Response
{
"locations": [
{
"id": "pirate-shop",
"name": "Pirate Coffee Cove",
"inventory": {
"espresso_beans": {
"quantity": 50,
"unit": "kg",
"status": "good"
},
"dragon_fruit": {
"quantity": 5,
"unit": "kg",
"status": "low",
"alert": true
}
}
}
]
}# API Gateway
export SERVER_PORT=8080
export PRODUCER_GRPC_ADDRESS="localhost:50051"
export CONSUMER_GRPC_ADDRESS="localhost:50052"
# Producer Service
export SERVER_PORT=3000
export KAFKA_BROKERS="localhost:9092"
export KAFKA_TOPIC="coffee_orders"
export KAFKA_RETRY_MAX=5
export KAFKA_REQUIRED_ACKS="all"
# Consumer Service
export KAFKA_BROKERS="localhost:9092"
export KAFKA_TOPIC="coffee_orders"
export KAFKA_PROCESSED_TOPIC="processed_orders"
# Streams Processor
export KAFKA_APPLICATION_ID="coffee-streams-app"
export KAFKA_AUTO_OFFSET_RESET="earliest"
export KAFKA_PROCESSING_GUARANTEE="at_least_once"# Database
export DATABASE_URL="postgres://user:pass@localhost/go_coffee"
export REDIS_URL="redis://localhost:6379"
# Blockchain Networks
export ETHEREUM_RPC_URL="https://mainnet.infura.io/v3/YOUR_KEY"
export BSC_RPC_URL="https://bsc-dataseed.binance.org/"
export POLYGON_RPC_URL="https://polygon-rpc.com/"
export SOLANA_RPC_URL="https://api.mainnet-beta.solana.com"
# DeFi Protocols
export UNISWAP_V3_FACTORY="0x1F98431c8aD98523631AE4a59f267346ea31F984"
export AAVE_LENDING_POOL="0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9"
export ONEINCH_API_URL="https://api.1inch.io/v5.0/1"
# Security
export JWT_SECRET="your-super-secret-jwt-key"
export ENCRYPTION_KEY="your-32-byte-encryption-key"# AI Providers
export GEMINI_API_KEY="your-gemini-api-key"
export OLLAMA_BASE_URL="http://localhost:11434"
export LANGCHAIN_API_KEY="your-langchain-api-key"
# External Integrations
export CLICKUP_API_TOKEN="your-clickup-token"
export SLACK_BOT_TOKEN="xoxb-your-slack-token"
export GOOGLE_SHEETS_CREDENTIALS="path/to/credentials.json"
export AIRTABLE_API_KEY="your-airtable-key"
# Telegram Bot
export TELEGRAM_BOT_TOKEN="your-telegram-bot-token"
export TELEGRAM_WEBHOOK_URL="https://your-domain.com/webhook"server:
port: 8080
host: "0.0.0.0"
kafka:
brokers: ["localhost:9092"]
topics:
coffee_orders: "coffee_orders"
processed_orders: "processed_orders"
database:
host: "localhost"
port: 5432
name: "go_coffee"
user: "postgres"
password: "password"
redis:
host: "localhost"
port: 6379
db: 0blockchain:
ethereum:
rpc_url: "https://mainnet.infura.io/v3/YOUR_KEY"
chain_id: 1
solana:
rpc_url: "https://api.mainnet-beta.solana.com"
cluster: "mainnet-beta"
defi:
protocols:
uniswap_v3:
factory: "0x1F98431c8aD98523631AE4a59f267346ea31F984"
router: "0xE592427A0AEce92De3Edee1F18E0157C05861564"
aave_v3:
lending_pool: "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9"
ai:
providers:
gemini:
api_key: "${GEMINI_API_KEY}"
model: "gemini-pro"
ollama:
base_url: "http://localhost:11434"
model: "llama2"- Architecture - System architecture and design patterns
- Configuration - Detailed configuration guide
- Development Guide - Developer setup and guidelines
- Installation - Installation and setup instructions
- Monitoring - Observability and monitoring setup
- Security - Security best practices and implementation
- Web3 Architecture - Web3 system design
- DeFi Integration - DeFi protocol integration
- API Documentation - Complete API reference
- Coffee Crypto API - Crypto payment APIs
- Solana Integration - Solana blockchain integration
- Terraform - Infrastructure as Code setup
- Docker & Kubernetes - Container orchestration
- Kafka Integration - Message streaming setup
- Multi-Region Deployment - Global deployment
- AI Agents Overview - AI agent ecosystem overview
- Agent Communication - Inter-agent communication plan
# Run all tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Run specific package tests
go test ./internal/defi/...
# Run integration tests
go test -tags=integration ./...
# Run Web3 tests
cd web3-wallet-backend && go test ./...
# Run AI agent tests
cd ai-agents && go test ./...# Install k6
brew install k6 # macOS
# or
sudo apt install k6 # Ubuntu
# Run load tests
k6 run tests/load/coffee-order-flow.js
k6 run tests/load/defi-trading-flow.js# Test on testnets
export ETHEREUM_RPC_URL="https://goerli.infura.io/v3/YOUR_KEY"
export SOLANA_RPC_URL="https://api.devnet.solana.com"
# Run blockchain tests
go test -v ./internal/defi -run TestUniswap
go test -v ./internal/defi -run TestSolana- Infrastructure: GCP account with billing enabled
- Terraform: Version 1.0+ installed
- Kubernetes: kubectl and Helm 3+ installed
- Secrets: All API keys and credentials configured
- Monitoring: Prometheus and Grafana setup
- Security: SSL certificates and security policies
-
Deploy Infrastructure
cd terraform/multi-region terraform init terraform plan -var-file=production.tfvars terraform apply -
Configure Kubernetes
# Get cluster credentials gcloud container clusters get-credentials go-coffee-cluster --region=us-central1 # Deploy services kubectl apply -f kubernetes/manifests/
-
Verify Deployment
# Check all pods are running kubectl get pods -A # Check services kubectl get services # Check ingress kubectl get ingress
| Component | Metric | Value | Target |
|---|---|---|---|
| Coffee API | Latency (p95) | 45ms | < 100ms |
| Coffee API | Throughput | 1,200 TPS | > 1,000 TPS |
| DeFi Service | Latency (p95) | 150ms | < 200ms |
| DeFi Service | Throughput | 500 TPS | > 300 TPS |
| AI Agents | Response Time | 2.5s | < 5s |
| System | Uptime | 99.99% | > 99.9% |
| Strategy | Win Rate | Avg Return | Max Drawdown | Sharpe Ratio |
|---|---|---|---|---|
| Arbitrage | 85% | 1.5% per trade | 2% | 2.1 |
| Yield Farming | 95% | 12% APY | 5% | 1.8 |
| Grid Trading | 82% | 18% annually | 6% | 1.6 |
| DCA Bots | 78% | 15% annually | 8% | 1.4 |
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Add tests
- Run the test suite
go test ./... - Submit a pull request
- Go Best Practices - Follow effective Go guidelines
- Test Coverage - Maintain >80% test coverage
- Documentation - Document all public APIs
- Security - Follow security best practices
- Performance - Consider performance implications
Go Coffee implements a comprehensive, enterprise-grade security architecture designed to protect against modern threats while maintaining high performance.
- Web Application Firewall (WAF) - Protection against OWASP Top 10
- Rate Limiting - Distributed rate limiting with Redis backend
- Real-time Threat Detection - ML-powered threat analysis
- API Gateway - Secure request routing and load balancing
- Input Validation - Comprehensive request sanitization
- Security Headers - HSTS, CSP, X-Frame-Options enforcement
- Multi-Factor Authentication - TOTP, SMS, Email, backup codes
- Device Fingerprinting - Track and trust known devices
- Risk-based Authentication - Dynamic MFA requirements
- Behavioral Analysis - Detect unusual login patterns
- Geo-location Validation - Location-based access control
- ML-powered Fraud Detection - Real-time transaction analysis
- Risk Scoring System - Automated risk assessment
- PCI DSS Compliance - Payment card industry standards
- Encryption Services - AES-256, RSA-2048, Argon2
# Setup complete security platform
./scripts/setup-security-platform.sh
# Start Security Gateway
docker-compose -f docker-compose.security-gateway.yml up -d
# Run security demonstration
./test/security-demo.sh- Security Gateway: http://localhost:8080
- Grafana Dashboard: http://localhost:3000 (admin/admin)
- Prometheus Metrics: http://localhost:9090
- Jaeger Tracing: http://localhost:16686
This project is licensed under the MIT License - see the LICENSE file for details.
- 📚 Documentation - docs/
- 🐛 Issues - GitHub Issues
- 💬 Discussions - GitHub Discussions
- 📧 Email - support@gocoffee.io
- 💬 Discord - Join our Discord
- 🐦 Twitter - @GoCoffeeWeb3
- 📱 Telegram - Go Coffee Community