Professional-grade bulk 2FA workspace built with Next.js
- 🚀 Quick Mode - Stateless single-code generator for one-off usage
- 🔐 Encrypted Vault - PBKDF2 + AES-256-GCM with per-user salt
- 🔄 Batch TOTP Engine - RFC 6238 compliant generator
- 📎 Clipboard Workflows - Copy individual or whole batches
- 🧳 Backup & Restore - Export/import encrypted vault snapshots with one click
- 🔍 Search & Filter - Quickly find accounts in your vault
- 🎯 Auto-Refresh - All codes update in real-time every second
- 🌍 Multi-language - English (default) and Chinese support
- 🎨 Modern UI - Built with shadcn/ui and Tailwind CSS
- ⚡ Local-First - All encryption happens in your browser
- 📦 Lightweight - Only 167 KB total bundle size
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: shadcn/ui
- Internationalization: next-intl
- Crypto: Web Crypto API
- Storage: localStorage (encrypted)
- Node.js 20+
- A modern browser (Chrome/Safari/Firefox ≥ 2023)
# Clone the repository
git clone <repository-url>
cd 2fa
# Install dependencies
npm install
# Run development server
npm run devVisit http://localhost:3000 to see the app.
| Command | Description |
|---|---|
npm run dev |
Start development server with Turbopack |
npm run build |
Build for production |
npm start |
Start production server |
npm run lint |
Run ESLint |
The app uses next-intl with a "clean URL" approach:
- English (Default):
//quick/vault - Chinese:
/zh/zh/quick/zh/vault
The default language has no prefix, while other languages use a prefix.
- Create translation file:
locales/ja.json - Update
middleware.ts:locales: ['en', 'zh', 'ja']
- Update
i18n.tswith the same locale list - Translate all keys from
locales/en.json
- Navigate to
/quick - Enter your Base32 TOTP secret
- Click "Generate Code"
- Copy the code (updates every 30 seconds)
- Navigate to
/vault - Create or unlock your vault with a master password (8+ characters)
- Add accounts manually or import from CSV
- Copy codes individually or in bulk
- Backup your encrypted vault
- Lock the vault when done
- ✅ Client-side encryption only (AES-256-GCM)
- ✅ PBKDF2 with 600,000 iterations
- ✅ No server-side secrets storage
- ✅ Master password never leaves your browser
- ✅ Encrypted data stored in localStorage
- ✅ No analytics or tracking
/
├── app/
│ ├── [locale]/ # Internationalized pages
│ │ ├── layout.tsx # Root layout with i18n
│ │ ├── page.tsx # Home page
│ │ ├── quick/ # Quick Mode
│ │ └── vault/ # Vault Manager
│ └── globals.css
├── components/
│ ├── ui/ # shadcn/ui components
│ └── ... # Custom components
├── lib/
│ ├── core/ # Core functionality
│ │ ├── base32.ts # Base32 codec
│ │ ├── totp.ts # TOTP generator
│ │ ├── crypto.ts # Encryption
│ │ └── vault.ts # Vault service
│ └── utils.ts
├── locales/
│ ├── en.json # English translations
│ └── zh.json # Chinese translations
├── middleware.ts # next-intl routing
├── i18n.ts # i18n config
└── next.config.ts
# Run tests (to be implemented)
npm test
# Run type checking
npx tsc --noEmitThis application is configured for static export and deploys to Cloudflare Pages.
Quick Deploy via Dashboard:
- Push code to GitHub
- Connect repository in Cloudflare Pages
- Configure:
- Build command:
npm run build - Build output directory:
out
- Build command:
- Deploy
Manual Deploy via Wrangler:
# Install Wrangler CLI
npm install -g wrangler
# Authenticate
wrangler login
# Build the app
npm run build
# Deploy
wrangler pages deploy outGitHub Actions (Automated):
The project includes automatic deployment via GitHub Actions. Set up secrets:
CLOUDFLARE_API_TOKENCLOUDFLARE_ACCOUNT_ID
See CLOUDFLARE_DEPLOY.md for detailed instructions.
The app exports to static HTML in the out/ directory. Deploy to:
- Vercel
- Netlify
- GitHub Pages
- Any static hosting service
# Build
npm run build
# The 'out/' directory contains all static filesContributions are welcome! Please read the IMPLEMENTATION.md for development guidelines.
MIT License - see LICENSE for details.
- Original project: 2fa2fa
- UI components: shadcn/ui
- Icons: Lucide Icons
- Framework: Next.js
For issues and questions:
- Open an issue on GitHub
- Check IMPLEMENTATION.md for technical details
- Review Cloudflare deployment guide
Built with ❤️ using Next.js and TypeScript