Skip to content
Hrithwin123Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Finger - Biometric Payment System

"Your fingerprint is your wallet."

πŸ’‘ The Idea

Imagine walking into a store, picking up what you need, and paying with just a touch of your fingerβ€”no cards, no phones, no passwords. Finger reimagines digital payments by merging the security of biometric authentication with the transparency of blockchain technology.

In a world where we're constantly juggling passwords, PINs, and payment cards, Finger offers a radical simplification: your identity is your payment method. By combining SecuGen fingerprint scanning with Solana blockchain, we've created a system where transactions are:

  • πŸ”’ Secure - Biometric data that can't be stolen or forgotten
  • ⚑ Instant - No fumbling for cards or remembering passwords
  • 🌐 Transparent - Every transaction recorded immutably on-chain
  • 🎯 Inclusive - No need for smartphones or bank accounts

Whether you're a street vendor accepting payments or a customer making a purchase, Finger makes transactions as natural as a handshake. This is the future of paymentsβ€”simple, secure, and human.


React Node.js Solana MongoDB

🌟 Features

πŸ”’ Biometric Authentication

  • Fingerprint-based login - No passwords needed
  • SecuGen fingerprint scanner integration
  • ISO template matching with high accuracy (140+ matching score)
  • Real-time fingerprint capture and verification

πŸ’° Payment System

  • User and Vendor accounts with balance management
  • Real-time transaction updates via WebSocket
  • QR code generation for quick payments
  • Transaction history tracking

⛓️ Blockchain Integration

  • Solana blockchain for transparent transactions
  • Anchor framework for smart contract interactions
  • On-chain transaction recording
  • Airdrop functionality for testing

🎨 Modern UI/UX

  • Responsive design with Tailwind CSS
  • Smooth animations using Framer Motion
  • Toast notifications for user feedback
  • Intuitive navigation with React Router

πŸ“‹ Table of Contents

πŸ”§ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v16 or higher)
  • npm or yarn
  • MongoDB (local or cloud instance)
  • SecuGen Fingerprint Scanner and SDK
  • Solana CLI (for blockchain features)
  • Git

Hardware Requirements

  • SecuGen fingerprint scanner device
  • USB port for scanner connection

πŸ“¦ Installation

1. Clone the Repository

git clone <repository-url>
cd finger

2. Install Frontend Dependencies

npm install

3. Install Backend Dependencies

cd back
npm install
cd ..

βš™οΈ Configuration

1. Environment Variables

Create a .env file in the back directory:

# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017/finger-payment

# Server Configuration
PORT=3000

# Solana Configuration
SOLANA_NETWORK=devnet
SOLANA_RPC_URL=https://api.devnet.solana.com

# SecuGen Configuration
SECUGEN_API_URL=https://localhost:8000

2. SecuGen SDK Setup

  1. Install the SecuGen SDK on your system
  2. Ensure the SecuGen service is running on https://localhost:8000
  3. Configure SSL certificates if needed (the app uses rejectUnauthorized: false for development)

3. Solana Wallet Setup

  1. Generate a new Solana wallet or use an existing one
  2. Place your wallet keypair in back/blockchain/new_admin.json
  3. Request devnet SOL from the Solana Faucet
# Example wallet structure
{
  "publicKey": "your-public-key",
  "secretKey": [/* your secret key array */]
}

4. MongoDB Setup

Ensure MongoDB is running:

# Local MongoDB
mongod

# Or use MongoDB Atlas (cloud)
# Update MONGODB_URI in .env with your connection string

πŸš€ Running the Application

Development Mode (Recommended)

Run both frontend and backend concurrently:

npm run dev

This will start:

  • Frontend: http://localhost:5173 (Vite dev server)
  • Backend: http://localhost:3000 (Express server)

Production Build

# Build frontend
npm run build

# Preview production build
npm run preview

# Run backend separately
cd back
npm run dev

πŸ“ Project Structure

finger/
β”œβ”€β”€ back/                          # Backend application
β”‚   β”œβ”€β”€ blockchain/                # Solana blockchain integration
β”‚   β”‚   β”œβ”€β”€ idl/                   # Anchor IDL files
β”‚   β”‚   β”œβ”€β”€ airdrop.ts             # Airdrop functionality
β”‚   β”‚   β”œβ”€β”€ transaction.js         # Transaction creation
β”‚   β”‚   └── testTransaction.ts     # Transaction testing
β”‚   β”œβ”€β”€ controllers/               # Request handlers
β”‚   β”‚   β”œβ”€β”€ AuthController.js      # Authentication logic
β”‚   β”‚   β”œβ”€β”€ FingerController.js    # Fingerprint operations
β”‚   β”‚   β”œβ”€β”€ TransactionController.js
β”‚   β”‚   β”œβ”€β”€ UserController.js
β”‚   β”‚   └── VendorController.js
β”‚   β”œβ”€β”€ models/                    # MongoDB schemas
β”‚   β”‚   β”œβ”€β”€ UserSchema.js
β”‚   β”‚   β”œβ”€β”€ VendorSchema.js
β”‚   β”‚   └── TransactionSchema.js
β”‚   β”œβ”€β”€ routers/                   # API routes
β”‚   β”œβ”€β”€ utils/                     # Utility functions
β”‚   β”‚   β”œβ”€β”€ connectDb.js           # Database connection
β”‚   β”‚   └── qr.js                  # QR code generation
β”‚   β”œβ”€β”€ server.js                  # Express server & Socket.IO
β”‚   └── package.json
β”œβ”€β”€ src/                           # Frontend application
β”‚   β”œβ”€β”€ pages/                     # React pages/routes
β”‚   β”‚   β”œβ”€β”€ Landing.jsx            # Landing page
β”‚   β”‚   β”œβ”€β”€ Login.jsx              # User login
β”‚   β”‚   β”œβ”€β”€ Signup.jsx             # User registration
β”‚   β”‚   β”œβ”€β”€ VendorLogin.jsx        # Vendor login
β”‚   β”‚   β”œβ”€β”€ VendorSignup.jsx       # Vendor registration
β”‚   β”‚   β”œβ”€β”€ Match.jsx              # Fingerprint matching
β”‚   β”‚   β”œβ”€β”€ Payments.jsx           # Payment interface
β”‚   β”‚   β”œβ”€β”€ Transactions.jsx       # Transaction history
β”‚   β”‚   └── DoneLogin.jsx          # Post-login handler
β”‚   β”œβ”€β”€ App.jsx                    # Main app component
β”‚   β”œβ”€β”€ main.jsx                   # React entry point
β”‚   └── index.css                  # Global styles
β”œβ”€β”€ public/                        # Static assets
β”œβ”€β”€ .gitignore
β”œβ”€β”€ package.json
β”œβ”€β”€ vite.config.js                 # Vite configuration
β”œβ”€β”€ eslint.config.js               # ESLint configuration
└── README.md

πŸ”Œ API Endpoints

Authentication

POST /api/auth/signup
POST /api/auth/login
POST /api/auth/vendor/signup
POST /api/auth/vendor/login

Fingerprint Operations

POST /api/finger/scan
POST /api/finger/match
PUT  /api/finger/update

User Management

GET    /api/users/:id
PUT    /api/users/:id
GET    /api/users/:id/balance

Vendor Management

GET    /api/vendors/:id
PUT    /api/vendors/:id
GET    /api/vendors/:id/balance

Transactions

POST   /api/transactions
GET    /api/transactions/:userId
GET    /api/transactions/vendor/:vendorId

WebSocket Events

// Client -> Server
socket.emit('userMoneyChange', { id: userId })
socket.emit('vendorMoneyChange', { id: vendorId })

// Server -> Client
socket.on('userMoneyChange', ({ balance, id }) => {})
socket.on('vendorMoneyChange', ({ balance, id }) => {})

πŸ› οΈ Technologies Used

Frontend

  • React 19.1.0 - UI library
  • React Router DOM 7.6.2 - Client-side routing
  • Tailwind CSS 4.1.8 - Utility-first CSS framework
  • Framer Motion 12.16.0 - Animation library
  • Lucide React - Icon library
  • QRCode.react - QR code generation
  • Socket.IO Client - Real-time communication
  • React Toastify - Toast notifications
  • Vite 6.3.5 - Build tool and dev server

Backend

  • Node.js - Runtime environment
  • Express 5.1.0 - Web framework
  • MongoDB - NoSQL database
  • Mongoose 8.15.1 - MongoDB ODM
  • Socket.IO 4.8.1 - WebSocket library
  • bcryptjs - Password hashing
  • CORS - Cross-origin resource sharing
  • dotenv - Environment variable management

Blockchain

  • Solana Web3.js 1.98.4 - Solana JavaScript API
  • Anchor 0.32.1 - Solana smart contract framework
  • BN.js - Big number library

Biometric

  • SecuGen SDK - Fingerprint scanner integration
  • node-fetch - HTTP client for SecuGen API

πŸ” How It Works

1. User Registration Flow

User β†’ Scan Fingerprint β†’ Create Account β†’ Store Template β†’ Generate Wallet
  1. User scans fingerprint using SecuGen device
  2. System captures ISO template (base64 encoded)
  3. User provides name and password
  4. Template and credentials stored in MongoDB
  5. Initial balance set to 0

2. Authentication Flow

User β†’ Scan Fingerprint β†’ Match Template β†’ Login Success
  1. User scans fingerprint
  2. System retrieves all user templates from database
  3. Compares scanned template with stored templates using SGIMatchScore
  4. If matching score > 140, authentication succeeds
  5. User session established

3. Payment Flow

User β†’ Select Vendor β†’ Enter Amount β†’ Confirm β†’ Blockchain Transaction β†’ Update Balances
  1. User selects vendor and enters payment amount
  2. System validates user balance
  3. Creates Solana blockchain transaction
  4. Records transaction in MongoDB
  5. Updates user and vendor balances
  6. Emits WebSocket events for real-time UI updates
  7. Generates transaction receipt

4. Blockchain Integration

// Transaction creation on Solana
1. Initialize Anchor program
2. Create transaction instruction
3. Sign with user wallet
4. Send to Solana network
5. Confirm transaction
6. Store transaction hash

πŸ” Security Features

  • Biometric authentication - More secure than passwords
  • Template encryption - Fingerprint templates stored securely
  • Password hashing - bcrypt for password security
  • HTTPS for fingerprint API - Secure communication with scanner
  • Blockchain immutability - Transparent transaction records
  • Real-time validation - Immediate balance checks
  • Session management - Secure user sessions

πŸ§ͺ Testing

Test Blockchain Transaction

cd back/blockchain
npx esrun testTransaction.ts

Test Fingerprint Scanning

Ensure SecuGen service is running, then:

curl -k -X POST https://localhost:8000/SGIFPCapture \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "Timeout=15000&TemplateFormat=ISO"

πŸ› Troubleshooting

SecuGen Scanner Not Detected

# Check if SecuGen service is running
curl -k https://localhost:8000/SGIFPCapture

# Restart SecuGen service
# Windows: Services β†’ SecuGen β†’ Restart
# Linux: sudo systemctl restart secugen

MongoDB Connection Error

# Check MongoDB status
mongod --version

# Start MongoDB
mongod --dbpath /path/to/data

Solana Transaction Fails

# Check Solana network status
solana cluster-version

# Check wallet balance
solana balance

# Request airdrop (devnet only)
solana airdrop 2

Port Already in Use

# Find process using port 3000
netstat -ano | findstr :3000

# Kill the process (Windows)
taskkill /PID <process-id> /F

# Kill the process (Linux/Mac)
kill -9 <process-id>

πŸ“ˆ Future Enhancements

  • Multi-factor authentication (fingerprint + PIN)
  • Support for multiple fingerprint scanners
  • Mobile app integration
  • Advanced transaction analytics
  • Merchant dashboard
  • Loyalty rewards system
  • Multi-currency support
  • Mainnet deployment
  • KYC integration
  • Refund functionality

🀝 Contributing

Contributions are welcome! Please follow these steps:

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

Coding Standards

  • Use ESLint configuration provided
  • Follow React best practices
  • Write meaningful commit messages
  • Add comments for complex logic
  • Update documentation for new features

πŸ“„ License

This project is licensed under the ISC License.

πŸ‘₯ Authors

  • Development Team - Initial work

πŸ™ Acknowledgments

  • SecuGen - Fingerprint scanner technology
  • Solana Foundation - Blockchain infrastructure
  • Anchor - Smart contract framework
  • React Team - Frontend framework
  • MongoDB - Database solution

πŸ“ž Support

For support, please open an issue in the repository or contact the development team.


⚠️ Important Notes:

  • This application is currently configured for development/testing purposes
  • Uses Solana devnet - not suitable for production without modifications
  • SecuGen SDK requires proper licensing for commercial use
  • Ensure compliance with biometric data regulations (GDPR, CCPA, etc.)
  • Always use HTTPS in production environments
  • Implement proper error handling and logging for production

Made with ❀️ using React, Node.js, Solana, and SecuGen

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages