Skip to content

mohitcr77/AttendEase-intelligent-attendance-and-analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AttendEase

AttendEase Logo

Intelligent Attendance Management System with Geofencing & Work-Life Balance Analytics

License: MIT Node.js React Native MongoDB

FeaturesDemoInstallationDocumentationSecurity


📋 Table of Contents


🎯 Overview

AttendEase is a modern, trust-based attendance management system designed for hybrid workplaces. It combines automatic geofencing-based check-ins with comprehensive work-life balance analytics to help organizations track attendance while promoting employee wellness.

Unlike traditional punitive attendance systems, AttendEase focuses on:

  • 🎯 Trust-first approach - Respects employee autonomy while maintaining accountability
  • 📊 Work-life balance - Provides actionable insights to prevent burnout
  • 🛡️ Balanced security - Fraud detection without invasive monitoring
  • 📱 Seamless UX - Automatic check-ins via geofencing, manual override available

✨ Key Features

🌍 Intelligent Geofencing

  • Automatic Check-In/Out - Background location monitoring triggers attendance when entering/leaving office
  • Multi-Location Support - Manage multiple office locations with custom geofence radius
  • Offline Support - Queue attendance events when offline, sync when connected
  • GPS Accuracy Tracking - Monitor location precision for reliability

📊 Work-Life Balance Analytics

  • Personal Dashboard - Weekly/monthly work hour insights
  • Health Score (0-100) - AI-driven work-life balance rating
  • Smart Suggestions - Personalized recommendations based on work patterns
  • Overtime Tracking - Monitor excessive working hours
  • Team Analytics (Admin) - Organization-wide wellness insights

🔐 Security & Fraud Detection

  • Device Fingerprinting - Track device metadata (OS, version, device ID)
  • Mock Location Detection - Identify GPS spoofing attempts
  • Risk Scoring System - Automatic flagging of suspicious check-ins (0-100 scale)
  • Admin Review Workflow - Flagged records require admin verification
  • JWT Token Security - 15-minute access tokens, 7-day refresh tokens with rotation
  • Rate Limiting - Brute force protection (5 attempts/15 min for auth)
  • Organization Scoping - Multi-tenant isolation ensures data privacy

👥 Organization Management

  • Multi-Tenant Architecture - Secure organization-scoped data access
  • Invite System - Join organizations via unique codes
  • Role-Based Access Control - Employee and Admin roles
  • Admin Dashboard - User management, attendance reports, location control

📱 Mobile-First Design

  • React Native + Expo - Cross-platform (iOS & Android)
  • Beautiful UI - Dark theme with UI Kitten components
  • Push Notifications - Real-time attendance alerts
  • Offline Mode - Full functionality without internet

🛠️ Tech Stack

Backend

  • Runtime: Node.js 20.x LTS
  • Framework: Express.js
  • Database: MongoDB Atlas (Cloud) / Local MongoDB
  • Authentication: JWT (jsonwebtoken) with refresh token rotation
  • File Storage: AWS S3 (profile images)
  • Logging: Winston (file-based logging)
  • Security:
    • Helmet.js (HTTP headers)
    • bcrypt (password hashing, 10 rounds)
    • express-rate-limit (DDoS protection)
    • CORS whitelist
  • Documentation: Swagger/OpenAPI 3.0

Frontend (Mobile)

  • Framework: React Native with Expo SDK
  • UI Library: UI Kitten (Eva Design System)
  • Navigation: React Navigation
  • State Management: AsyncStorage (local persistence)
  • HTTP Client: Axios
  • Geolocation: Expo Location + TaskManager
  • Device Info: Expo Device, Application, Constants

DevOps

  • Version Control: Git
  • CI/CD: GitHub Actions (optional)
  • Hosting:
    • Backend: Render / Heroku
    • Database: MongoDB Atlas
    • Storage: AWS S3

🏗️ Architecture

AttendEase/
├── Check-in-app/
│   ├── server/                    # Backend (Express.js)
│   │   ├── controllers/           # Business logic
│   │   │   ├── authController.js          # Authentication (register, login, refresh)
│   │   │   ├── attendanceController.js    # Check-in/out, risk scoring
│   │   │   ├── analyticsController.js     # Work-life balance analytics
│   │   │   ├── adminController.js         # Admin operations
│   │   │   ├── userController.js          # Profile management
│   │   │   ├── locationController.js      # Geofence management
│   │   │   └── organizationController.js  # Multi-tenancy
│   │   ├── models/                # MongoDB schemas (Mongoose)
│   │   │   ├── User.js                    # User accounts
│   │   │   ├── Organization.js            # Organizations
│   │   │   ├── Location.js                # Office locations
│   │   │   └── AttendanceRecord.js        # Check-in/out with metadata
│   │   ├── routes/                # API endpoints
│   │   ├── middleware/            # Auth, validation, error handling
│   │   ├── utils/                 # Helpers (logger, swagger)
│   │   ├── config/                # AWS S3, DB config
│   │   ├── logs/                  # Application logs
│   │   └── index.js               # Server entry point
│   │
│   └── client/                    # Mobile App (React Native)
│       ├── screens/               # UI screens
│       │   ├── LoginScreen.js             # Authentication
│       │   ├── HomeScreen.js              # Dashboard
│       │   ├── AnalyticsScreen.js         # Work-life analytics ⭐
│       │   ├── ProfileScreen.js           # User profile
│       │   ├── LocationScreen.js          # Office locations
│       │   └── AttendanceScreen.js        # Attendance history
│       ├── components/            # Reusable components
│       │   └── geofencingTask.js          # Background location monitoring
│       ├── helpers/               # Utilities
│       │   └── deviceInfo.js              # Device fingerprinting
│       ├── services/              # API integration
│       │   └── API.js                     # Backend URL config
│       ├── assets/                # Images, icons
│       ├── App.js                 # App entry point
│       └── package.json           # Dependencies
│
├── SETUP_GUIDE.md                 # Complete setup instructions
├── IMPLEMENTATION_SUMMARY.md      # Technical documentation
└── README.md                      # This file

📚 API Documentation

AttendEase includes comprehensive Swagger/OpenAPI 3.0 documentation for all 40+ API endpoints.

Access Swagger UI

Once the backend is running, visit:

http://localhost:5001/api-docs

API Categories

Category Endpoints Description
Authentication 3 Register, login, refresh token
Users 5 Profile management, password, images
Organizations 3 Create, join, list organizations
Locations 6 CRUD for office geofences
Attendance 3 Check-in/out, records
Analytics 4 Work-life balance insights
Admin 6 User management, reports

Example API Calls

Register User

POST /api/auth/register
Content-Type: application/json

{
  "name": "John Doe",
  "email": "john@example.com",
  "password": "SecurePass123!",
  "role": "employee"
}

Check-In with Geofencing

POST /api/attendance/checkIn
Authorization: Bearer <your-jwt-token>
Content-Type: application/json

{
  "locationId": "507f1f77bcf86cd799439013",
  "latitude": 37.7749,
  "longitude": -122.4194,
  "accuracy": 15,
  "isAutomatic": true,
  "isMockLocation": false,
  "deviceInfo": {
    "deviceId": "device-uuid",
    "deviceName": "iPhone 14 Pro",
    "osName": "iOS",
    "osVersion": "17.2",
    "appVersion": "1.3.0"
  }
}

Get Work-Life Analytics

GET /api/analytics/user?period=week
Authorization: Bearer <your-jwt-token>

Response:
{
  "totalHours": 42.5,
  "averageHoursPerDay": 8.5,
  "healthScore": 85,
  "suggestions": [
    "Great work-life balance!",
    "Consider taking regular breaks"
  ],
  ...
}

🔐 Security Features

AttendEase implements enterprise-grade security with a trust-based approach:

✅ Implemented Security Measures

Feature Implementation Status
Password Security bcrypt hashing (10 rounds) ✅ Active
JWT Authentication 15-min access + 7-day refresh tokens ✅ Active
Token Rotation New refresh token on every refresh ✅ Active
Rate Limiting 5 attempts/15min (auth), 100/15min (general) ✅ Active
CORS Whitelist Restricted origins only ✅ Active
Helmet Security HTTP headers hardening ✅ Active
Organization Scoping Multi-tenant data isolation ✅ Active
Role-Based Access Employee vs Admin permissions ✅ Active
Device Fingerprinting OS, version, device ID tracking ✅ Active
Mock Location Detection GPS spoofing identification ✅ Active
Risk Scoring 0-100 fraud likelihood score ✅ Active
Admin Review Flagged records require verification ✅ Active

🛡️ Security Vulnerabilities Fixed

AttendEase has addressed 18 security vulnerabilities:

  • 5 Critical - CORS exposure, JWT expiration, role escalation
  • 13 High - Organization scope bypass, weak tokens, rate limiting

For detailed security implementation, see IMPLEMENTATION_SUMMARY.md.

🔒 Best Practices

Before Production:

  • Rotate all secrets (JWT, MongoDB, AWS)
  • Add .env to .gitignore (already done)
  • Remove .env from git history
  • Enable HTTPS on backend
  • Review CORS allowed origins
  • Set NODE_ENV=production
  • Enable MongoDB Atlas IP whitelist
  • Set up monitoring (e.g., Sentry)

📊 Work-Life Balance Analytics

AttendEase's flagship feature - helping organizations prevent employee burnout.

Personal Analytics Dashboard

Employees can view:

  • Total Hours Worked - Weekly/monthly aggregates
  • Average Hours Per Day - Trend analysis
  • Overtime Tracking - Hours beyond 8/day
  • Arrival Time Patterns - Average check-in time
  • Longest/Shortest Days - Workload distribution
  • Health Score (0-100) - AI-calculated wellness rating
    • 80-100: Excellent balance (Green)
    • 60-79: Moderate concerns (Yellow)
    • 0-59: High burnout risk (Red)
  • Smart Suggestions - Personalized recommendations:
    • "Great work-life balance!"
    • "You're working overtime - consider taking breaks"
    • "Arrive earlier to reduce stress"

Team Analytics (Admin)

Admins can monitor:

  • Team Average Hours - Organization-wide metrics
  • Overworked Employees - Count of at-risk staff (>9h/day avg)
  • Health Alerts - Team burnout warnings (>20% overworked)
  • Per-Employee Breakdown - Individual health scores
  • Trend Analysis - Week-over-week comparisons

Analytics Algorithm

// Health Score Calculation (0-100)
Health Score = Base Score (100)
  - (10 × days with >9h)
  - (20 × days with >10h)
  + (10 if avg < 8h)
  + (5 if consistent arrival time)

📱 Screenshots

Mobile App

Login Screen Home Dashboard Analytics Attendance History

About

AttendEase is a modern, trust-based attendance management system designed for hybrid workplaces. It combines automatic geofencing-based check-ins with comprehensive work-life balance analytics to help organizations track attendance while promoting employee wellness.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors