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/
model Employees {
id Int @id @default(autoincrement())
name String? @db.VarChar(100)
email String @unique @db.VarChar(100)
role String? @default("Employee") @db.VarChar(10)
password String @db.VarChar(255)
created_at DateTime? @default(now())
Attendance Attendance[]
}
model Attendance {
id Int @id @default(autoincrement())
employee_id Int
date DateTime @db.Date
check_in_time DateTime?
check_out_time DateTime?
status String @default("Absent") @db.VarChar(10)
Employees Employees @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?