A modern, blockchain-secured attendance tracking system built with React, Firebase, Google Cloud Vision API, and Thirdweb for blockchain integration.
- π Firebase Authentication - Secure user management
- πΈ AI Face Recognition - Google Cloud Vision API integration
- βοΈ Blockchain Storage - Thirdweb-powered attendance records
- π± Responsive UI - Modern Tailwind CSS design
- π₯ Camera Integration - Real-time photo capture
- π Session Management - Create and manage attendance sessions
- π Real-time Tracking - Live attendance monitoring
- π Analytics Dashboard - Blockchain statistics and insights
Frontend (React + Vite)
βββ Firebase Authentication
βββ Google Cloud Vision API
βββ Thirdweb Blockchain Integration
βββ Tailwind CSS UI
- Node.js 18+
- npm or yarn
- Google Cloud Project with Vision API enabled
- Firebase Project
- Thirdweb Account
-
Clone the repository
git clone <your-repo-url> cd Attendance
-
Install dependencies
npm install
-
Set up environment variables Create a
.envfile in the project root:# Firebase Configuration VITE_FIREBASE_API_KEY=your_firebase_api_key VITE_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com VITE_FIREBASE_PROJECT_ID=your_project_id VITE_FIREBASE_STORAGE_BUCKET=your_project.appspot.com VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id VITE_FIREBASE_APP_ID=your_app_id VITE_FIREBASE_MEASUREMENT_ID=your_measurement_id # Google Cloud Vision API VITE_GOOGLE_CLOUD_PROJECT_ID=your_project_id VITE_GOOGLE_CLOUD_API_KEY=your_api_key # Thirdweb Configuration VITE_THIRDWEB_CLIENT_ID=your_thirdweb_client_id # Smart Contract Address VITE_SMART_CONTRACT_ADDRESS=your_deployed_contract_address VITE_EXPECTED_WALLET_ADDRESS=your_wallet_address
-
Start development server
npm run dev
- Create a Firebase project
- Enable Authentication, Firestore, and Storage
- Add your Firebase config to
.env
- Enable Vision API in your Google Cloud project
- Create an API key
- Add project details to
.env
- Create account at thirdweb.com
- Get your client ID
- Deploy the smart contract from
contracts/AttendanceContract.sol - Add contract address to
.env
src/
βββ components/ # Reusable UI components
β βββ CameraTest.jsx # Camera testing component
β βββ FirebaseStatus.jsx
β βββ Layout.jsx
β βββ WalletConnection.jsx
βββ contexts/ # React contexts (Auth, etc.)
βββ pages/ # Main application pages
βββ services/ # Business logic services
β βββ blockchainService.js # Thirdweb integration
β βββ sessionService.js # Session management
β βββ visionService.js # Google Cloud Vision API
βββ config/ # Configuration files
βββ styles/ # CSS and styling
- Face detection and analysis
- Google Cloud Vision API integration
- Fallback to mock recognition for development
- Thirdweb smart contract integration
- Attendance record storage on blockchain
- Real-time blockchain statistics
- Firebase Firestore integration
- Session creation and management
- Attendance tracking and reporting
Use the CameraTest component to debug camera issues:
import CameraTest from './components/CameraTest';
// Add to your page for testing
<CameraTest />This component provides:
- Camera device detection
- Permission testing
- Image capture testing
- Detailed error messages
- Troubleshooting tips
npm run build# Using Thirdweb
npx thirdweb deploy- Firebase Authentication
- API key authentication for Google Cloud
- Blockchain immutability for attendance records
- Secure API key management
- Create Sessions - Set up attendance sessions
- Add Students - Register students with photos
- Mark Attendance - Use AI face recognition
- View Reports - Monitor attendance statistics
- Blockchain Verification - Verify records on blockchain
- Camera not working: Check browser permissions and HTTPS requirement
- Blockchain connection failed: Verify Thirdweb configuration and wallet connection
- Face recognition errors: Check Google Cloud Vision API setup
- Camera Issues: Use the
CameraTestcomponent to diagnose problems - Blockchain Issues: Check browser console for connection errors
- API Errors: Verify environment variables are set correctly
See TROUBLESHOOTING.md for comprehensive solutions to common problems.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License.
For support and questions:
- Check the Troubleshooting Guide
- Review Environment Setup Guide
- Review Firebase and Google Cloud documentation
- Consult Thirdweb documentation for blockchain integration