A comprehensive backend system for managing meeting auctions with Para wallet authentication and blockchain integration.
- Para Wallet Authentication: Seamless social login integration
- Blockchain Integration: Automated auction management on Ethereum/Sepolia
- Real-time Updates: WebSocket integration for live auction updates
- Meeting Management: Jitsi integration for video meetings
- NFT Management: Automated NFT creation and burning for meeting access
- Cron Jobs: Automated auction ending and cleanup
- Frontend: User clicks "Login with Para" → Para handles social login
- Backend: Receives verification token → Verifies with Para API → Issues JWT
- Session Management: Para session import for wallet operations
- Creation: Frontend creates auction on blockchain → Backend records transaction
- Bidding: Frontend handles all bidding (Para wallet integration)
- Ending: Backend cron job automatically ends expired auctions
- Meeting: Backend creates Jitsi room → Issues access tokens
- NFT Verification: Winner proves NFT ownership via Lit Protocol
- Access Grant: Backend verifies and grants meeting access
- Room Management: Jitsi integration for video meetings
Create a .env file based on env.example:
# Core Configuration
NODE_ENV=development
PORT=5000
FRONTEND_URL=http://localhost:3000
# Database
DATABASE_URL=postgresql://localhost:5432/meeting_auction
REDIS_URL=redis://localhost:6379
# Blockchain
ETH_WSS_ENDPOINT=wss://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY
ETH_HTTP_ENDPOINT=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY
AUCTION_CONTRACT_ADDRESS=0x...
PLATFORM_PRIVATE_KEY=0x...
# JWT
JWT_SECRET=your-super-secret-jwt-key-min-32-chars
# Para Wallet
PARA_API_KEY=your-para-api-key
PARA_SECRET_API_KEY=your-para-secret-api-key
PARA_ENVIRONMENT=beta
# Lit Protocol
LIT_ACTION_IPFS_CID=your-lit-action-ipfs-cid
LIT_PKP_PUBLIC_KEY=0x...
LIT_NETWORK=serrano
# Jitsi Configuration
JITSI_DOMAIN=meet.jit.si
JITSI_APP_ID=meeting-auction-app
JITSI_SECRET=your-jitsi-jwt-secret
# Cron Configuration
AUCTION_CHECK_INTERVAL=*/1 * * * *-
Install Dependencies:
npm install
-
Database Setup:
# Create PostgreSQL database createdb meeting_auction # Run migration npm run migrate
-
Environment Configuration:
cp env.example .env # Edit .env with your configuration -
Start Development Server:
npm run dev
POST /api/auth/para-auth- Para authenticationPOST /api/auth/para-session- Import Para sessionGET /api/auth/verify- Verify JWT token
POST /api/auctions/created- Record auction creationGET /api/auctions/active- Get active auctionsGET /api/auctions/user/created- Get user's auctionsGET /api/auctions/:id- Get auction details
GET /api/meetings/auction/:id- Get meeting by auctionPOST /api/meetings/access/:id- Access meeting with NFTGET /api/meetings/user- Get user's meetingsPOST /api/meetings/:id/extend- Extend meeting durationPOST /api/meetings/:id/close- Close meeting
- users: Para user data and wallet addresses
- auctions: Auction information and blockchain data
- meetings: Meeting rooms and access tokens
- meeting_access_logs: Access tracking and NFT burns
- notifications: User notifications
- lit_gate_passes: Lit Protocol integration
- para_sessions: Para session caching
- Session verification and import
- Wallet ownership verification
- User data management
- Blockchain event listening
- Automated auction ending
- NFT verification
- Meeting creation
- Video room management
- Access token generation
- Room configuration
- Schedule: Every minute (configurable)
- Function: End expired auctions automatically
- Command:
npm run cron
npm start- Production servernpm run dev- Development with nodemonnpm test- Run testsnpm run migrate- Database migrationnpm run cron- Start auction cron job
- Winston-based logging system
- File and console output
- Structured JSON logging
- Comprehensive error handling
- Development vs production error messages
- Detailed logging for debugging
# Run all tests
npm test
# Run specific test file
npm test -- auction.test.js- Set
NODE_ENV=production - Configure proper database URLs
- Set secure JWT secrets
- Enable SSL for database connections
- Configure proper logging levels
# Build and run with Docker Compose
docker-compose up -d- Para API Errors: Check API keys and environment settings
- Database Connection: Verify DATABASE_URL and PostgreSQL status
- Blockchain Connection: Check Web3 provider endpoints
- JWT Issues: Verify JWT_SECRET configuration
- Check
logs/combined.logfor general logs - Check
logs/error.logfor error details - Console output in development mode
- Follow the existing code structure
- Add proper error handling and logging
- Include tests for new features
- Update documentation as needed
This project is licensed under the MIT License.