c94eb595f8eb03cfad0ac7b74de5871c47cffee6
Some checks failed
CI / lint-and-test (push) Has been cancelled
Solace Bank Group Treasury Management DApp
A comprehensive Treasury Management DApp with Smart Wallet capabilities, multisig support, sub-accounts, and advanced 3D UI.
Architecture
- Frontend: Next.js 14+ with TypeScript, Tailwind CSS, GSAP, and Three.js
- Smart Contracts: Solidity contracts using Hardhat
- Backend: TypeScript with Drizzle ORM and PostgreSQL
- Blockchain: Chain 138 (Custom Besu Network), Ethereum (mainnet and Sepolia testnet)
Project Structure
solace-bg-dubai/
├── contracts/ # Smart contracts
├── frontend/ # Next.js application
├── backend/ # Backend API and indexer
└── shared/ # Shared types and utilities
Getting Started
Prerequisites
- Node.js >= 18
- PostgreSQL database
- Ethereum RPC endpoint (Alchemy/Infura)
Installation
- Install pnpm (if not already installed):
npm install -g pnpm
- Install dependencies:
pnpm install
- Set up environment variables:
- Copy
.env.examplefiles in each workspace - Configure database, RPC URLs, and contract addresses
- Set up database:
cd backend
pnpm run db:generate
pnpm run db:migrate
- Deploy contracts:
cd contracts
pnpm run compile
pnpm run deploy:sepolia # or deploy:local
pnpm run deploy:chain138 # Deploy to Chain 138
- Start development servers:
# Root directory
pnpm run dev
# Or individually:
cd frontend && pnpm run dev
cd backend && pnpm run dev
cd backend && pnpm run indexer:start
Features
Smart Wallet
- Multisig support (N-of-M threshold)
- Owner management
- Transaction proposals and approvals
- ERC-20 and native token transfers
Sub-Accounts
- Create sub-wallets under main treasury
- Deterministic address generation
- Inherited signer configuration
Banking Functions
- Receive deposits (with QR code)
- Send payments
- Internal transfers between accounts
- Approval management
UI/UX
- 3D visualizations with Three.js
- Smooth animations with GSAP
- Parallax effects
- Responsive design
Development
Smart Contracts
cd contracts
pnpm run compile # Compile contracts
pnpm run test # Run tests
pnpm run coverage # Generate coverage report
Frontend
cd frontend
pnpm run dev # Start dev server
pnpm run build # Build for production
pnpm run lint # Run linter
Backend
cd backend
pnpm run dev # Start API server
pnpm run indexer:start # Start event indexer
pnpm run db:migrate # Run database migrations
Environment Variables
Frontend
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID- WalletConnect project IDNEXT_PUBLIC_SEPOLIA_RPC_URL- Sepolia RPC endpointNEXT_PUBLIC_TREASURY_WALLET_ADDRESS- Deployed treasury wallet addressNEXT_PUBLIC_SUB_ACCOUNT_FACTORY_ADDRESS- Deployed factory address
Backend
DATABASE_URL- PostgreSQL connection stringRPC_URL- Ethereum RPC endpointCHAIN_ID- Chain ID (1 for mainnet, 11155111 for Sepolia)CONTRACT_ADDRESS- Treasury wallet contract address
Contracts
SEPOLIA_RPC_URL- Sepolia RPC endpointMAINNET_RPC_URL- Mainnet RPC endpointCHAIN138_RPC_URL- Chain 138 RPC endpoint (default: http://192.168.11.250:8545)PRIVATE_KEY- Deployer private keyETHERSCAN_API_KEY- Etherscan API key for verification
Chain 138 Deployment
This DApp is configured to work with Chain 138, a custom Besu blockchain network.
Quick Setup
- Configure Chain 138:
./scripts/setup-chain138.sh
- Deploy contracts to Chain 138:
cd contracts
pnpm run deploy:chain138
- Update environment files with deployed contract addresses
Chain 138 Configuration
- Chain ID: 138
- RPC Endpoints:
- WebSocket: ws://192.168.11.250:8546
- Network Type: Custom Besu (QBFT consensus)
Proxmox VE Deployment
The DApp can be deployed on Proxmox VE using LXC containers.
Prerequisites
- Proxmox VE host with LXC support
- Ubuntu 22.04 LTS template available
- Network access to Chain 138 RPC nodes (192.168.11.250-252)
Deployment Steps
- Configure deployment settings:
cd deployment/proxmox
# Edit config/dapp.conf with your Proxmox settings
- Deploy all components:
sudo ./deploy-dapp.sh
- Deploy individual components:
sudo ./deploy-database.sh # PostgreSQL database
sudo ./deploy-backend.sh # Backend API
sudo ./deploy-indexer.sh # Event indexer
sudo ./deploy-frontend.sh # Frontend application
Container Specifications
| Component | VMID | IP Address | Resources |
|---|---|---|---|
| Frontend | 3000 | 192.168.11.60 | 2GB RAM, 2 CPU, 20GB disk |
| Backend | 3001 | 192.168.11.61 | 2GB RAM, 2 CPU, 20GB disk |
| Database | 3002 | 192.168.11.62 | 4GB RAM, 2 CPU, 50GB disk |
| Indexer | 3003 | 192.168.11.63 | 2GB RAM, 2 CPU, 30GB disk |
Post-Deployment
- Deploy contracts to Chain 138 (if not already done)
- Copy environment files to containers:
pct push 3000 frontend/.env.production /opt/solace-frontend/.env.production
pct push 3001 backend/.env /opt/solace-backend/.env
pct push 3003 backend/.env.indexer /opt/solace-indexer/.env.indexer
- Run database migrations:
pct exec 3001 -- bash -c 'cd /opt/solace-backend && pnpm run db:migrate'
- Start services:
pct exec 3001 -- systemctl start solace-backend
pct exec 3003 -- systemctl start solace-indexer
pct exec 3000 -- systemctl start solace-frontend
- Check service status:
pct exec 3000 -- systemctl status solace-frontend
pct exec 3001 -- systemctl status solace-backend
pct exec 3003 -- systemctl status solace-indexer
Nginx Reverse Proxy
For public access, set up Nginx as a reverse proxy. A template configuration is available at:
deployment/proxmox/templates/nginx.conf
Documentation
For detailed deployment instructions, see:
deployment/proxmox/README.md(if created)scripts/setup-chain138.sh- Chain 138 configuration helper
License
Private - Solace Bank Group PLC (Dubai)
Description
Languages
TypeScript
71.4%
Shell
27.7%
CSS
0.6%
JavaScript
0.3%