4a1f69a)
main4a1f69a'deploy: make Phoenix redeploys archive-safe' adopted the Phoenix deployment scaffolding from the abandoned PR #31 branch but landed with three referenced-but-missing files. This PR adds exactly those three files, unchanged from the PR #31 branch, so main is internally consistent and bootable on CT 8604. What main references but does not have -------------------------------------- 1. scripts/deployment/webapp-nginx.conf Referenced by: systemd/currencicombo-webapp.service (ExecStart calls 'nginx -c /etc/currencicombo/webapp-nginx.conf') and install.sh (NGINX_FILE="${ETC_DIR}/webapp-nginx.conf"; install -m 0644 of "${SCRIPT_DIR}/webapp-nginx.conf"). Without this file: webapp unit fails on start with 'nginx: [emerg] open() "/etc/currencicombo/webapp-nginx.conf" failed'. 2. scripts/deployment/systemd/currencicombo-orchestrator.service Referenced by: deploy-currencicombo-8604.sh (line 40: ${ORCHESTRATOR_UNIT:=currencicombo-orchestrator.service}; lines 101/104 systemctl stop/start) and install.sh (line 238 install -m 0644 of "${SCRIPT_DIR}/systemd/currencicombo-orchestrator.service"; line 248 systemctl enable). Without this file: install.sh fails at the install step, deploy script fails at 'systemctl stop currencicombo-orchestrator.service Unit not found'. 3. scripts/deployment/install-prune-cron.sh Referenced by: README.md (step 4: 'bash /var/lib/currencicombo/repo/ scripts/deployment/install-prune-cron.sh' and the 'Backup retention / pruning' section). Without this file: ops follows the README, hits a 'No such file' and has to reconstruct the pruner from prose. Provenance ---------- All three files are verbatim copies of the same three files from the closed PR #31 branch devin/1776898782-pr-aa-phoenix-migration (commitded7d24), which was the source PR #31 reviewers discussed when the three ops improvements (loud-failure rollback, keep-min-5 prune cron, /root/currencicombo-first-keys.txt 0600) were locked. main already absorbed everything else from PR #31 as commit4a1f69a. Verification ------------ - shellcheck --severity=warning scripts/deployment/install-prune-cron.sh: clean - bash -n on install-prune-cron.sh: clean - systemd-analyze verify on currencicombo-orchestrator.service: clean (only unrelated-host-service errors surface on this build box) - sudo bash scripts/deployment/install-prune-cron.sh --dry-run: prints the exact cron body with retain=30, keep-min=5, targeting /var/lib/currencicombo/backups, as expected. - nginx -T on webapp-nginx.conf: not run (nginx not installed on build box); tested on the CT in PR #31's pre-close verification run. Co-Authored-By: Nakamoto, S <defi@defi-oracle.io>
ISO-20022 Combo Flow
A visual workflow builder for composing multi-step financial transactions that combine ISO-20022 banking messages with DLT (Distributed Ledger Technology) operations. Think of it as combining Venmo, your bank, and a crypto exchange into one easy-to-use interface.
🎯 Overview
This system enables users to build complex financial workflows by:
- Dragging and dropping financial steps (borrow, swap, repay, pay)
- Combining DeFi protocols with traditional banking rails
- Executing multi-step transactions atomically using 2PC (Two-Phase Commit)
- Ensuring compliance with LEI/DID/KYC/AML requirements
- Providing real-time execution monitoring and audit trails
🚀 Deployment Models
The system supports three deployment models:
-
Web App (Hosted): For approved parties (enterprise clients, financial institutions)
- Azure AD authentication, RBAC, IP whitelisting
- Full compliance features and audit logs
-
PWA (Mobile): Progressive Web App for mobile users
- Offline support, push notifications, installable
- Same backend with mobile-optimized UI
-
DApp (Public): Decentralized app for general public
- Wallet-based authentication (MetaMask, WalletConnect)
- Open access, public plan templates
See Deployment Architecture for details.
🏗️ Architecture
CurrenciCombo/
├── webapp/ # Next.js 14 frontend application
├── orchestrator/ # Backend orchestrator service (TypeScript/Express)
├── contracts/ # Smart contracts (Solidity)
└── docs/ # Documentation and specifications
✨ Features
Frontend
- 🎨 Drag-and-drop workflow builder
- 🔄 Real-time execution monitoring via SSE
- ✅ Compliance status dashboard (LEI/DID/KYC/AML)
- 🧪 Optional simulation panel for advanced users
- 🔐 Multi-wallet Web3 integration
- 📊 Step dependency visualization
Backend
- 🔄 2PC (Two-Phase Commit) execution coordination
- 📝 ISO-20022 message generation (pacs.008, camt.052/053, camt.056)
- 🏦 Multi-bank connector support (SWIFT, SEPA, FedNow)
- 🔒 Compliance engine integration
- 📋 Notary service for immutable audit trails
- 🎫 Receipt generation and aggregation
Smart Contracts
- ⚡ Atomic execution handler
- 📜 Adapter registry with whitelist/blacklist
- 🔐 Notary registry for codehash tracking
- 🔌 Example adapters (Uniswap, Aave, ISO-20022 Pay)
🚀 Quick Start
Prerequisites
- Node.js 18+
- npm or yarn
- Git
- Docker (optional, for local PostgreSQL)
Installation
-
Clone the repository
git clone https://github.com/your-org/CurrenciCombo.git cd CurrenciCombo -
Install dependencies
# Frontend cd webapp npm install # Backend cd ../orchestrator npm install # Smart Contracts cd ../contracts npm install -
Set up environment variables
# Frontend - Create webapp/.env.local NEXT_PUBLIC_ORCH_URL=http://localhost:8080 NEXTAUTH_SECRET=dev-secret-change-in-production-min-32-chars # Backend - Create orchestrator/.env PORT=8080 NODE_ENV=development SESSION_SECRET=dev-session-secret-minimum-32-characters-long -
Set up database (optional for development)
# Using Docker (recommended) docker run --name combo-postgres ` -e POSTGRES_PASSWORD=postgres ` -e POSTGRES_DB=comboflow ` -p 5432:5432 ` -d postgres:15 # Update orchestrator/.env DATABASE_URL=postgresql://postgres:postgres@localhost:5432/comboflow RUN_MIGRATIONS=true # Run migrations cd orchestrator npm run migrate
Development
Quick Start (First Time Setup)
# Complete setup (installs dependencies, creates env files, sets up database)
./scripts/setup-complete.sh
# Verify everything (runs all verification tests)
./scripts/verify-all.sh
# Start all services
./scripts/start-all.sh
Start all services (WSL/Ubuntu)
./scripts/start-all.sh
Or start individually:
Frontend (Next.js)
cd webapp
npm run dev
# Open http://localhost:3000
# Wait 10-30 seconds for Next.js to compile
Orchestrator Service
cd orchestrator
npm run dev
# Runs on http://localhost:8080
# Health check: http://localhost:8080/health
Smart Contracts
cd contracts
npm run compile
npm run test
Troubleshooting
Frontend not loading?
./scripts/fix-frontend.sh
Check service status:
./scripts/check-status.sh
Run functionality tests:
./scripts/test-curl.sh
Note: This project uses WSL/Ubuntu for development. See WSL Setup Guide for setup instructions.
See Frontend Troubleshooting for more help.
📚 Documentation
Getting Started
- Developer Onboarding
- Development Setup
- Frontend Troubleshooting
- Database Options - Local vs Azure
Architecture & Design
- Deployment Architecture - Web App, PWA, DApp
- Engineering Ticket Breakdown
- UI/UX Specification
- Smart Contract Interfaces
- Adapter Architecture
- Compliance Integration
- Architecture Decision Records
Operations
Testing & Status
Specifications
User Guides
Project Status
🧪 Testing
E2E Tests (Playwright)
cd webapp
npm run test:e2e
Smart Contract Tests (Hardhat)
cd contracts
npm run test
🔧 Configuration
Environment Variables
Frontend (webapp/.env.local):
# Required
NEXT_PUBLIC_ORCH_URL=http://localhost:8080
NEXTAUTH_SECRET=dev-secret-change-in-production-min-32-chars
# Optional (for Azure AD authentication)
NEXTAUTH_URL=http://localhost:3000
AZURE_AD_CLIENT_ID=your-azure-ad-client-id
AZURE_AD_CLIENT_SECRET=your-azure-ad-client-secret
AZURE_AD_TENANT_ID=common
Orchestrator (orchestrator/.env):
# Required
PORT=8080
NODE_ENV=development
SESSION_SECRET=dev-session-secret-minimum-32-characters-long
JWT_SECRET=dev-jwt-secret-minimum-32-characters-long
# Optional (for database)
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/comboflow
RUN_MIGRATIONS=false
# Optional (for Redis caching)
REDIS_URL=redis://localhost:6379
# Optional (for API authentication)
API_KEYS=dev-key-123
ALLOWED_IPS=127.0.0.1,::1
See Database Options for database setup.
📦 Project Structure
.
├── webapp/ # Next.js frontend
│ ├── src/
│ │ ├── app/ # App router pages
│ │ │ ├── (webapp)/ # Web App routes (approved parties)
│ │ │ ├── (pwa)/ # PWA routes (mobile)
│ │ │ └── (dapp)/ # DApp routes (public)
│ │ ├── components/ # React components
│ │ ├── lib/ # Utilities
│ │ └── store/ # Zustand state
│ └── tests/e2e/ # Playwright tests
│
├── orchestrator/ # Backend service
│ ├── src/
│ │ ├── api/ # Express routes
│ │ ├── services/ # Business logic
│ │ ├── integrations/ # External integrations
│ │ ├── middleware/ # Security, auth, validation
│ │ ├── db/ # Database layer
│ │ └── config/ # Configuration
│ └── .env # Environment variables
│
├── contracts/ # Smart contracts
│ ├── ComboHandler.sol # Main handler
│ ├── NotaryRegistry.sol # Notary registry
│ ├── AdapterRegistry.sol # Adapter registry
│ └── adapters/ # Protocol adapters
│
├── scripts/ # Utility scripts (WSL/Ubuntu)
│ ├── start-all.sh # Start all services
│ ├── check-status.sh # Check service status
│ ├── test-curl.sh # Functionality tests
│ └── fix-frontend.sh # Frontend troubleshooting
│
└── docs/ # Documentation
├── DEPLOYMENT_ARCHITECTURE.md
├── DATABASE_OPTIONS.md
├── FRONTEND_TROUBLESHOOTING.md
└── ... (see Documentation section)
🧪 Testing
E2E Tests (Playwright)
cd webapp
npm run test:e2e
Smart Contract Tests (Hardhat)
cd contracts
npm run test
Functionality Tests
# Test all endpoints with curl
./scripts/test-curl.sh
# Check service status
./scripts/check-status.sh
🗄️ Database Setup
Local Development (Recommended)
# Using Docker
docker run --name combo-postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=comboflow \
-p 5432:5432 \
-d postgres:15
Azure Production
See Database Options for Azure setup.
🚢 Deployment
Web App (Azure App Service)
- Deploy to Azure App Service
- Configure Azure AD authentication
- Set up IP whitelisting
PWA (Mobile)
- Add PWA configuration
- Deploy to same backend
- Enable offline support
DApp (Public)
- Deploy to IPFS or public hosting
- Enable wallet authentication
- Public API endpoints
See Deployment Architecture for details.
🤝 Contributing
See CONTRIBUTING.md for guidelines.
📄 License
MIT License - see LICENSE file for details.
🔗 Links
👥 Authors
- Your Organization
📊 Current Status
✅ Production Ready: All core features implemented
- ✅ Frontend: Next.js app with drag-and-drop builder
- ✅ Backend: Orchestrator service with 2PC execution
- ✅ Smart Contracts: Handler, registry, and adapters
- ✅ Testing: E2E tests, contract tests, functionality tests
- ✅ Documentation: Comprehensive guides and specifications
🚀 Deployment Options:
- ✅ Web App (Approved parties)
- ✅ PWA (Mobile version)
- ✅ DApp (Public version)
📈 Next Steps:
- Set up local database for development
- Configure Azure AD for authentication
- Deploy to Azure for production
- Enable PWA and DApp features
Last Updated: 2025-01-15