Skip to content

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.

Notifications You must be signed in to change notification settings

Shaurya2k06/UniByte

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

UniByte - Digital Campus Ecosystem

UniByte Logo

Made with ❀️ React Node.js Ethereum License

🌟 Overview

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.

Key Features

  • πŸ”— 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

πŸ—οΈ Architecture

The project consists of three main components:

UniByte/
β”œβ”€β”€ 🎨 frontend/          # React + Vite frontend application
β”œβ”€β”€ πŸ”§ backend/           # Node.js + Express API server
└── πŸ“œ contracts/         # Ethereum smart contracts (Hardhat)

πŸš€ Tech Stack

Frontend

  • 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

Backend

  • 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

Blockchain

  • 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

πŸ“‹ Prerequisites

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)

⚑ Quick Start

1. Clone the Repository

git clone https://github.com/Shaurya2k06/ByteMe.git
cd ByteMe

2. Environment Setup

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

3. Install Dependencies

# Backend dependencies
cd backend
npm install

# Frontend dependencies
cd ../frontend
npm install

# Smart contract dependencies
cd ../contracts
npm install

4. Deploy Smart Contracts

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

5. Update Contract Address

After deployment, update the contract address in your frontend:

// frontend/src/StudentDashboard.jsx
const BITS_CONTRACT_ADDRESS = "YOUR_DEPLOYED_CONTRACT_ADDRESS";

6. Start the Services

# 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

🎯 Core Features

πŸ’° BITS Token System

  • 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

πŸ” Authentication & Security

  • 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

πŸ“± Payment & QR System

  • 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 Management

  • 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

πŸ›οΈ Campus Marketplace

  • 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

πŸ§ͺ Testing

Smart Contract Tests

cd contracts
npx hardhat test

Contract Compilation

cd contracts
npx hardhat compile

Test Coverage

The smart contracts include comprehensive tests for:

  • Token minting, burning, and transfers
  • Autopay subscription management
  • Authorized collector functionality
  • Error handling and edge cases

πŸ“± API Endpoints

Public Routes

  • POST /public/signup - Traditional user registration
  • POST /public/login - Email/password authentication
  • POST /public/walletSignup - Wallet-based registration with signature
  • POST /public/walletLogin - Wallet-based authentication
  • GET /public/nonce/:walletAddress - Get signing nonce for wallet auth

Protected Routes (Requires JWT)

  • GET /user/getProfile - Get user profile data
  • PATCH /user/updateWallet - Update user wallet address
  • GET /user/allStudents - Get all students (admin only)
  • POST /qr/createQR - Generate QR payment token
  • POST /qr/verifyQR - Verify QR token for payments
  • GET /events/getAllEvents - List all campus events
  • POST /events/joinEvent - Register for events with token payment
  • POST /events/createEvent - Create new events (admin only)
  • GET /shop/getItems - Browse marketplace items
  • POST /shop/purchaseItem - Purchase items with tokens

πŸ”’ Security Features

Smart Contract Security

  • 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

Backend Security

  • 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

🚒 Deployment

Frontend Deployment (Vercel/Netlify)

cd frontend
npm run build
# Deploy dist/ folder to your hosting service

Backend Deployment (Railway/Heroku)

cd backend
# Set production environment variables
npm start

Smart Contract Deployment (Mainnet)

cd contracts
npx hardhat run scripts/deploy.js --network mainnet
npx hardhat verify --network mainnet DEPLOYED_ADDRESS "CONSTRUCTOR_ARGS"

πŸ“Š Current Status

Deployed Contracts

  • BITS Token: 0xfEc060d0CF069ce6b1518445dB538058e9eE063d
  • Admin Account: 0x4f91bd1143168af7268eb08b017ec785c06c0e61
  • Network: Ethereum Sepolia Testnet

Live Application

🀝 Contributing

We welcome contributions to UniByte! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • 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

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘₯ Team ByteMe

Project Lead & Blockchain Developer: Shaurya Srivastava

Backend Development: Utkarsh Mani Tripathi

Frontend Development: Shantanav Mukherjee

UI/UX Design: Purva Pote

πŸ†˜ Support & Contact

For support, questions, or collaboration:

πŸ“ˆ Performance & Scalability

  • 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"

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •