A modern web application built with Next.js 14, TypeScript, Prisma, and SQL Server for managing employee attendance with geo-fencing capabilities.
- Secure login and registration system
- Role-based access control (Admin and Employee)
- Password change functionality
- Geo-fencing for location-based access
- Biometric registration on android, ios, and windows
- Check-in and check-out functionality
- Check-in and check-out functionality via biometrics
- View personal attendance history
- Monthly attendance overview
- Weekly hours visualization
- Personal profile management
- View all employee attendance records
- Real-time attendance monitoring
- Employee attendance reports
- Export attendance data to CSV
- Admin dashboard with statistics
- Present/Late/Absent statistics
- Monthly attendance charts
- Weekly hours tracking
- Attendance rate calculations
- Frontend: Next.js 15, TypeScript, Tailwind CSS
- UI Components: shadcn/ui
- Backend: Next.js API Routes
- Database: SQL Server
- ORM: Prisma
- Authentication: JWT (jose)
- Charts: Recharts
- Styling: Tailwind CSS
- Node.js 18.x or higher
- SQL Server
- npm or yarn
- Clone the repository:
git clone KabiruH/attendance_project
cd employee-attendance-system- Install dependencies:
npm install- Set up environment variables:
DATABASE_URL="sqlserver://server:port;database=ATTENDANCEDB;user=username;password=password;trustServerCertificate=true"JWT_SECRET="your-jwt-secret"- Run Prisma migrations:
npx prisma migrate dev- Start the development server:
npm run devsrc/
├── app/
│ ├── (auth)/
│ │ ├── login/
│ │ └── register/
│ ├── (dashboard)/
│ │ ├── dashboard/
│ │ ├── attendance/
│ │ ├── reports/
│ │ └── profile/
│ └── api/
│ ├── auth/
│ └── attendance/
├── components/
│ ├── ui/
│ ├── dashboard/
│ └── reports/
├── lib/
│ ├── db/
│ ├── auth.ts
│ └── geofence.ts
└── types/
modelEmployees {idInt@id@default(autoincrement())nameString?@db.VarChar(100)emailString@unique@db.VarChar(100)roleString?@default("Employee")@db.VarChar(10)passwordString@db.VarChar(255)created_atDateTime?@default(now())AttendanceAttendance[]}modelAttendance {idInt@id@default(autoincrement())employee_idIntdateDateTime@db.Datecheck_in_timeDateTime?check_out_timeDateTime?statusString@default("Absent")@db.VarChar(10)EmployeesEmployees@relation(fields: [employee_id], references: [id])}POST /api/auth/login- User loginPOST /api/auth/register- User registrationPOST /api/auth/logout- User logoutGET /api/auth/check- Check authentication statusPOST /api/auth/change-password- Change user password
GET /api/attendance- Get attendance recordsPOST /api/attendance- Create attendance recordGET /api/attendance/status- Get attendance status
- Password hashing with bcrypt
- JWT-based authentication
- Geo-fencing for location-based access
- Role-based access control
- Protected API routes
- Input validation and sanitization
- Fork the repository
- Create a new branch
- Make your changes
- Submit a pull request
Optimum Limited
For support, please contact the email in this profile.
Would you like me to expand on any particular section or add more details?