A modern NFT marketplace and blockchain-based ticket validation system built with React, TypeScript, and Ethereum smart contracts. Now with Indian Rupee (INR) payment integration!
TruePass is a decentralized marketplace for buying, selling, and trading NFTs, with an integrated blockchain-based ticket validation system. The platform connects to Ethereum wallets and allows users to interact with smart contracts to manage their digital assets and validate event tickets using Time-based One-Time Passwords (TOTP).
The platform now features a fully automated INR-native experience that allows users to purchase tickets using Indian Rupee (UPI/Paytm/Credit Card) while still receiving NFT tickets on the blockchain.
- Browse and search NFT collections
- Connect to Ethereum wallets
- Buy, sell, and trade NFTs with Indian Rupee (INR) payments
- View transaction history
- User profiles and collections
- Generate TOTP-based tickets as NFTs on the Ethereum blockchain
- Validate tickets using time-based one-time passwords
- Offline validation capability
- QR code generation for authenticator apps
- Comprehensive ticket management system
- Purchase tickets using Indian Rupee (INR)
- Support for UPI, Paytm, and Credit Card payments
- Automatic conversion from INR to ETH behind the scenes
- Gasless minting of NFT tickets after successful payment
- Non-transferable tickets to prevent resale
- Frontend: React, TypeScript, Material UI
- Blockchain: Ethereum, Ethers.js
- Authentication: Firebase
- Animations: GSAP
- TOTP: otplib for TOTP generation and validation
- QR Codes: qrcode for QR code generation
- Payment: Transak for INR to ETH conversion
- Signatures: ECDSA for gasless minting
- Node.js (v14 or higher)
- npm or yarn
- MetaMask or another Ethereum wallet
-
Clone the repository:
git clone https://github.com/yourusername/TruePass.git cd TruePass -
Install dependencies:
npm install # or yarn -
Create a
.envfile in the root directory with the following variables:REACT_APP_FIREBASE_API_KEY=your_firebase_api_key REACT_APP_FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain REACT_APP_FIREBASE_PROJECT_ID=your_firebase_project_id REACT_APP_FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucket REACT_APP_FIREBASE_MESSAGING_SENDER_ID=your_firebase_messaging_sender_id REACT_APP_FIREBASE_APP_ID=your_firebase_app_id REACT_APP_CONTRACT_ADDRESS=your_contract_address REACT_APP_TRANSAK_API_KEY=your_transak_api_key REACT_APP_TRANSAK_ENV=STAGING
-
Start the development server:
npm start # or yarn start
npm start- Start the development servernpm run build- Build the app for productionnpm test- Run testsnpm run lint- Run ESLintnpm run lint:fix- Fix ESLint issuesnpm run format- Format code with Prettiernpm run clean- Remove build artifactsnpm run build:prod- Clean and build for production
/src- Source code/assets- Static assets/components- React components/contracts- Smart contract ABIs/hooks- Custom React hooks/pages- Page components/services- API and service functions/store- State management/types- TypeScript type definitions/utils- Utility functions
/public- Public assets/contracts- Smart contract source code
npm run build:prod
# or
yarn build:prodThe build artifacts will be stored in the build/ directory.
The project can be deployed to various hosting platforms:
- Firebase Hosting
- Netlify
- Vercel
- AWS Amplify
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some 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.
- OpenZeppelin for smart contract libraries
- Ethers.js for Ethereum interactions
- React for the UI framework
- otplib for TOTP implementation
- qrcode for QR code generation
- Transak for fiat-to-crypto payment processing
- Go to the "Blockchain Tickets" page
- Select the "Generate Tickets" tab
- Enter ticket details (ID, event name, expiry time)
- Click "Generate QR Code"
- Scan the QR code with an authenticator app (like Google Authenticator)
- Fill in blockchain details (recipient address, seat number, event date)
- Click "Mint Ticket NFT" to create the ticket on the blockchain
- Go to the "Blockchain Tickets" page
- Select the "Validate Tickets" tab
- Select a ticket from the dropdown or enter a token ID
- Ask the ticket holder to open their authenticator app and provide the current code
- Enter the 6-digit code
- Click "Validate Code"
- If the code is valid, you'll see "Valid Ticket! Entry Approved"
- Optionally, click "Validate on Blockchain" to record the validation on-chain
- Time-based Tokens: Codes change every 30 seconds
- One-time Use: Tickets can only be used once
- Blockchain Verification: Validation is recorded on the blockchain
- Expiry Dates: Tickets can be set to expire after a certain time
- Offline Validation: Works without internet connection
- Non-transferable: Tickets cannot be resold or transferred
- Signature Verification: Secure gasless minting with ECDSA signatures
- Browse Tickets: User browses tickets with prices in INR (e.g., ₹499)
- Connect Wallet: User connects their Ethereum wallet (one-time step)
- Initiate Purchase: User clicks "Buy Now" button
- Payment: Transak payment popup appears with UPI/Paytm/Credit Card options
- Complete Payment: User completes payment in INR
- Conversion: INR is converted to ETH behind the scenes
- Minting: NFT ticket is automatically minted to the user's wallet
- Confirmation: User receives confirmation with ticket details
This flow provides a seamless experience for Indian users while maintaining the security and validation benefits of blockchain technology.