app-template/app/docs/guide/quick-start.md

76 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 快速上手
目标:几分钟内跑起来,登录进去看到界面。
## 你需要什么
- Node.js 22 以上
- Yarn 4(用 Corepack 打开就行)
- 不用装数据库软件,默认用本地 SQLite 文件
## 四步跑起来
### 1. 装依赖
```bash
corepack enable
yarn install
```
### 2. 准备配置
```bash
cp .env.example .env
```
本地开发一般不用改什么。`TURSO_DATABASE_URL` 默认就是 `file:local.db`,数据存在当前目录。
如果要挂网盘,还需要一个密钥(用来加密你保存的网盘密码):
```bash
openssl rand -hex 32
```
把结果填进 `.env` 的 `MEDIA_SECRET_KEY`。
### 3. 建库、建管理员
```bash
yarn db:push
yarn db:seed
```
`db:seed` 会建一个管理员:**admin / admin123**。上线前记得改密码。
### 4. 启动
```bash
yarn dev:web
```
打开 `http://localhost:4321`,走中文入口在 `/zh-CN`,英文在 `/en`。
登录后你应该能看到这些页面:
- **媒体库**:你的片子
- **浏览**:网盘里的文件夹
- **挂载**:管理网盘连接
- **弹幕**:弹幕开关和样式
- **播放**:点开视频后的页面
## 接下来干什么
1. [把网盘挂上来](/guide/mount)
2. [找个视频播一下](/guide/browse)
3. 想要整齐的片单就[扫进媒体库](/guide/library)
## 常用命令
| 命令 | 干什么 |
|------|--------|
| `yarn dev:web` | 开发模式跑主应用(4321 端口) |
| `yarn build:web` | 打包主应用 |
| `yarn docs:dev` | 本地预览这份文档 |
| `yarn typecheck` | 检查类型 |
| `yarn lint` | 检查代码风格 |