A facial validation service for KYC (Know Your Customer) processes that compares two face images to determine if they belong to the same person.
You can use documents such as a driver's license to verify if it matches the photo.
- KYC-CHECK
- โ Upload two images containing faces
- โ Real-time image preview
- โ Face similarity comparison
- โ Percentage-based similarity score
- โ Simple and intuitive user interface
- โ REST API for integration with other systems
- โ Internationalization (Portuguese & English)
- Basic KYC Implementation Guide using KYC_CHECK - A practical guide on how to implement and use the KYC_CHECK library in your projects.
A live demo is available at: https://kyc-check-production.up.railway.app/
# Clone the repository
git clone https://github.com/juninhopo/kyc-check.git
cd kyc-check
# Install dependencies
pnpm install
# Download face recognition models
pnpm run download-models
Create a .env
file in the root directory with the following variables:
PORT=3000
API_THRESHOLD=0.50
# Start the development server with Tailwind CSS watching
pnpm run dev:full
# OR start only the development server (without Tailwind watching)
pnpm run dev
# Build for production
pnpm run build
pnpm run build:css
# Start production server
pnpm start
Access the application at http://localhost:3000
This project uses Tailwind CSS for styling. Here are the available commands for working with Tailwind CSS:
# Build Tailwind CSS once
pnpm run build:css
# Watch for changes and rebuild Tailwind CSS automatically
pnpm run watch:css
# Start development server with Tailwind CSS watching (recommended for development)
pnpm run dev:full
The project includes several custom Tailwind components:
.btn
- Base button style.btn-primary
- Primary action button.btn-secondary
- Secondary action button.card
/.card-dark
- Card containers for light/dark modes.lang-button
- Language selection buttons.language-active
- Active language indicator
You can find and modify these styles in /public/tailwind.css
.
POST /api/validate-faces
Parameter | Type | Description |
---|---|---|
image1 | File | First face image |
image2 | File | Second face image |
type ValidationResponse = {
success: boolean;
data?: {
isMatch: boolean;
similarity: number;
debugInfo?: {
// Debug information about face detection
};
};
error?: string;
};
Success Response:
{
"success": true,
"data": {
"isMatch": true,
"similarity": 0.92,
"debugInfo": {
"face1": {
"confidence": 0.99,
"detectionTime": 156
},
"face2": {
"confidence": 0.98,
"detectionTime": 142
},
"comparisonTime": 85
}
}
}
Using cURL:
# Production
curl -X POST \
https://kyc-check-production.up.railway.app/api/validate-faces \
-H 'Content-Type: multipart/form-data' \
-F 'image1=@/path/to/first/image.jpg' \
-F 'image2=@/path/to/second/image.jpg'
# Local Development
curl -X POST \
http://localhost:3000/api/validate-faces \
-H 'Content-Type: multipart/form-data' \
-F 'image1=@/path/to/first/image.jpg' \
-F 'image2=@/path/to/second/image.jpg'
KYC-CHECK supports both Portuguese (Brazil) and English (US) languages:
Users can switch between languages by clicking on the language buttons (flags) located in the header:
- ๐ง๐ท Portuguese (Brazil) - Default language
- ๐บ๐ธ English (US)
All interface elements, validation messages, and results will automatically be translated based on the selected language.
When using the API, you can specify the preferred language for error messages:
curl -X POST \
http://localhost:3000/api/validate-faces \
-H 'Content-Type: multipart/form-data' \
-H 'Accept-Language: en-US' \
-F 'image1=@/path/to/first/image.jpg' \
-F 'image2=@/path/to/second/image.jpg'
For Portuguese responses, use Accept-Language: pt-BR
. If not specified, the API will default to Portuguese.
kyc-check/
โโโ public/ # Static assets
โ โโโ index.html # Main frontend interface
โโโ src/
โ โโโ api/ # API endpoints
โ โโโ services/ # Face detection services
โ โโโ types/ # TypeScript type definitions
โ โโโ utils/ # Utility functions
โโโ uploads/ # Temporary storage for uploaded images
โโโ .env # Environment variables
โโโ package.json # Project dependencies
- Icon designed by Eric Viana
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request