This is the frontend of a facial recognition-based authentication system built with React.js and face-api.js. The application allows users to register and log in using facial recognition, providing a secure and modern method of authentication.
- Face Registration: Users can register by scanning their faces.
- Face Login: Users can log in using facial recognition.
- Dynamic Navigation: Upon successful login, the navigation bar dynamically updates to show the logged-in user's name.
- User Profile: After login, users are redirected to a
/user
route where their name is displayed along with placeholder content. - Real-time Face Detection: Utilizes
face-api.js
for accurate face detection and matching. - React Toast Notifications: Provides real-time feedback using
react-toastify
.
- Frontend: React.js
- Face Recognition:
face-api.js
- Styling: Tailwind CSS for responsive UI components
- Notifications:
react-toastify
for alert messages
Ensure you have Node.js installed on your machine.
-
Clone this repository and navigate to the
frontend
folder:git clone <repository-url> cd frontend
-
Install dependencies:
npm install
-
Start the development server:
npm start
The app will run on
http://localhost:3000
. -
Ensure you have the models required for
face-api.js
:- Download the models (ssdMobilenetv1, faceLandmark68Net, faceRecognitionNet) and place them in a
/public/models
directory.
- Download the models (ssdMobilenetv1, faceLandmark68Net, faceRecognitionNet) and place them in a
├── public
│ ├── models # Pre-trained face-api.js models
│ └── index.html
├── src
│ ├── components
│ │ ├── Login.js # Facial recognition login component
│ │ ├── Register.js # Facial registration component
│ │ ├── User.js # User profile component
│ │ └── Nav.js # Navigation bar component
│ ├── App.js # Main application component
│ └── index.js # Entry point
└── package.json
- Register: Visit the
/
(Register) route to register your face. - Login: Go to the
/login
route to log in with your face. - User Profile: Upon successful login, you'll be redirected to the
/user
page where your name will be displayed along with some dummy user content.
- Mobile Optimization: Enhance the UI and face detection to work seamlessly on mobile devices.
- Face Descriptor Encryption: Securely encrypt facial descriptors before sending them to the backend.
- Persistent Login: Implement local storage or cookies to persist the login session.
This project is licensed under the MIT License. Feel free to modify and use it for your own purposes.