mirror of
https://github.com/remvze/moodist.git
synced 2025-12-18 17:34:17 +00:00
🌲 Ambient sounds for focus and calm.
## 🎯 核心功能重构 ### 音乐列表显示优化 - **自动展示**: 登录用户页面打开时自动显示音乐列表,无需手动展开 - **权限控制**: 未登录用户完全隐藏"我的音乐"部分 - **独立展开**: 每个音乐项配备独立的展开/收起按钮 - **渐进展示**: 点击展开按钮显示音乐收录的声音详情 ### JWT认证系统完整实现 - **安全升级**: 完全替代密码传输,实现JWT令牌认证 - **自动管理**: 登录时自动生成和存储JWT令牌 - **API集成**: 所有音乐相关API统一使用JWT认证 - **容错机制**: 多层级token获取策略确保认证稳定性 ## 🔧 技术架构升级 ### 新增核心模块 - `src/lib/jwt.ts` - JWT令牌创建与验证核心 - `src/lib/jwt-auth-middleware.ts` - JWT认证中间件 - `src/lib/api-client.ts` - 自动JWT令牌注入的API客户端 - `src/hooks/useNotification.ts` - 统一通知系统 ### 组件化重构 - `src/components/buttons/save-music/` - 音乐保存按钮组件 - `src/components/buttons/delete-music/` - 音乐删除按钮组件 - `src/components/notification/` - 通知组件系统 ### API安全强化 - 所有认证相关API集成JWT中间件 - 用户注册/登录自动返回JWT令牌 - 音乐CRUD操作统一JWT认证验证 ## 🎨 用户体验优化 ### 交互流程简化 - 登录即见:音乐列表自动展示,减少用户操作步骤 - 按需展开:声音详情按需显示,避免信息过载 - 状态持久:JWT令牌自动管理,无需重复登录 ### 视觉层次优化 - 音乐名称与展开按钮并排布局,提升操作便利性 - 声音列表折叠显示,保持界面整洁 - 统一通知样式,确保视觉一致性 ## 🛡️ 安全性提升 - **零密码传输**: API请求完全移除明文密码传输 - **令牌过期**: JWT令牌7天自动过期机制 - **状态隔离**: 认证状态与业务状态完全分离 版本: v2.7.0 技术栈: React + TypeScript + Astro + SQLite + JWT |
||
|---|---|---|
| .github/workflows | ||
| .husky | ||
| .serena | ||
| .spec-workflow | ||
| .storybook | ||
| .vscode | ||
| assets | ||
| data | ||
| docker/nginx | ||
| public | ||
| scripts | ||
| src | ||
| .commitlintrc.json | ||
| .czrc | ||
| .dockerignore | ||
| .editorconfig | ||
| .eslintignore | ||
| .eslintrc.json | ||
| .gitignore | ||
| .lintstagedrc.json | ||
| .npmrc | ||
| .prettierignore | ||
| .prettierrc.json | ||
| .stylelintignore | ||
| .stylelintrc.json | ||
| .versionrc.json | ||
| astro.config.mjs | ||
| CHANGELOG.md | ||
| CONTRIBUTING.md | ||
| docker-compose.dev.yml | ||
| docker-compose.optimized.yml | ||
| docker-compose.yml | ||
| DOCKER_DEPLOY.md | ||
| Dockerfile | ||
| Dockerfile.multiplatform | ||
| Dockerfile.optimized | ||
| Dockerfile.simple | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.cjs | ||
| README.en.md | ||
| README.md | ||
| README.zh-CN.md | ||
| test-jwt.js | ||
| tsconfig.json | ||
| users.db | ||
| vitest.config.ts | ||
🌍 Language / 语言
Table of Contents
Features
- 🎵 Over 75 ambient sounds.
- 📝 Persistent sound selection.
- ✈️ Sharing sound selections with others.
- 🧰 Custom sound presets.
- 🌙 Sleep timer for sounds.
- 📓 Notepad for quick notes.
- 🍅 Pomodoro timer.
- ✅ Simple to-do list (soon).
- ⏯️ Media controls.
- ⌨️ Keyboard shortcuts for everything.
- 🥷 Privacy focused: no data collection.
- 💰 Completely free, open-source, and self-hostable.
Tools
- ⚡ TypeScript: Programming Language
- 🔨 React: UI Library
- 🧑🚀 Astro: Meta Framework
- 🎨 CSS Modules: Styling
- 🐻 Zustand: State Management
- 🎭 Framer Motion: Animation Library
- ⚙️ Radix: Accessible Components
- 📕 Storybook: Component Documentation
- 🧪 Vitest: Unit Testing (soon)
- 🔭 Playwright: End-To-End Testing (soon)
- 🔍 ESLint: Code Linting
- 🧹 Prettier: Code Formatting
- 🧼 Stylelint: CSS Linting
- 🐶 Husky: Git Hooks
- 📝 Lint Staged: Running Linters on Staged Files
- 🧽 Commitlint: Git Commit Linting
- 🧭 Commitizen: Git Commit Message Helper
- 📓 Standard Version: Versioning and CHANGLOG Generation
- 🧰 PostCSS: CSS Transformations
Commands
npm run dev: run development servernpm run build: build for productionnpm run preview: preview the built appnpm run lint: lint files using ESLintnpm run lint:fix: lint and fix using ESLintnpm run lint:style: lint styles using Stylelintnpm run lint:style:fix: lint and fix styles using Stylelintnpm run format: format files using Prettiernpm run commit: commit message using Commitizennpm run release:major: release major versionnpm run release:minor: release minor versionnpm run release:patch: release patch versionnpm run storybook: run Storybook
Contributing
🚧 Please check CONTRIBUTING.md file.
Support Moodist
⭐ Give a star if you liked this project.
☕ Buy Me a Coffee to help me maintain Moodist.
License
This project is licensed under the MIT License - see the LICENSE file for details.
⚠️ Third-Party Assets
Some sounds used in this project are sourced from third-party providers and are subject to different licenses:
- Sounds licensed under the Pixabay Content License: Pixabay Content License
- Sounds licensed under CC0: Creative Commons Zero License