UniByte is a comprehensive digital campus ecosystem that revolutionizes student life through blockchain technology. It serves as a digital wallet and event hub where students can earn, spend, and explore with the custom BITS token built specifically for campus activities.
- π Blockchain Integration: Built on Ethereum with custom BITS token (ERC20)
- π³ Digital Wallet: Secure MetaMask integration for token management
- π Autopay System: Automated monthly fee payments via smart contracts
- π± QR Code Payments: Seamless peer-to-peer payment system with QR codes
- π« Event Management: Campus event discovery, registration, and participation
- ποΈ Campus Shop: Token-based marketplace for campus goods and services
- π₯ Multi-Role Support: Students, admins, and developers with role-based access
The project consists of three main components:
UniByte/
βββ π¨ frontend/ # React + Vite frontend application
βββ π§ backend/ # Node.js + Express API server
βββ π contracts/ # Ethereum smart contracts (Hardhat)
- React 18 with Vite for fast development
- Framer Motion for smooth animations and transitions
- Tailwind CSS for modern, responsive styling
- Ethers.js v5 for blockchain interaction
- MetaMask integration for wallet connectivity
- Lucide React for beautiful icons
- Node.js with Express framework
- MongoDB with Mongoose for data persistence
- JWT authentication with wallet signature verification
- CORS enabled for cross-origin requests
- bcrypt for secure password hashing
- dotenv for environment configuration
- Solidity 0.8.28 smart contracts
- Hardhat development environment with testing
- OpenZeppelin for secure contract standards
- ERC20 token implementation with autopay features
- Alchemy for blockchain connectivity
Before running UniByte, ensure you have:
- Node.js (v16.0 or higher)
- npm or yarn package manager
- MongoDB database (local or cloud)
- MetaMask browser extension
- Git for version control
- Ethereum testnet ETH for testing (Sepolia recommended)
git clone https://github.com/Shaurya2k06/ByteMe.git
cd ByteMe
Create .env
files in each directory:
Backend (backend/.env
):
MONGO_URI=mongodb://localhost:27017/unibyte
JWT_SECRET=your_jwt_secret_here_32_chars_min
TOKENIZING_KEY=your_tokenizing_key_here_32_chars_min
Contracts (contracts/.env
):
PRIVATE_KEY=your_wallet_private_key_without_0x
ALCHEMY_API_KEY=your_alchemy_api_key
ETHERSCAN_API_KEY=your_etherscan_api_key
# Backend dependencies
cd backend
npm install
# Frontend dependencies
cd ../frontend
npm install
# Smart contract dependencies
cd ../contracts
npm install
cd contracts
# For local development
npx hardhat node
# In another terminal:
npx hardhat run scripts/deploy.js --network localhost
# For testnet (Sepolia)
npx hardhat run scripts/deploy.js --network sepolia
After deployment, update the contract address in your frontend:
// frontend/src/StudentDashboard.jsx
const BITS_CONTRACT_ADDRESS = "YOUR_DEPLOYED_CONTRACT_ADDRESS";
# Start backend server (Terminal 1)
cd backend
npm start
# Server runs on http://localhost:9092
# Start frontend development server (Terminal 2)
cd frontend
npm run dev
# Frontend runs on http://localhost:5173
- Custom ERC20 Token: BITS token with 18 decimals and 1 billion total supply
- Autopay Subscriptions: Monthly automatic fee deductions (20,000 BITS)
- Authorized Collectors: Secure payment collection system for admins
- Balance Management: Real-time token balance tracking and transaction history
- Dual Authentication: Traditional email/password + MetaMask wallet authentication
- Signature Verification: Ethereum signature-based login with nonce verification
- JWT Tokens: Secure session management with 24-hour expiration
- Role-Based Access: Admin, user, and developer roles with different permissions
- QR Code Generation: 30-day valid payment tokens for easy transfers
- Peer-to-Peer Payments: Instant blockchain-based transactions between users
- Transaction History: Complete payment tracking with timestamps and amounts
- Fee Management: Automated campus fee collection and tracking
- Event Discovery: Browse and search campus events by tags, dates, and locations
- Token-Based Registration: Pay event fees using BITS tokens
- Event Creation: Admin interface for creating and managing events
- Registration Tracking: Monitor event participation and payments
- Digital Shop: Token-based marketplace for campus goods and services
- Item Management: Create, browse, and purchase items using BITS tokens
- Purchase History: Track all marketplace transactions and purchases
cd contracts
npx hardhat test
cd contracts
npx hardhat compile
The smart contracts include comprehensive tests for:
- Token minting, burning, and transfers
- Autopay subscription management
- Authorized collector functionality
- Error handling and edge cases
POST /public/signup
- Traditional user registrationPOST /public/login
- Email/password authenticationPOST /public/walletSignup
- Wallet-based registration with signaturePOST /public/walletLogin
- Wallet-based authenticationGET /public/nonce/:walletAddress
- Get signing nonce for wallet auth
GET /user/getProfile
- Get user profile dataPATCH /user/updateWallet
- Update user wallet addressGET /user/allStudents
- Get all students (admin only)POST /qr/createQR
- Generate QR payment tokenPOST /qr/verifyQR
- Verify QR token for paymentsGET /events/getAllEvents
- List all campus eventsPOST /events/joinEvent
- Register for events with token paymentPOST /events/createEvent
- Create new events (admin only)GET /shop/getItems
- Browse marketplace itemsPOST /shop/purchaseItem
- Purchase items with tokens
- OpenZeppelin Standards: Using battle-tested contract implementations
- Access Control: Owner-only functions with proper access modifiers
- Reentrancy Protection: Safe transfer patterns and state management
- Emergency Functions: Admin withdrawal capabilities for stuck tokens
- JWT Validation: Secure token-based authentication
- Wallet Signature Verification: Cryptographic proof of wallet ownership
- Input Validation: Comprehensive data sanitization and validation
- CORS Configuration: Controlled cross-origin access policies
- Environment Variables: Secure configuration management
cd frontend
npm run build
# Deploy dist/ folder to your hosting service
cd backend
# Set production environment variables
npm start
cd contracts
npx hardhat run scripts/deploy.js --network mainnet
npx hardhat verify --network mainnet DEPLOYED_ADDRESS "CONSTRUCTOR_ARGS"
- BITS Token:
0xfEc060d0CF069ce6b1518445dB538058e9eE063d
- Admin Account:
0x4f91bd1143168af7268eb08b017ec785c06c0e61
- Network: Ethereum Sepolia Testnet
- Frontend: https://www.uni-byte.tech
- Backend API: http://localhost:9092 (development)
We welcome contributions to UniByte! 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
- Follow existing code style and conventions
- Write comprehensive tests for new features
- Update documentation for API changes
- Ensure all tests pass before submitting
- Add proper error handling and logging
This project is licensed under the MIT License - see the LICENSE file for details.
Project Lead & Blockchain Developer: Shaurya Srivastava
Backend Development: Utkarsh Mani Tripathi
Frontend Development: Shantanav Mukherjee
UI/UX Design: Purva Pote
For support, questions, or collaboration:
- π§ Email: [email protected]
- π Website: www.uni-byte.tech
- π¬ Issues: GitHub Issues
- π± Social: Follow us for updates and announcements
- Transaction Speed: Near-instant token transfers
- Gas Optimization: Efficient smart contract functions
- Caching Strategy: Redis implementation for API responses
- Database Indexing: Optimized MongoDB queries
- CDN Integration: Fast asset delivery worldwide
Made with β€οΈ by Team ByteMe
Β© 2025 UniByte. All rights reserved.
"Revolutionizing campus life, one token at a time"