Mimir is a modern, secure, and responsive Two-Factor Authentication (2FA) manager built with React Native (Expo Router + Tamagui), Zustand, TanStack Query, and Cloudflare Workers + D1. It supports web, Android, and iOS platforms.
- 🔐 RFC 6238 TOTP Engine — Pure TypeScript TOTP (SHA-1/SHA-256), Base32 decoding, live 30s countdown ring,
otpauth://URI parsing - 🛡️ Secure Local Vault — Master password verification, biometric unlock simulation, inactivity auto-lock
- 📂 Custom Categories & Providers — Create, edit, delete categories and providers with custom icons and color tags
- 🌐 Responsive UI — Adaptive layout for mobile (bottom nav, FAB) and desktop (sidebar, multi-column grid)
- 🎨 Themes — Light/Dark/System, 6 color schemes (Secure Blue, Cyber Purple, Emerald Green, Crimson Red, Sunset Amber, Midnight Titanium)
- 🌍 Internationalization — Chinese (简体中文) / English instant switching
- ☁️ Cloudflare Workers & D1 — Edge API powered by Hono with D1 database for cross-device sync
- 🔑 Multi-Account Isolation — Each user account has fully isolated data with registration and login support
- 📋 Recovery Codes — One-click copy of provider backup recovery codes
Steps:
- Click the button above to fork and deploy this project to Cloudflare Workers
- Set up a Cloudflare D1 database and update
wrangler.tomlwith your database ID - Run database migrations:
wrangler d1 execute <DB_NAME> --file=./schema.sql
# Clone the repository
git clone https://github.com/NornsInteractive/2fa-auth.git
cd 2fa-auth
# Build Docker image
docker build -t mimir-2fa .
# Run the container
docker run -d -p 8080:8080 --name mimir-2fa mimir-2faversion: '3.8'
services:
mimir:
build: .
ports:
- "8080:8080"
environment:
- NODE_ENV=production
restart: unless-stoppeddocker compose up -dVisit http://localhost:8080 after starting the container.
# Install dependencies
npm install
# Start web dev server
npm run dev
# Build web static bundle
npm run build:web# Initialize local D1 database
npm run d1:init
# Start local worker dev server
npm run worker:dev
# Deploy to Cloudflare Workers
npm run worker:deploy- Node.js 18+
- JDK 17
- Android SDK (via Android Studio or command-line tools)
- Set
ANDROID_HOMEenvironment variable
# Generate native Android project
npx expo prebuild --platform android
# Build debug APK
cd android && ./gradlew assembleDebug
# Output: android/app/build/outputs/apk/debug/app-debug.apk
# Build release APK
cd android && ./gradlew assembleRelease
# Output: android/app/build/outputs/apk/release/app-release.apk# Install EAS CLI
npm install -g eas-cli
# Login to Expo account
eas login
# Configure build
eas build:configure
# Build APK (requires Expo account)
eas build -p android --profile preview- macOS with Xcode 15+
- Apple Developer Account
- CocoaPods installed (
gem install cocoapods)
# Generate native iOS project
npx expo prebuild --platform ios
# Install CocoaPods dependencies
cd ios && pod install && cd ..
# Open in Xcode and build
open ios/mimir-2fa-auth.xcworkspaceIn Xcode:
- Select your development team in Signing & Capabilities
- Select a connected device or simulator
- Press Cmd + R to build and run
- To archive for distribution: Product → Archive
eas build -p ios --profile production| Layer | Technology |
|---|---|
| Framework | Expo + React Native Web |
| Routing | Expo Router |
| UI | Tamagui |
| State | Zustand |
| Data Fetching | TanStack Query |
| Backend | Hono on Cloudflare Workers |
| Database | Cloudflare D1 |
This project is licensed under the Apache License 2.0.
Copyright © 2026 Norns Interactive.
Mimir 是一款现代化、安全且响应式的双因素认证 (2FA) 管理器,基于 React Native (Expo Router + Tamagui)、Zustand、TanStack Query 和 Cloudflare Workers + D1 构建。支持 Web、Android 和 iOS 多平台。
- 🔐 RFC 6238 TOTP 引擎 — 纯 TypeScript 实现 TOTP (SHA-1/SHA-256),Base32 解码,实时 30 秒倒计时环,
otpauth://URI 解析 - 🛡️ 安全本地保险库 — 主密码验证、生物识别解锁模拟、不活动自动锁定
- 📂 自定义分类与提供商 — 创建、编辑、删除分类和提供商,支持自定义图标和颜色标签
- 🌐 响应式界面 — 自适应布局,移动端(底部导航、FAB)和桌面端(侧边栏、多列网格)
- 🎨 主题定制 — 浅色/深色/跟随系统,6 种配色方案(安全蓝、赛博紫、翡翠绿、绯红、日落琥珀、午夜钛)
- 🌍 国际化 — 中文(简体中文)/ 英文即时切换
- ☁️ Cloudflare Workers & D1 集成 — 基于 Hono 的边缘 API,D1 数据库支持跨设备同步
- 🔑 多账号数据隔离 — 每个用户账号数据完全隔离,支持注册和登录
- 📋 恢复码管理 — 一键复制提供商备份恢复码
步骤:
- 点击上方按钮,Fork 并部署本项目到 Cloudflare Workers
- 设置 Cloudflare D1 数据库,并在
wrangler.toml中更新数据库 ID - 执行数据库迁移:
wrangler d1 execute <DB_NAME> --file=./schema.sql
# 克隆仓库
git clone https://github.com/NornsInteractive/2fa-auth.git
cd 2fa-auth
# 构建 Docker 镜像
docker build -t mimir-2fa .
# 运行容器
docker run -d -p 8080:8080 --name mimir-2fa mimir-2faversion: '3.8'
services:
mimir:
build: .
ports:
- "8080:8080"
environment:
- NODE_ENV=production
restart: unless-stoppeddocker compose up -d启动容器后访问 http://localhost:8080。
# 安装依赖
npm install
# 启动 Web 开发服务器
npm run dev
# 构建 Web 静态包
npm run build:web# 初始化本地 D1 数据库
npm run d1:init
# 启动本地 Worker 开发服务器
npm run worker:dev
# 部署到 Cloudflare Workers
npm run worker:deploy- Node.js 18+
- JDK 17
- Android SDK(通过 Android Studio 或命令行工具)
- 设置
ANDROID_HOME环境变量
# 生成原生 Android 项目
npx expo prebuild --platform android
# 构建 Debug APK
cd android && ./gradlew assembleDebug
# 输出路径: android/app/build/outputs/apk/debug/app-debug.apk
# 构建 Release APK
cd android && ./gradlew assembleRelease
# 输出路径: android/app/build/outputs/apk/release/app-release.apk# 安装 EAS CLI
npm install -g eas-cli
# 登录 Expo 账号
eas login
# 配置构建
eas build:configure
# 构建 APK(需要 Expo 账号)
eas build -p android --profile preview- macOS 系统,安装 Xcode 15+
- Apple 开发者账号
- 安装 CocoaPods (
gem install cocoapods)
# 生成原生 iOS 项目
npx expo prebuild --platform ios
# 安装 CocoaPods 依赖
cd ios && pod install && cd ..
# 在 Xcode 中打开并构建
open ios/mimir-2fa-auth.xcworkspace在 Xcode 中:
- 在 Signing & Capabilities 中选择开发团队
- 选择已连接的设备或模拟器
- 按 Cmd + R 构建并运行
- 发布存档:Product → Archive
eas build -p ios --profile production| 层级 | 技术 |
|---|---|
| 框架 | Expo + React Native Web |
| 路由 | Expo Router |
| UI 组件 | Tamagui |
| 状态管理 | Zustand |
| 数据请求 | TanStack Query |
| 后端/边缘 | Hono on Cloudflare Workers |
| 数据库 | Cloudflare D1 |
本项目基于 Apache License 2.0 开源。
版权所有 © 2026 Norns Interactive。