Comprehensive offshore tax optimization platform for digital nomads, featuring multi-currency wallets, P2P trading, and international business formation.
NomadMoney is a comprehensive fintech platform designed for digital nomads, remote professionals, and international entrepreneurs. The application provides a complete ecosystem for managing global finances, obtaining tax residencies, forming international companies, and facilitating peer-to-peer cryptocurrency transactions.
Built a sophisticated wallet system supporting multiple currencies with atomic transactions and escrow functionality for P2P trading security.
// Multi-currency wallet with escrow system
interface Wallet {
id: string
user_id: string
currency: string
balance: number
available_balance: number
reserved_balance: number // For escrow in P2P trades
created_at: string
updated_at: string
}
// Atomic transaction ensuring data consistency
const { data: transaction, error: transactionError } = await serviceSupabase
.from('transactions')
.insert({
user_id: user.id,
wallet_id: wallet.id,
type: 'purchase',
status: 'completed',
amount: product.price,
currency: product.currency,
description: transactionDescription,
metadata: { product_id: product.id, product_name: product.name },
completed_at: new Date().toISOString(),
})
.select('id')
.single()
// Update wallet balance atomically
const { error: walletUpdateError } = await serviceSupabase
.from('wallets')
.update({
balance: newBalance,
available_balance: newAvailableBalance,
updated_at: new Date().toISOString(),
})
.eq('id', wallet.id)
// Escrow mechanism for buyer protection in P2P trades
if (ad.type === 'buy') {
// Reserve buyer's balance (move from available to reserved)
const { error: escrowError } = await supabaseAdmin
.from('wallets')
.update({
available_balance: buyerWallet.available_balance - total_amount,
reserved_balance: buyerWallet.reserved_balance + total_amount,
})
.eq('id', buyerWallet.id)
// Create transaction record for escrow
await supabaseAdmin.from('transactions').insert({
user_id: user.id,
type: 'escrow_reserve',
amount: total_amount,
currency: ad.currency,
status: 'completed',
description: `Funds reserved for P2P order`,
metadata: { order_id: null, ad_id: ad_id, escrow_type: 'buyer_reserve' },
})
}
// Order lifecycle: Created → Accepted → Payment Confirmed → Funds Released
const orderStateMachine = {
CREATED: ['ACCEPTED', 'CANCELLED'],
ACCEPTED: ['PAYMENT_CONFIRMED', 'DISPUTED'],
PAYMENT_CONFIRMED: ['COMPLETED', 'DISPUTED'],
COMPLETED: [],
DISPUTED: ['RESOLVED', 'CANCELLED']
}
Ad matching and order initiation
Funds secured in reserved balance
Real-time communication
Automatic completion flow
// GraphQL real-time subscriptions
const { data: transactionsData, loading } =
useGetTransactionsByUserIdQuery({
variables: { user_id: userId },
pollInterval: 5000, // Real-time updates
})
const { data: walletsData } = useGetWalletsByUserIdQuery({
variables: { user_id: userId },
pollInterval: 5000,
})
// Apollo Client cache management
const client = new ApolloClient({
uri: process.env.NEXT_PUBLIC_GRAPHQL_URL,
cache: new InMemoryCache({
typePolicies: {
Wallet: {
fields: {
balance: { merge: false },
available_balance: { merge: false }
}
}
}
})
})
Modular component architecture with atoms, molecules, organisms pattern for maximum reusability
Built with real-time requirements from the start using GraphQL subscriptions and Supabase real-time
Financial-grade security implemented from ground up with comprehensive audit trails
GraphQL subscriptions, strategic polling, and optimistic updates for real-time consistency
NomadMoney demonstrates sophisticated fintech development capabilities, combining traditional financial services with modern cryptocurrency functionality. This project showcases advanced concepts in complex state management, real-time architecture, financial-grade security, and scalable system design.