BioKey is a comprehensive, cross-platform biometric authentication and cloud storage solution that combines a custom FINGY fingerprint scanner device with a React/Vite web client, an Expo/React Native mobile app, and a secure Express/MongoDB/MinIO backend. Users authenticate using fingerprints or credentials and can seamlessly manage encrypted files, folders, password vaults, and receive real-time notifications across all platforms.
- Features
- Architecture
- Repository Structure
- Prerequisites
- Installation
- Usage
- API Documentation
- Troubleshooting
- Contributing
- License
- Credits & Acknowledgments
✅ Biometric & Credential Authentication – Secure login via FINGY fingerprint device or email/password
🔐 End-to-End Encryption – RSA key pairs and AES encryption for files and password vault
☁️ Cloud File Storage – Upload, organize, preview, and manage files with automatic thumbnails
📁 Smart Organization – Create folders, mark favorites, and manage recycle bin with 30-day retention
🔒 Password Manager – Securely store and encrypt passwords with breach-check integration
📱 Cross-Platform – Unified experience on web and mobile with real-time sync
🔔 Notifications – Push notifications and activity logs for security awareness
📊 Storage Analytics – Track usage by file type and manage storage quotas
The system is divided into four core components:
- Backend API (server/): Express.js with Node.js, MongoDB, MinIO object storage, JWT authentication, and AES encryption for the password vault
- Web Client (web/): React 19 + Vite + Redux with a global axios client that injects JWT tokens automatically
- Mobile App (app/): Expo/React Native + Redux with configurable API host for device/simulator access
- Hardware Device (ESP32/): ESP32 microcontroller running a fingerprint sensor (e.g., R305) to generate biometric authentication tokens
All API calls from web and mobile clients automatically include JWT tokens via request interceptors. File operations enforce per-user ownership, MIME-type validation, and size limits. The password vault uses client-side AES encryption for sensitive data.
BioKey/
├── server/ # Express API, MongoDB schemas, MinIO integration
│ ├── config/ # Database and MinIO configuration
│ ├── controllers/ # Route handlers for auth, files, passwords, users
│ ├── routes/ # API endpoint definitions
│ ├── models/ # MongoDB schemas
│ ├── middleware/ # Token verification middleware
│ ├── utils/ # Crypto, token generation, validators
│ ├── .env # Environment variables (see Installation)
│ └── package.json
├── web/ # Vite + React web client
│ ├── src/
│ │ ├── services/ # API calls with axios client
│ │ ├── redux/ # State management (auth, files, UI)
│ │ ├── pages/ # Main app pages (Home, Folders, Passwords, etc.)
│ │ └── components/ # Reusable UI components
│ ├── .env # VITE_API_URL configuration
│ └── package.json
├── app/ # Expo + React Native mobile client
│ ├── src/
│ │ ├── services/ # API calls with Redux-based host config
│ │ ├── redux/ # State management (app config, auth, files)
│ │ ├── screens/ # Mobile app screens
│ │ └── navigation/ # React Navigation setup
│ ├── app.json # Expo configuration
│ └── package.json
├── ESP32/ # Arduino sketches for FINGY device
│ └── sketch_feb9b/
│ └── sketch_feb9b.ino
└── README.md # This file
- Node.js 18+ with npm
- MongoDB (local or cloud instance such as MongoDB Atlas)
- MinIO (local or S3-compatible storage service)
- Expo CLI (for mobile development):
npm install -g expo-cli - iOS/Android Tooling (Xcode for iOS, Android Studio for Android, or use Expo Go for testing)
-
Navigate to the server directory:
cd server npm install -
Create a
.envfile in theserver/directory with the following variables:PORT=8000 MONGODB_URI=mongodb://localhost:27017/biokey JWT_SECRET=your_secure_jwt_secret_here AES_KEY=your_32_character_encryption_key_1 MINIO_ENDPOINT=localhost MINIO_PORT=9000 MINIO_USE_SSL=false MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin MINIO_BUCKET_NAME=biokey ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000
-
Ensure MongoDB and MinIO are running on your machine.
-
Start the server:
npm start
The API will be available at
http://localhost:8000.
-
Navigate to the web directory:
cd web npm install -
Create a
.envfile in theweb/directory:VITE_API_URL=localhost:8000
-
Start the development server:
npm run dev
The web app will be available at
http://localhost:5173. -
To build for production:
npm run build npm run preview
-
Navigate to the app directory:
cd app npm install -
Configure the API host by editing app/src/redux/reducers/appConfigReducer.js:
API_IP: "192.168.x.x:8000", // Replace with your machine's IP (reachable from device/simulator)
-
Start the Metro bundler:
npm run start
Or with dev client:
expo start --dev-client
-
Run on Android:
npm run android
-
Run on iOS:
npm run ios
-
Alternatively, use Expo Go app on your phone to scan the QR code displayed by the Metro bundler.
Register a New Account:
- Navigate to the auth screen and provide name, email, password, phone, and location.
- Optionally link a FINGY device (requires serial number from device inventory).
- On successful registration, you receive an RSA public key and unique key for device authentication.
Login with Credentials:
- Enter email and password; the API returns a JWT token.
- Token is stored in
localStorage(web) or Redux (mobile) and automatically attached to subsequent requests.
Login with Fingerprint (FINGY Device):
- Scan fingerprint on the device; it generates an encrypted unique key.
- Send encrypted key and serial number to the API for decryption and token generation.
Upload Files:
- Use the upload button in the Files page (web) or home screen (mobile).
- The system validates MIME type, enforces a 200MB per-file limit, and generates thumbnails.
- Files are stored in MinIO under
userId/category/filenamepaths.
Organize Files:
- Create custom folders for organization.
- Move files between folders using the file context menu.
- Star files to mark them as favorites; view them in the Favorites section.
Preview & Download:
- Click on a file to preview its content (images, videos, PDFs, etc.).
- Use the download button to fetch files from MinIO via presigned URLs (1-hour expiry).
Recycle Bin:
- Deleted files are moved to the recycle bin (not permanently deleted for 30 days).
- Restore files by selecting them in the Recycle Bin and clicking Restore.
- Permanently delete files to free up storage quota.
Add Password:
- Navigate to Passwords and click "Add Password".
- Provide account name, username, email, password, website, and optional notes.
- The password is encrypted with AES-256-CBC before storage.
Retrieve Password:
- Click on a password entry to reveal the decrypted password (requires valid session).
- Use the copy button to quickly copy to clipboard.
Check for Breaches:
- The app integrates with Have I Been Pwned API to check if your password has appeared in known breaches.
- A warning badge indicates if a password is at risk.
POST /api/users/register– Register a new user (public)POST /api/users/login-credentials– Login with email/password (public)POST /api/users/login-fingerprint– Login with FINGY biometric (public)POST /api/users/check-token-is-valid– Validate JWT token (requires token)
All endpoints below require an Authorization: Bearer <token> header:
User Management:
GET /api/users/user-details– Fetch user profilePUT /api/users/updateuserprofile– Update profile infoPOST /api/users/setprofile– Upload profile pictureDELETE /api/users/delete– Delete account
File Operations:
POST /api/files/upload– Upload files (MIME validation, size caps)GET /api/files/list– List files by categoryGET /api/files/recent– Fetch recent filesDELETE /api/files/delete– Move files to recycle binGET /api/files/recyclebinfiles– List recycle bin itemsPOST /api/files/restorefile– Restore from recycle binDELETE /api/files/permanentdelete– Permanently delete
Folder Management:
POST /api/users/createfolder– Create a folderGET /api/users/listfolder– List user's foldersPUT /api/users/renamefolder– Rename folderDELETE /api/users/deletefolder– Delete folderPOST /api/users/addfilestofolder– Add files to folder
Password Vault:
POST /api/passwords/addpassword– Add a new passwordGET /api/passwords/getallpasswords– Fetch all passwordsGET /api/passwords/getpassword– Fetch single passwordPUT /api/passwords/updatepassword– Update passwordDELETE /api/passwords/deletepassword– Delete password
Notifications & Logs:
GET /api/users/getallnotifications– Fetch user notificationsPOST /api/users/clearnotification– Clear notificationGET /api/users/getactivitylogs– Fetch activity logs
Cause: Missing or invalid JWT token.
Solution:
- Ensure the client stores the token after login (check
localStorageon web or Redux state on mobile). - Verify the token is being sent in the
Authorization: Bearer <token>header. - Check that
JWT_SECRETin.envmatches the secret used to sign tokens.
Cause: MinIO service not running or incorrect credentials.
Solution:
- Start MinIO:
minio server ~/minio-data(or via Docker). - Verify credentials in
.env:MINIO_ACCESS_KEYandMINIO_SECRET_KEY. - Ensure the bucket exists:
mc mb local/biokey(using MinIO Client).
Cause: Mobile device cannot reach the backend host (e.g., using localhost).
Solution:
- Use your machine's local IP address (e.g.,
192.168.1.100:8000) in the app config. - Ensure both device and machine are on the same network.
- For simulators,
localhostor127.0.0.1may work; test withadb reverse(Android).
Cause: Client origin not in ALLOWED_ORIGINS.
Solution:
- Add the client's full origin (e.g.,
http://localhost:5173) toALLOWED_ORIGINSin.env. - Separate multiple origins with commas:
http://localhost:5173,http://localhost:3000.
Contributions are welcome! To contribute:
- Fork the repository on GitHub.
- Create a feature branch (
git checkout -b feature/your-feature). - Commit your changes with clear, descriptive messages.
- Push to your fork (
git push origin feature/your-feature). - Open a Pull Request with a detailed description of your changes.
- Write clear commit messages and document code changes.
- Test your changes locally before submitting a PR.
- Follow the existing code style (use ESLint/Prettier if configured).
- Report bugs by opening an Issue with reproduction steps and expected behavior.
- Suggest features via Discussions or Issues.
This project is licensed under the ISC License. See the LICENSE file for details.
- FINGY Hardware: Custom ESP32-based fingerprint scanner for biometric authentication.
- MinIO: S3-compatible object storage for secure file management.
- MongoDB: NoSQL database for user, file, and metadata storage.
- Express.js: Lightweight, flexible web framework for the backend API.
- React & Vite: Modern UI libraries and tooling for fast, responsive frontends.
- Expo & React Native: Cross-platform mobile development framework.
- Have I Been Pwned API: For password breach detection and security awareness.
- Socket.io: For real-time WebSocket communication (planned feature).
For more information, issues, or feature requests, please visit the GitHub repository.