A secure, local-first API Token manager for developers.
一个安全、本地的 API Token 管理工具,专为开发者打造。
- 🔐 End-to-End Encryption: AES-256-GCM encryption, tokens always stored encrypted in database
- 🎯 Master Password: bcrypt hashing + salt, password never stored in database
- 📋 One-Click Copy: Tokens hidden by default, decrypt on click or copy
- 🏷️ Tag System: Support for Prod, Test, CI/CD tags for quick filtering
- 🔍 Real-time Search: Fuzzy search by platform, purpose, or tags
- ⏰ Expiration Alerts: Automatic email reminders 7 days before token expiration
- 🌙 Dark Mode: Full light/dark theme support with auto-detection
- 💾 Local Storage: SQLite database, lightweight and easy to backup
- 💻 CLI Tool:
1token get <platform>to quickly retrieve and copy tokens
| Category | Technology | Description |
|---|---|---|
| Frontend/Backend | Next.js 15 (App Router) | Full-stack framework with Server Actions |
| UI Components | Shadcn UI + Tailwind CSS | Modern, minimalist design |
| Database | SQLite (via Prisma ORM) | Local-first, lightweight, easy backup |
| Encryption | Node.js crypto (AES-256-GCM) |
End-to-end encryption |
| Task Scheduling | node-cron | Local scheduled tasks |
| Email Service | Resend API | Clean email sending service |
- Node.js 18+
- pnpm 8+
# Clone the repository
git clone https://github.com/AiKiAi-stack/1Token.git
cd 1Token
# Install dependencies
pnpm install
# Generate Prisma client
pnpm db:generate
# Push database schema
pnpm db:push
# Start development server
pnpm devOpen your browser and visit http://localhost:3000
pnpm dev # Start development server
pnpm build # Build for production
pnpm start # Start production server
pnpm lint # Run linter
pnpm db:generate # Generate Prisma client
pnpm db:push # Push database schema
pnpm db:studio # Open Prisma Studio
pnpm cli:build # Build CLI tool
pnpm cli:dev # Run CLI in development mode# Get token for a platform and copy to clipboard
pnpm cli:dev get github
pnpm cli:dev get "AWS"
pnpm cli:dev get pypi
# List all tokens
pnpm cli:dev list
pnpm cli:dev ls
# Show help
pnpm cli:dev help# Build CLI
pnpm cli:build
# Use compiled CLI
./cli/dist/index.js get github| Platform | Tool | Installation |
|---|---|---|
| macOS | pbcopy | Built-in |
| Linux | xclip / xsel | sudo apt install xclip |
| Windows | clip | Built-in |
-
Token Storage:
- User enters token plaintext
- Master Password derives key (PBKDF2 + scrypt)
- AES-256-GCM encryption, stored as Base64 ciphertext
- Encryption parameters (iv, authTag, salt) stored with ciphertext
-
Token Decryption:
- User enters Master Password
- Re-derive key using stored salt
- Decrypt in memory, never write to disk
- Clear from clipboard after copy
- Master Password Not Stored: Only bcrypt hash stored, derived key in Session
- Frontend Masking: Tokens show
********by default, decrypt on click/copy - Server-Side Encryption: Tokens encrypted before storage, decrypted in memory only
- Session Expiry: Destroy derived key on logout or session expiration
- Log Sanitization: Never log any token plaintext
1token/
├── app/ # Next.js App Router
│ ├── api/ # API routes
│ ├── dashboard/ # Main dashboard
│ ├── login/ # Login page
│ └── layout.tsx # Root layout
├── cli/ # CLI command-line tool
│ ├── dist/ # Compiled output
│ ├── index.ts # CLI entry point
│ └── tsconfig.json # CLI TypeScript config
├── components/ # React components
│ ├── ui/ # Shadcn UI components
│ ├── token/ # Token-related components
│ └── layout/ # Layout components
├── lib/ # Utility functions
│ ├── crypto.ts # Encryption/Decryption
│ ├── auth.ts # Authentication logic
│ └── db.ts # Prisma client
├── prisma/ # Database
│ ├── schema.prisma # Schema definition
│ └── dev.db # SQLite database
├── scripts/ # Scripts
│ └── expiry-reminder.ts # Expiration reminder task
└── tests/ # Test files
Contributions are welcome! Please follow the standard workflow:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
git clone https://github.com/AiKiAi-stack/1Token.git
cd 1Token
pnpm install
pnpm db:generate
pnpm db:push
pnpm dev- Use Prettier for code formatting
- Follow ESLint rules
- Write meaningful commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by AiKiAi-stack