8000 GitHub - juninhopo/kyc-check: ๐Ÿ‘ฎโ€โ™‚๏ธ A facial validation service for KYC that compares face images to verify if they belong to the same person. Simple to use, with REST API support and web interface.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

๐Ÿ‘ฎโ€โ™‚๏ธ A facial validation service for KYC that compares face images to verify if they belong to the same person. Simple to use, with REST API support and web interface.

Notifications You must be signed in to change notification settings

juninhopo/kyc-check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

36 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

KYC-CHECK

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.

๐Ÿ“‹ Table of Contents

โœจ Features

  • โœ… 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)

๐Ÿ“š Articles

๐ŸŒ Live Demo

A live demo is available at: https://kyc-check-production.up.railway.app/

๐Ÿš€ Installation

# 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

โš™๏ธ Environment Setup

Create a .env file in the root directory with the following variables:

PORT=3000
API_THRESHOLD=0.50

๐Ÿ’ป Usage

# 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

๐ŸŽจ Tailwind CSS

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

Custom Tailwind Components

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.

๐Ÿ“ก API Reference

Face Validation Endpoint

POST /api/validate-faces

Request Parameters

Parameter Type Description
image1 File First face image
image2 File Second face image

Response Structure

type ValidationResponse = {
  success: boolean;
  data?: {
    isMatch: boolean;
    similarity: number;
    debugInfo?: {
      // Debug information about face detection
    };
  };
  error?: string;
};

Example Response

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
    }
  }
}

API Usage Examples

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'

๐ŸŒ Internationalization

KYC-CHECK supports both Portuguese (Brazil) and English (US) languages:

User Interface Language

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.

API Language Support

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.

๐Ÿ“ Project Structure

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

๐Ÿ™ Credits

๐Ÿค Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

About

๐Ÿ‘ฎโ€โ™‚๏ธ A facial validation service for KYC that compares face images to verify if they belong to the same person. Simple to use, with REST API support and web interface.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  
0