Architecture Overview
The full-stack BioKey system consists of:- Client - React app using
biokey-reactfor biometric enrollment and authentication - Server - Node.js backend using
biokey-serverfor challenge generation and verification - Database - Simple SQLite storage for user identities (can be replaced with any DB)
Installation
Client Dependencies
Server Dependencies
Complete Implementation
Server Code
Client Code
Running the Full-Stack App
API Endpoints
POST /enroll
Enroll a new user identity. Request:GET /challenge
Generate a random authentication challenge. Response:POST /verify
Verify user authentication. Request:Security Considerations
Challenge Expiry
Challenge Expiry
Challenges expire after 5 minutes to prevent replay attacks. The server automatically cleans up old challenges.
HTTPS Requirement
HTTPS Requirement
WebAuthn requires HTTPS in production. Use a reverse proxy like Caddy or nginx with SSL certificates.
Rate Limiting
Rate Limiting
Add rate limiting to prevent brute-force attacks:
Database Security
Database Security
- Use parameterized queries (already implemented)
- Hash sensitive data before storage
- Implement proper access controls
- Regular backups
Production Deployment
Deploy Server
Deploy Client
Vercel
Next Steps
Server API Reference
Complete API documentation for biokey-server
Security Guide
Best practices for production deployments