TrackAS is a smart attendance system built using React and Vite. It leverages QR codes and geolocation to enable lecturers to efficiently take attendance in classes and manage schedules, while providing a straightforward attendance process for students.
- π± QR Code-based attendance marking
- π Geolocation verification
- π¨βπ« Lecturer dashboard
- π Attendance analytics
- π€ Export functionality
- π Secure authentication
- University lecture attendance
- Workshop participation tracking
- Conference attendance management
- Corporate training sessions
- Lecturer registration and login
- Create and manage class schedules
- Generate QR codes for attendance sessions
- Use geolocation to verify student presence within a class location
- Record and track student attendance
- View previous class attendance records
- Export attendance data (inferred from
xlsxdependency)
- Frontend: React, Vite
- Styling: Tailwind CSS, DaisyUI
- Routing: React Router DOM
- State Management: (To be determined, based on code - maybe add a note if not immediately clear)
- Backend: Supabase (Authentication, Database)
- QR Code Generation:
qrcode.react,react-qr-code - Geolocation/Mapping: Leaflet, React Leaflet
- HTTP Client: Axios
- Date/Time Handling: Day.js
- File Handling: FileSaver, XLSX
- Linting: ESLint
- Node.js (v14 or higher recommended)
- npm or yarn
- A Supabase account and project
-
Clone the repository:
git clone <repository_url> cd trackAS
-
Install dependencies:
npm install # or yarn install -
Set up Supabase:
- Create a new project in your Supabase account.
- Note down your Supabase Project URL and Anon Key.
- Set up the necessary database tables and RLS (Row Level Security) policies as required by the application. (You may need to add specific table/schema details here if they are standard or crucial for setup).
-
Configure environment variables:
- Rename the
.env.examplefile to.env.
mv .env.example .env # or in Windows command prompt ren .env.example .env- Open the
.envfile and replace the placeholder values with your actual Supabase credentials and URLs:
VITE_SUPABASE_URL=YOUR_SUPABASE_PROJECT_URL VITE_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY VITE_LOCALHOST_URL=http://localhost:5173 VITE_VERCEL_URL=YOUR_VERCEL_APP_URL # Optional: if deploying to Vercel
- Rename the
-
Development Mode:
npm run dev # or yarn devThis will start the development server, usually at
http://localhost:5173. -
Build for Production:
npm run build # or yarn buildThis will build the project for production in the
distfolder. -
Preview Production Build:
npm run preview # or yarn previewThis will serve the production build locally.
trackAS/
βββ node_modules/
βββ public/ # Static assets
βββ src/
β βββ assets/ # Images, icons, etc.
β βββ component/ # Reusable React components
β βββ hooks/ # Custom React hooks
β βββ page/ # Pages/Views of the application
β βββ utils/ # Utility functions
β βββ App.jsx # Main application component
β βββ index.css # Global styles
β βββ main.jsx # Entry point
βββ .gitignore
βββ .env
βββ .env.example
βββ package.json
βββ package-lock.json # or yarn.lock
βββ README.md
βββ tailwind.config.js
βββ vite.config.js
βββ vercel.json # Vercel deployment configuration
βββ ... other config files
We welcome contributions to TrackAS! Please read our Contributing Guidelines and Code of Conduct before submitting any contributions.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Install dependencies:
npm install - Start development server:
npm run dev - Run tests:
npm test - Build for production:
npm run build
This project is licensed under the MIT License - see the LICENSE file for details.
This section provides a detailed look at the main features and their technical implementation:
- QR Code Generation: When a lecturer creates a class schedule, the system generates a unique QR code containing:
- Class ID
- Class location coordinates (latitude and longitude)
- Attendance session timestamp
- A unique session token for security
- The QR code is generated using the
qrcode.reactlibrary and encodes a URL that directs students to the attendance page with the necessary parameters.
- Location Verification Process:
- When a student scans the QR code, the system extracts the class location coordinates
- The student's browser is prompted to share their current location using the Geolocation API
- The system calculates the distance between the student's location and the class location using the Haversine formula
- Attendance is only recorded if the student is within 20 meters of the class location
- The system includes error handling for:
- Geolocation permission denials
- GPS signal issues
- Out-of-range locations
- Database Structure:
classestable: Stores class schedules with location dataattendancetable: Records student attendance with:- Student information
- Class reference
- Timestamp
- Location verification status
- Distance from class location
- Security:
- Row Level Security (RLS) policies ensure data privacy
- Authentication required for lecturer actions
- Session tokens prevent unauthorized attendance marking
- Landing Page (
/): Entry point with role selection (Lecturer/Student) - Lecturer Registration (
/registerLecturer): Account creation with email verification - Lecturer Login (
/loginLecturer): Secure authentication using Supabase Auth - Class Schedule (
/classSchedule):- Interactive calendar interface
- Location selection using Leaflet maps
- QR code generation for each class
- Attendance (
/attendance):- Student information input form
- Real-time geolocation status display
- Success/failure feedback
- Previous Class (
/previousClass):- Attendance history view
- Export functionality for attendance records
- Filtering and search capabilities
- Frontend:
- React components with hooks for state management
- Tailwind CSS for responsive design
- DaisyUI for pre-styled components
- Backend Integration:
- Supabase client for real-time database operations
- Secure API endpoints for data operations
- Environment variable management for configuration
- Performance Optimizations:
- Lazy loading for components
- Caching of location data
- Efficient QR code generation
- Error Handling:
- Graceful fallbacks for geolocation failures
- User-friendly error messages
- Automatic retry mechanisms for failed operations
These features work together to provide a secure, efficient, and user-friendly attendance system that leverages modern web technologies for accurate attendance tracking.