This project was developed with the purpose of exploring facial recognition methods using JavaScript. Although this topic is widely covered in languages like Python, it's interesting to implement this process using a different technology than usual.
When I developed this project, I wanted to understand what a minimal implementation of facial recognition would look like. For this, I used Node.js for creating the APIs, Next.js for the user interface, and Postgres (with the pgvector extension) as the database. To generate the image embeddings, instead of training my own model and implementing it, I used the Human library .
If you want to start understanding how facial recognition works, I recommend reading this article.
- Registers a new user with a username, password, and face data.
- User login with face recognition, based on username + face data.
- Identify a user through face recognition, without any information besides face data.
Before installing, ensure you have the following installed on your system:
- Docker: You can download and install Docker from here.
- Clone the repository:
git clone https://github.com/valmarath/face-recognition-javascript.git- Build the application
docker-compose build --no-cache- Run the application and tests
docker-compose up -d- The user interface will be accessible at http://localhost:3000
- The API will be accessible at http://localhost:5001
- The API documentation will be accessible at http://localhost:5001/api-docs
This project was, above all, an experiment. Therefore, the implementation and architecture are not ready for real-world use. Specifically, using facial recognition for login in a web application could introduce several security vulnerabilities, so caution should be exercised before considering its implementation.
The frontend is quite simple, given that I just wanted to have one to make it easier for people to test the functionalities (myself included). However, the main goal of this project was exploratory, and it should be treated as such.