A premium React + TypeScript application built on opBNB with AI-powered features, Supabase authentication, and seamless wallet integration.
- 🤖 AI-Powered Assistant - Get instant help with blockchain queries and smart contract analysis
- ⚡ Lightning Fast - Built on opBNB for ultra-low gas fees and 4,000+ TPS
- 🔐 Secure Authentication - Email/password auth with Supabase
- 💼 Auto Wallet Generation - Automatic opBNB wallet creation and secure storage
- 🎨 Premium UI - Modern glassmorphic design with smooth animations
- 📱 Fully Responsive - Works perfectly on all devices
- Frontend: React 18 + TypeScript + Vite
- Styling: Custom CSS (No frameworks)
- Animation: Framer Motion
- Authentication: Supabase Auth
- Database: Supabase PostgreSQL
- Blockchain: ethers.js v6 + opBNB
- State Management: Zustand
- Encryption: crypto-js
src/
├── components/ # React components
│ ├── Navbar.tsx # Navigation with wallet status
│ ├── Hero.tsx # Landing hero section
│ ├── Features.tsx # Feature cards grid
│ ├── Stats.tsx # opBNB performance stats
│ ├── Footer.tsx # Footer with links
│ └── AuthModal.tsx # Login/Signup modals
├── hooks/
│ └── useAuth.ts # Authentication hook
├── lib/
│ ├── supabase.ts # Supabase client config
│ └── wallet.ts # Wallet utilities
├── services/
│ └── auth.ts # Authentication service
├── store/
│ └── index.ts # Zustand state management
├── styles/
│ ├── globals.css # Global styles & variables
│ └── components.css # Component-specific styles
└── sql/ # Database schema & queries
Run the following in your Supabase SQL editor:
-- Execute: sql/01_create_user_wallets_table.sqlThis creates:
user_walletstable with encrypted private key storage- Row Level Security (RLS) policies
- Automatic timestamp handling
- Performance indexes
user_wallets:
- id (UUID, Primary Key)
- user_id (UUID, References auth.users)
- wallet_address (TEXT)
- encrypted_private_key (TEXT)
- created_at (TIMESTAMP)
- updated_at (TIMESTAMP)- Row Level Security: Users can only access their own wallet data
- Private Key Encryption: AES encryption before database storage
- Environment Variables: Sensitive data stored in
.env - Secure Session Handling: Automatic session management with Supabase
Your .env file is already configured with:
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key_here
VITE_ENCRYPTION_KEY=your_encryption_key_here- ✅ Simple - Just need an API key, no complex setup
- ✅ Free Tier - Generous free storage for small projects
- ✅ IPFS - Decentralized storage on IPFS network
- ✅ Auto Fallback - Works without API key using embedded images
-
Visit Lighthouse Website
https://files.lighthouse.storage/ -
Sign Up / Login
- Click "Sign In" button
- Connect your wallet (MetaMask, WalletConnect, etc.)
- Complete the authentication
-
Get Your API Key
- After logging in, go to your dashboard
- Navigate to "API Key" section in the sidebar
- Click "Create New API Key" button
- Copy your API key (format:
xxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)
-
Add to Your Project
- Open
.envfile in your project root - Find the line:
VITE_LIGHTHOUSE_API_KEY=your_lighthouse_api_key_here - Replace with your actual key:
VITE_LIGHTHOUSE_API_KEY=your_actual_key_here - Save the file and restart your dev server
- Open
With Lighthouse API Key:
✅ Images uploaded to IPFS
✅ Publicly accessible via: https://gateway.lighthouse.storage/ipfs/{hash}
✅ NFT metadata references IPFS URLs
✅ True decentralized storage
Without API Key (Automatic Fallback):
✅ Images converted to data URLs (base64)
✅ Embedded directly in NFT metadata
✅ NFTs still work perfectly
✅ No external dependencies
⚠️ Larger metadata size
Q: I see "Trial expired" error A: The trial API key has expired. Get a free API key from https://files.lighthouse.storage/
Q: Images aren't uploading to IPFS
A: Check that your VITE_LIGHTHOUSE_API_KEY is set correctly in .env file
Q: Do I need an API key for NFTs to work? A: No! NFTs work without it using embedded images. The API key is only needed for IPFS storage.
Q: How much does Lighthouse cost? A: Lighthouse has a generous free tier. Check https://lighthouse.storage/ for current pricing.
See LIGHTHOUSE_SETUP.md for detailed documentation.
- Install dependencies (Already done!)
npm install- Set up database
- Go to your Supabase dashboard
- Run the SQL scripts from
sql/folder - Verify RLS is enabled
- Start development server
npm run devnpm run buildnpm run preview- User visits homepage → clicks "Sign Up"
- Enters email/password → submits form
- Automatic wallet generation using ethers.js
- Private key encrypted with crypto-js AES
- User account + encrypted wallet stored in Supabase
- User logged in with wallet connected
- User clicks "Login" → enters credentials
- Supabase authenticates user
- Existing wallet fetched from database
- Private key decrypted securely
- Wallet restored → user logged in
- View wallet address (formatted: 0x1234...abcd)
- Real-time balance updates
- opBNB testnet integration
- Secure transaction signing
- Glassmorphic UI with backdrop blur effects
- Dark Theme optimized for crypto applications
- Gradient Accents for premium feel
- Smooth Animations using Framer Motion
- Responsive Design for all screen sizes
- Premium Navbar with wallet status
- Hero Section with animated CTAs
- Feature Cards with hover effects
- Performance Stats for opBNB
- Modal System for authentication
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint
npm run type-check # TypeScript type checking- Network: opBNB Testnet
- RPC URL: https://opbnb-testnet-rpc.bnbchain.org
- Chain ID: 5611
- Gas Fees: <$0.001 per transaction
- Block Time: ~2 seconds
- TPS: 4,000+
AuthService.signUp(email, password) // Create account + wallet
AuthService.signIn(email, password) // Login + fetch wallet
AuthService.getUserWallet(userId) // Get user's wallet
AuthService.signOut() // Sign out userWalletService.generateWallet() // Create new wallet
WalletService.encryptPrivateKey(key) // Encrypt private key
WalletService.decryptPrivateKey(key) // Decrypt private key
WalletService.getBalance(address) // Get BNB balance
WalletService.formatAddress(address) // Format for displayExecute these in your Supabase SQL editor:
1. Main table creation:
# Copy and paste sql/01_create_user_wallets_table.sql2. Verify setup:
- Check Tables → user_wallets exists
- Check Authentication → RLS enabled
- Check SQL Editor → Run test queries from sql/02_useful_queries.sql
Built with ❤️ for the opBNB ecosystem languageOptions: { parserOptions: { project: ['./tsconfig.node.json', './tsconfig.app.json'], tsconfigRootDir: import.meta.dirname, }, // other options... }, }, ])
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
```js
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default tseslint.config([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])