Skip to content

qiuyang1995/PasswordManager

Repository files navigation

密码管理器 (Password Manager)

一个基于 Vue 3 + TypeScript 的本地化密码管理器 uTools 插件。

项目结构

src/
├── types/           # TypeScript 类型定义
├── services/        # 服务接口和注册器
├── stores/          # Pinia 状态管理
├── composables/     # Vue 组合式函数
├── utils/           # 工具函数
├── constants/       # 应用常量
└── test/           # 测试文件

已完成的基础设施

1. 依赖包安装

  • ✅ Pinia (状态管理)
  • ✅ TypeScript (类型安全)
  • ✅ Vitest (测试框架)
  • ✅ Vue Test Utils (Vue 组件测试)
  • ✅ fast-check (属性测试库)

2. TypeScript 配置

  • ✅ tsconfig.json 配置
  • ✅ 路径映射 (@/* 别名)
  • ✅ 严格类型检查
  • ✅ 全局类型声明

3. 核心类型定义

  • ✅ IPasswordEntry (密码条目接口)
  • ✅ IPasswordGeneratorConfig (密码生成器配置)
  • ✅ EncryptedData (加密数据结构)
  • ✅ AppConfig (应用配置)
  • ✅ 错误类型和数据库架构

4. 服务接口

  • ✅ IEncryptionService (加密服务)
  • ✅ IStorageService (存储服务)
  • ✅ IPasswordRepository (密码仓储)
  • ✅ IPasswordGenerator (密码生成器)
  • ✅ IAuthService (认证服务)
  • ✅ ISearchService (搜索服务)
  • ✅ IImportExportService (导入导出服务)

5. Pinia 状态管理

  • ✅ useAuthStore (认证状态)
  • ✅ usePasswordStore (密码条目状态)
  • ✅ useAppStore (应用状态)

6. Vue 组合式函数

  • ✅ useAuth (认证相关)
  • ✅ usePasswordEntries (密码条目管理)
  • ✅ usePasswordGenerator (密码生成器)

7. 工具函数

  • ✅ 验证工具 (validation.ts)
  • ✅ 加密工具 (crypto.ts)
  • ✅ 服务注册器 (registry.ts)

8. 测试配置

  • ✅ Vitest 配置
  • ✅ 测试环境设置
  • ✅ Mock 配置 (Web Crypto API, IndexedDB, uTools)
  • ✅ 基础测试用例

开发脚本

# 开发模式
npm run dev

# 构建项目
npm run build

# 运行测试
npm test

# 监听测试
npm run test:watch

# 类型检查
npm run type-check

下一步

基础设施已搭建完成,可以开始实现具体的服务类:

  1. 加密服务实现 (EncryptionService)
  2. 本地存储服务 (StorageService)
  3. 认证系统 (AuthService)
  4. 密码生成器 (PasswordGenerator)

每个服务都有对应的接口定义和类型约束,确保实现的一致性和类型安全。

About

一款安全、美观、易用的本地密码管理utools插件,采用零信任架构,所有数据本地加密存储,永不上传云端。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors