How vainyala/appattendance works
Purpose and runtime
This is a cross-platform Flutter workforce-attendance application, targeting Android, iOS, web, Linux, macOS, and Windows. It covers role-aware authentication, attendance tracking and analytics, leave and regularisation workflows, projects/timesheets, teams, dashboards, and profiles. The README provides no functional specification; architecture is inferred from source layout.
Application bootstrap and navigation
Flutter starts at lib/main.dart, which initializes the application shell in lib/app.dart. Central route definition is isolated in lib/app_router.dart, forming the navigation boundary between feature screens. Native hosts embed the Flutter runtime, notably android/app/src/main/kotlin/com/example/appattendance/MainActivity.kt and ios/Runner/AppDelegate.swift.
Shared platform, state, and persistence
lib/core is the cross-feature foundation. Provider/notifier state is centralized under lib/core/providers/app_state_provider.dart and role selection under lib/core/providers/role_provider.dart. Persistence is abstracted through database and local-storage services: lib/core/database/database_provider.dart, lib/core/database/db_helper.dart, and lib/core/services/storage_service.dart. assets/data/dummy_data.json indicates supported seeded/local dummy data.
Authentication and access control
The auth feature defines a layered model: presentation providers/screens invoke repository contracts, whose implementations call services. Key boundaries are lib/features/auth/presentation/providers/auth_notifier.dart, lib/features/auth/data/repositories/auth_repository_impl.dart, and lib/features/auth/data/services/auth_service.dart. Its screens establish login, password/MPIN, OTP/email/device verification, and role selection flows. User and role domain representations reside in lib/features/auth/domain/models/user_model.dart and lib/features/auth/domain/models/user_role.dart.
Attendance capture, offline behavior, and analytics
Attendance is the principal business domain. UI state is managed by lib/features/attendance/presentation/providers/attendance_notifier.dart; repository implementations bridge domain operations to service layer work in lib/features/attendance/data/repositories/attendance_repository_impl.dart. Capture relies on location/geofence and offline services at lib/features/attendance/data/services/location_service.dart and lib/features/attendance/data/services/offline_attendance_service.dart; face detection has a dedicated screen at lib/features/attendance/presentation/screens/face_detection_screen.dart. Analytics follows a parallel repository/service path via lib/features/attendance/data/repositories/attendance_analytics_repository_impl.dart.
Role-dependent workforce workflows
Dashboard composition distinguishes employee and manager experiences through lib/features/dashboard/presentation/widgets/employeewidgets/employee_dashboard_content.dart and lib/features/dashboard/presentation/widgets/managerwidgets/manager_dashboard_content.dart, coordinated by lib/features/dashboard/presentation/providers/dashboard_notifier.dart. Leave and regularisation use the same provider → service/repository-style boundary, with manager-specific flows in lib/features/leaves/presentation/screens/manager_leave_screen.dart and lib/features/regularisation/data/services/manager_regularisation_service.dart. Team employee data is accessed through lib/features/team/data/services/team_services.dart.
Project and time-recording subsystem
Projects and task/timesheet workflows are separate but connected domains. Project state and persistence pass through lib/features/projects/presentation/providers/project_notifier.dart and lib/features/projects/data/repository/project_repository_impl.dart; timesheet interactions use lib/features/timesheet/presentation/providers/timesheet_notifier.dart and lib/features/timesheet/data/services/timesheet_service.dart. Their domain models define the data boundary: lib/features/projects/domain/models/project_model.dart and lib/features/timesheet/domain/models/timesheet_model.dart.
External-service boundary
Network access is centralized behind lib/core/network/api_client.dart, while feature services encapsulate their backend or local implementations. Device integrations include biometric handling and notifications in lib/core/services/biometric_service.dart and lib/core/services/notification_service.dart. No server, cloud deployment, or concrete third-party backend configuration is present in the supplied tree.
Components 21
Flutter App
- Native Hosts · Android and iOS embed the Flutter runtime.
android/app/src/main/kotlin/com/example/appattendance/MainActivity.kt - Bootstrap
lib/main.dart - Application Shell
lib/app.dart - Route Boundary
lib/app_router.dart
Shared Foundation
- App & Role State · Cross-feature state and selected role.
lib/core/providers/app_state_provider.dart - Local Persistence · Database helpers and local storage abstraction.
lib/core/database/database_provider.dart - API Client
lib/core/network/api_client.dart - Device Services
lib/core/services/biometric_service.dart - Seed Data
assets/data/dummy_data.json
Identity & Access
- Auth Notifier
lib/features/auth/presentation/providers/auth_notifier.dart - Auth Repository
lib/features/auth/data/repositories/auth_repository_impl.dart - Auth Service · Handles login, verification, password, and MPIN flows.
lib/features/auth/data/services/auth_service.dart
Attendance
- Attendance Notifier
lib/features/attendance/presentation/providers/attendance_notifier.dart - Attendance Repository
lib/features/attendance/data/repositories/attendance_repository_impl.dart - Capture & Offline Service · Supports location/geofence capture and offline records.
lib/features/attendance/data/services/location_service.dart - Attendance Analytics
lib/features/attendance/data/repositories/attendance_analytics_repository_impl.dart
Workforce Workflows
- Role Dashboards · Composes distinct employee and manager experiences.
lib/features/dashboard/presentation/providers/dashboard_notifier.dart - Leave & Regularisation
lib/features/regularisation/data/services/manager_regularisation_service.dart - Team Data
lib/features/team/data/services/team_services.dart
Projects & Timesheets
- Projects
lib/features/projects/presentation/providers/project_notifier.dart - Timesheets
lib/features/timesheet/presentation/providers/timesheet_notifier.dart
Connections 26
- Native Hosts → Bootstrap: launches
- Bootstrap → Application Shell: initializes
- Application Shell → Route Boundary: uses
- Route Boundary → Auth Notifier: auth screens
- Route Boundary → Attendance Notifier: attendance screens
- Route Boundary → Role Dashboards: dashboard screens
- Route Boundary → Projects: project screens
- Route Boundary → Timesheets: timesheet screens
- Auth Notifier → Auth Repository: auth operations
- Auth Repository → Auth Service: delegates to
- Auth Service → API Client: network access
- Auth Service → Local Persistence: local credentials
- Auth Service → Device Services: biometrics
- Attendance Notifier → Attendance Repository: attendance operations
- Attendance Notifier → Attendance Analytics: analytics
- Attendance Repository → Capture & Offline Service: capture records
- Capture & Offline Service → Local Persistence: offline storage
- Attendance Repository → API Client: sync
- Role Dashboards → App & Role State: reads role context
- Role Dashboards → Attendance Analytics: attendance metrics
- Role Dashboards → Leave & Regularisation: workflow status
- Role Dashboards → Team Data: manager team data
- Projects → API Client: project persistence
- Timesheets → API Client: time-record persistence
- Timesheets → Projects: records project work
- Local Persistence → Seed Data: loads local data