A production-ready, full-featured digital asset exchange platform that transforms gift cards into cryptocurrency with an innovative marketplace, referral system, and blockchain integration.
Move beyond simple "gift card for Bitcoin" swaps. We're building a complete ecosystem that captures market share through:
- P2P Marketplace: Users buy/sell gift cards directly with each other
- Instant Wallet Creation: Frictionless onboarding with auto-generated wallets
- AI-Powered Pricing: Dynamic fair market value calculation
- Blockchain Transparency: On-chain verification for all transactions
- Viral Growth: Referral system with rewards and incentives
- Social Impact: Donation features with transparent tracking
gift-card-exchange/
βββ backend/
β βββ config/
β β βββ db.js # MongoDB connection
β βββ controllers/
β β βββ authController.js # Authentication logic
β β βββ cardController.js # Gift card operations
β β βββ cryptoController.js # Crypto conversion
β β βββ referralController.js # Referral system
β β βββ marketplaceController.js # P2P marketplace
β β βββ donationController.js # Donation tracking
β βββ models/
β β βββ User.js # User schema with wallet
β β βββ Card.js # Gift card schema
β β βββ Transaction.js # Transaction history
β β βββ Referral.js # Referral tracking
β β βββ Listing.js # Marketplace listings
β β βββ Donation.js # Donation records
β βββ routes/
β β βββ authRoutes.js
β β βββ cardRoutes.js
β β βββ cryptoRoutes.js
β β βββ referralRoutes.js
β β βββ marketplaceRoutes.js
β β βββ donationRoutes.js
β βββ middleware/
β β βββ authMiddleware.js # JWT, validation, error handling
β βββ utils/
β β βββ walletProvider.js # Instant wallet creation
β β βββ aiPricing.js # Dynamic pricing engine
β β βββ blockchainVerifier.js # On-chain verification
β βββ server.js # Express app setup
β βββ .env.example # Environment variables
β βββ package.json
βββ frontend/ # React web application
β βββ src/
β β βββ components/
β β β βββ Auth/
β β β βββ Cards/
β β β βββ Crypto/
β β β βββ Marketplace/
β β β βββ Referral/
β β β βββ Donations/
β β β βββ Layout/
β β βββ context/ # Global state management
β β βββ pages/
β β βββ styles/
β β βββ App.js
β βββ package.json
βββ mobile/ # React Native mobile app
β βββ src/
β β βββ screens/
β β βββ components/
β β βββ context/
β β βββ App.js
β βββ package.json
βββ README.md
- JWT-based authentication
- Email verification
- Two-factor authentication (2FA)
- KYC (Know Your Customer) verification
- Account security with login attempt tracking
- Password reset functionality
- Upload and store gift cards securely
- Card verification (manual, API, blockchain)
- Conversion history tracking
- Dispute resolution system
- Card expiration monitoring
- Remaining value calculation
- Real-time exchange rates (CoinGecko API)
- Support for Bitcoin, Ethereum, Solana
- Dynamic fee calculation
- Transaction history
- Conversion estimation
- Blockchain transaction tracking
- Auto-generate Solana wallets
- Auto-generate Ethereum wallets
- Secure private key storage
- Wallet validation
- Multi-chain support
- Brand reputation multipliers
- Expiration proximity discounts
- Card age bonuses
- Seller reputation scoring
- Market supply/demand analysis
- Seasonality factors
- Confidence scoring
- Solana transaction verification
- Ethereum transaction verification
- Wallet address validation
- Transaction proof generation
- On-chain transparency
- Confirmation tracking
- Create and manage listings
- Escrow-based transactions
- Buyer/seller ratings
- Dispute resolution
- Transaction history
- Unique referral codes
- Commission tracking
- Reward distribution
- Referral dashboard
- Performance analytics
- Crypto donations
- Impact tracking
- Transparent blockchain records
- Donation history
- Tax documentation
- Runtime: Node.js 18+
- Framework: Express.js
- Database: MongoDB
- Authentication: JWT (jsonwebtoken)
- Blockchain:
- Solana Web3.js
- Ethers.js
- APIs:
- CoinGecko (exchange rates)
- Solana RPC
- Ethereum RPC
- Security:
- bcryptjs (password hashing)
- helmet (security headers)
- CORS
- Framework: React 18+
- State Management: Context API
- Styling: Tailwind CSS
- HTTP Client: Axios
- Routing: React Router
- Framework: React Native
- State Management: Context API
- Navigation: React Navigation
- Node.js 18+ and npm
- MongoDB (local or Atlas)
- Solana RPC endpoint
- Ethereum RPC endpoint
- CoinGecko API key (free)
- Clone the repository
git clone https://github.com/yourusername/gift-card-exchange.git
cd gift-card-exchange/backend- Install dependencies
npm install- Configure environment variables
cp .env.example .env
# Edit .env with your configuration- Start the server
npm run devThe server will start on http://localhost:5000
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current userPUT /api/auth/profile- Update profilePUT /api/auth/change-password- Change passwordPOST /api/auth/logout- Logout
POST /api/cards- Upload gift cardGET /api/cards- Get user's cardsGET /api/cards/:id- Get single cardPUT /api/cards/:id- Update cardDELETE /api/cards/:id- Delete cardPOST /api/cards/:id/verify- Verify cardPOST /api/cards/:id/dispute- Report disputeGET /api/cards/:id/history- Get conversion history
GET /api/crypto/rates- Get exchange ratesPOST /api/crypto/convert- Convert to cryptoGET /api/crypto/balance- Get crypto balanceGET /api/crypto/history- Get conversion historyPOST /api/crypto/estimate- Estimate conversionGET /api/crypto/transaction/:id- Get transaction status
{
userId: String (UUID),
email: String (unique),
password: String (hashed),
firstName: String,
lastName: String,
wallet: {
solanaAddress: String,
ethereumAddress: String,
walletCreatedAt: Date
},
isEmailVerified: Boolean,
kycStatus: String (pending|verified|rejected),
twoFactorEnabled: Boolean,
referralCode: String (unique),
referredBy: ObjectId,
balance: {
usd: Number,
crypto: Number
},
reputation: {
rating: Number (1-5),
reviewCount: Number,
positiveReviews: Number
},
preferences: {
emailNotifications: Boolean,
pushNotifications: Boolean,
theme: String (light|dark),
currency: String
},
status: String (active|suspended|deleted),
createdAt: Date,
updatedAt: Date
}{
cardId: String (UUID),
owner: ObjectId (User),
brand: String (Amazon|Apple|etc),
denomination: Number,
currency: String,
cardCode: String (encrypted),
cardCodeHash: String (indexed),
status: String (active|used|expired|cancelled|disputed),
isVerified: Boolean,
expirationDate: Date,
isListed: Boolean,
listingId: ObjectId,
conversionHistory: [{
timestamp: Date,
fromCurrency: String,
toCurrency: String,
fromAmount: Number,
toAmount: Number,
exchangeRate: Number,
fee: Number,
transactionId: String
}],
blockchainVerification: {
isVerifiedOnChain: Boolean,
blockchainNetwork: String,
transactionHash: String,
verificationTimestamp: Date
},
dispute: {
isDisputed: Boolean,
reason: String,
reportedAt: Date,
status: String (open|investigating|resolved|rejected)
},
createdAt: Date,
updatedAt: Date
}{
transactionId: String (UUID),
type: String (card_upload|card_conversion|crypto_transfer|etc),
status: String (pending|completed|failed|cancelled|disputed),
initiator: ObjectId (User),
recipient: ObjectId (User),
amount: Number,
currency: String,
fee: Number,
netAmount: Number,
conversion: {
fromCurrency: String,
toCurrency: String,
fromAmount: Number,
toAmount: Number,
exchangeRate: Number
},
card: ObjectId,
blockchain: {
network: String (solana|ethereum|polygon),
transactionHash: String,
blockNumber: Number,
gasUsed: Number,
confirmations: Number,
isConfirmed: Boolean
},
dispute: {
isDisputed: Boolean,
reason: String,
status: String
},
initiatedAt: Date,
completedAt: Date,
createdAt: Date,
updatedAt: Date
}- Password Hashing: bcryptjs with configurable rounds
- JWT Tokens: Secure token-based authentication
- Account Locking: Automatic lock after failed login attempts
- Email Verification: Required before certain operations
- KYC Verification: Identity verification for compliance
- Two-Factor Authentication: Optional 2FA support
- Private Key Encryption: Secure wallet key storage
- CORS Protection: Cross-origin request validation
- Helmet Security Headers: HTTP security headers
- Rate Limiting: Request rate limiting middleware
- Input Validation: Joi schema validation
- Conversion Fee: 2.5% on crypto conversions
- Marketplace Fee: 2.5% on P2P transactions
- Premium Features: Advanced analytics, priority support
- Referrer Bonus: 5% commission on referred user transactions
- New User Bonus: $10 credit for signing up with referral code
- Transaction fees
- Referral commissions
- Premium subscriptions
- Donation platform fees
- API access for partners
- Core authentication
- Gift card upload & conversion
- Basic crypto integration
- Simple UI
- Marketplace launch
- Referral system
- Instant wallet creation
- Advanced pricing
- Mobile app launch
- Donation system
- Advanced analytics
- Marketing campaigns
- Additional cryptocurrencies
- More gift card brands
- International expansion
- Enterprise features
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Binx Piierre
- GitHub: @binxpiierre
- Email: [email protected]
- CoinGecko for exchange rate data
- Solana Foundation for blockchain infrastructure
- Ethereum community for smart contract standards
- MongoDB for database solutions
For support, email [email protected] or open an issue on GitHub.
Built with β€οΈ by Binx Piierre
Transform gift cards into crypto. Build wealth. Change lives.