{"id":31048978,"url":"https://github.com/jay-kabdwal/staff-attendance-app","last_synced_at":"2025-09-14T21:25:41.923Z","repository":{"id":308003601,"uuid":"1030755379","full_name":"Jay-kabdwal/staff-attendance-app","owner":"Jay-kabdwal","description":"A mobile-based staff attendance system using face recognition. Staff members can mark their attendance by entering their ID and taking a live photo. The admin can manage staff, upload training images, and view attendance records through a dedicated admin panel.","archived":false,"fork":false,"pushed_at":"2025-08-03T15:04:58.000Z","size":17046,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-03T16:09:54.546Z","etag":null,"topics":["docker-image","fastapi","postgresql","react-native"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jay-kabdwal.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-02T08:54:21.000Z","updated_at":"2025-08-03T15:28:20.000Z","dependencies_parsed_at":"2025-08-03T16:20:08.086Z","dependency_job_id":null,"html_url":"https://github.com/Jay-kabdwal/staff-attendance-app","commit_stats":null,"previous_names":["jay-kabdwal/staff-attendance-app"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Jay-kabdwal/staff-attendance-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jay-kabdwal%2Fstaff-attendance-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jay-kabdwal%2Fstaff-attendance-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jay-kabdwal%2Fstaff-attendance-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jay-kabdwal%2Fstaff-attendance-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jay-kabdwal","download_url":"https://codeload.github.com/Jay-kabdwal/staff-attendance-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jay-kabdwal%2Fstaff-attendance-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275169779,"owners_count":25417354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-image","fastapi","postgresql","react-native"],"created_at":"2025-09-14T21:25:37.817Z","updated_at":"2025-09-14T21:25:41.906Z","avatar_url":"https://github.com/Jay-kabdwal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Staff Face Recognition Attendance System\n\nA mobile application allowing staff to mark attendance via facial recognition, with an admin panel for user management.\n\n---\n\n## 📱 About the Project\n\nThis is a full-stack, proof-of-concept mobile app to streamline staff attendance using facial recognition. Staff can mark attendance by entering their Staff ID and taking a photo. The admin panel allows adding staff and viewing attendance.\n\n---\n\n## 🔧 Tech Stack\n\n- **Frontend:** React Native (Expo)\n- **Backend:** FastAPI (Python)\n- **Database:** PostgreSQL (via Docker)\n- **Facial Recognition:** `face_recognition` (dlib-based)\n\nThe app uses a client-server model. The frontend (Expo) captures images and sends them to the backend (FastAPI), which verifies the face and stores attendance data in PostgreSQL.\n\n---\n\n## 🚀 Getting Started\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/Jay-kabdwal/staff-attendance-app.git\ncd staff-attendance-app\n```\n\n### 🐍 2. Backend Setup (FastAPI + PostgreSQL)\na. Start PostgreSQL using Docker\nMake sure Docker is running. Then execute:\n\n```bash\ndocker run --name staff-postgres \\\n  -e POSTGRES_USER=admin \\\n  -e POSTGRES_PASSWORD=password \\\n  -e POSTGRES_DB=staff_db \\\n  -p 5432:5432 -d postgres\n```\n\n### b. Create .env file inside /backend\n\n```env\nDATABASE_URL=\"postgresql://admin:password@localhost:5432/staff_db\"\nADMIN_PASSWORD=\"your_secure_password_here\"\n```\n\n### c. Setup Conda Environment\n```bash\nconda create --name staff-app python=3.9 -y\nconda activate staff-app\n```\n### d. Install Dependencies\n```bash\nconda install -c conda-forge fastapi uvicorn sqlalchemy psycopg2 numpy face-recognition python-dotenv -y\n```\n\n### e.Run the Backend Server\n```bash\ncd backend\nuvicorn main:app --reload --host 127.0.0.1\n```\n\n*** Your backend should now be running at http://127.0.0.1:8000 ***\n\n### 📲 3. Frontend Setup (React Native + Expo)\n\n### a. Navigate to frontend folder\n```bash\ncd ../frontend\n```\n### b. Install Dependencies\n```bash\nnpx expo install\n```\n\n### c. Update Backend IP in Code\nReplace any placeholder IPs like:\n\n```ts\nconst backendUrl = 'http://172.26.128.1:8000/api/...';\n```\n\nwith your actual local IP (e.g., http://192.168.x.x:8000).\nYou can get it via:\n\nWindows: ipconfig\n\nmacOS/Linux: ifconfig\n\n### d. Start the Frontend App\n```bash\nnpm start\n```\nScan the QR code using Expo Go.\n\nEnsure your phone and PC are connected to the same Wi-Fi network.\n\n### 📦 Folder Structure\n```bash\nstaff-attendance-app/\n├── backend/\n│   ├── main.py\n│   ├── models.py\n│   ├── database.py\n│   ├── uploads/\n│   └── .env\n├── frontend/\n│   ├── app/\n│   │   ├── (tabs)/index.tsx         # Staff mark attendance\n│   │   ├── (tabs)/report.tsx        # Staff view report\n│   │   ├── (admin)/dashboard.tsx    # Admin panel\n│   │   ├── (admin)/add-staff.tsx    # Admin adds staff\n│   │   └── (admin)/staff-list.tsx   # Admin views staff\n├── README.md\n└── .gitignore\n```\n\n***How the User Search Was Improved***\nThe initial approach involved comparing a new face against the entire database of saved faces (1-vs-all). This was a major performance bottleneck.\n\nThe current, improved approach requires the staff member to enter their unique ID. The backend then fetches only the saved images for that specific ID and performs a much faster 1-vs-1 comparison. This is highly efficient and scales well as the number of users grows.\n\n## Other Potential Improvements\nAdvanced Authentication: Implement a proper database-backed user and admin authentication system using JWT (JSON Web Tokens).\n\nCloud Storage: Move image storage from the local server disk to a cloud solution like Amazon S3 for better scalability and reliability.\n\nPagination: Implement pagination on the attendance report endpoints to handle large datasets efficiently.\n\nContainerization: Use Docker to containerize the backend application for easy and consistent deployment to any cloud provider.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjay-kabdwal%2Fstaff-attendance-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjay-kabdwal%2Fstaff-attendance-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjay-kabdwal%2Fstaff-attendance-app/lists"}