# music **Repository Path**: wangwei4518/music ## Basic Information - **Project Name**: music - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-26 - **Last Updated**: 2026-03-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Music Platform - Laravel + Vue 3 前后端一体,Laravel 提供 API,Vite 打包 Vue 3 前端,同一端口服务。 ## 目录结构 ``` music-laravel/ ├── app/ # PHP 后端 │ ├── Http/Controllers/ # AuthController / SongController / ... │ ├── Models/ # User / Song / Playlist / Comment(MongoDB) │ └── Services/ # OssService / SearchService ├── resources/ │ ├── js/ # Vue 3 + TypeScript 前端源码 │ │ ├── api/ # Axios 封装(user / music / playlist / comment / search) │ │ ├── stores/ # Pinia(user / player) │ │ ├── router/ # Vue Router │ │ ├── components/ # SongCard / MiniPlayer │ │ └── views/ # Login / Discover / Search / Library / Profile / Player / PlaylistDetail │ └── views/app.blade.php # SPA 入口 Blade 模板 ├── routes/ │ ├── api.php # REST API 路由(/api/...) │ └── web.php # 捕获所有路由 → 返回 SPA ├── database/migrations/ # MySQL 建表 ├── vite.config.ts # laravel-vite-plugin └── package.json ``` ## 快速启动 ```bash # 1. PHP 依赖 composer install # 2. 前端依赖 npm install # 3. 环境配置 cp .env.example .env php artisan key:generate php artisan jwt:secret # 4. 建表(确保 MySQL 已启动) php artisan migrate # 5. 开发模式(两个终端并行) php artisan serve # 后端 → http://localhost:8000 npm run dev # 前端热更 → http://localhost:5173(Vite HMR) # 生产构建 npm run build # 打包到 public/build/ php artisan serve # 直接访问 http://localhost:8000 即可 ``` ## 中间件依赖 | 服务 | 用途 | |------|------| | MySQL 8 | 用户 / 歌曲 / 歌单 | | MongoDB | 评论 | | Redis | 热歌榜计数 | | Elasticsearch 8 + ik + pinyin | 搜索 / 补全 | | Aliyun OSS | 音频 / 封面存储 |