Files
NoteAI/README.md
T
2026-02-24 11:33:08 +08:00

36 lines
805 B
Markdown
Raw 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.
# NoteAI
基于 Next.js + Prisma + TipTap 的本地知识笔记应用。
## 环境变量
在项目根目录创建 `.env`
```env
DATABASE_URL="file:./dev.db"
SESSION_SECRET="replace-with-a-long-random-secret"
INIT_DEFAULT_PASSWORD="replace-with-initial-password"
# Optional: if set, /api/settings/init requires header x-init-token
INIT_SETUP_TOKEN="replace-with-one-time-init-token"
```
- `SESSION_SECRET` 必填,用于服务端签名登录会话。
- 生产环境请使用长度至少 32 的随机字符串。
- `INIT_DEFAULT_PASSWORD` 用于首次初始化密码(`/api/settings/init`)。
- 建议在生产环境设置 `INIT_SETUP_TOKEN`,避免未授权初始化。
## 开发
```bash
npm run dev
```
默认端口为 `3001`
## 代码检查
```bash
npx tsc --noEmit
npm run lint
```