chore: update README

This commit is contained in:
Ou 2024-11-04 21:49:42 +08:00
parent b2fb996a37
commit ab65852fc7
2 changed files with 17 additions and 20 deletions

View File

@ -7,6 +7,11 @@ English | [简体中文](README.zh-CN.md)
***Elegant reading of real-time and hottest news*** ***Elegant reading of real-time and hottest news***
## Features
- Elegant design for a pleasant reading experience, keeping you up-to-date with the latest and hottest news.
- Supports Github login and data synchronization.
- Default cache duration is 30 minutes. Logged-in users can force fetch the latest data. However, the scraping interval is adjusted based on the update frequency of the content sources (as fast as every two minutes) to save resources and prevent frequent scraping that could lead to IP bans.
## Deployment ## Deployment
If login and caching are not required, you can directly deploy to platforms like Cloudflare Pages or Vercel. Just fork the repository and import it into the respective platform. If login and caching are not required, you can directly deploy to platforms like Cloudflare Pages or Vercel. Just fork the repository and import it into the respective platform.
@ -26,6 +31,8 @@ G_CLIENT_SECRET=
JWT_SECRET= JWT_SECRET=
# Initialize database, must be set to true on first run, can be turned off afterward # Initialize database, must be set to true on first run, can be turned off afterward
INIT_TABLE=true INIT_TABLE=true
# Whether to enable cache
ENABLE_CACHE=true
``` ```
This project primarily supports deployment on Cloudflare Pages and Docker. For Vercel, you need to set up your own database. Supported databases can be found at https://db0.unjs.io/connectors . This project primarily supports deployment on Cloudflare Pages and Docker. For Vercel, you need to set up your own database. Supported databases can be found at https://db0.unjs.io/connectors .
@ -34,16 +41,6 @@ The Cloudflare D1 database can be used for free. To set it up, go to the Cloudfl
If you don't have a `wrangler.toml` file, you can rename `example.wrangler.toml` to `wrangler.toml` and modify it with your configuration. The changes will take effect on your next deployment. If you don't have a `wrangler.toml` file, you can rename `example.wrangler.toml` to `wrangler.toml` and modify it with your configuration. The changes will take effect on your next deployment.
If you receive an error indicating that the database is empty during deployment, you can create a table arbitrarily. The first execution will automatically initialize the required tables. Alternatively, you can use the following SQL statement to create a Cache Table:
```sql
CREATE TABLE IF NOT EXISTS cache (
id TEXT PRIMARY KEY,
updated INTEGER,
data TEXT
);
```
For Docker deployment. In the project root directory with `docker-compose.yml`, run For Docker deployment. In the project root directory with `docker-compose.yml`, run
```sh ```sh
@ -61,7 +58,7 @@ pnpm i
pnpm dev pnpm dev
``` ```
If you want to add data sources, refer to the `shared/metadata`, `shared/sources`, and `server/sources` directories. The project has complete types and a simple structure; feel free to explore. If you want to add data sources, refer to the `shared/sources`, and `server/sources` directories. The project has complete types and a simple structure; feel free to explore.
## License ## License

View File

@ -8,6 +8,11 @@
***优雅地阅读实时热门新闻*** ***优雅地阅读实时热门新闻***
## 特性
- 优雅的设计,优雅的阅读体验,时刻关注最新最热的新闻。
- 支持 Github 登录,支持数据同步。
- 默认 30 分钟缓存,登录用户可以强制拉取最新数据。但也会根据内容源的更新间隔设置不同的爬虫间隔时间(最快两分钟),节约资源的同时避免频繁爬取而导致 IP 封禁。
## 部署 ## 部署
如果不需要登录,缓存,可以直接部署到 Cloudflare PagesVercel 等。Fork 之后在对应平台上导入即可。 如果不需要登录,缓存,可以直接部署到 Cloudflare PagesVercel 等。Fork 之后在对应平台上导入即可。
@ -27,18 +32,13 @@ G_CLIENT_SECRET=
JWT_SECRET= JWT_SECRET=
# 初始化数据库, 首次运行必须设置为 true之后可以将其关闭 # 初始化数据库, 首次运行必须设置为 true之后可以将其关闭
INIT_TABLE=true INIT_TABLE=true
# 是否启用缓存
ENABLE_CACHE=true
``` ```
本项目主推 Cloudflare Pages 以及 Docker 部署, Vercel 需要你自行搞定数据库,其他支持的数据库可以查看 https://db0.unjs.io/connectors 。 本项目主推 Cloudflare Pages 以及 Docker 部署, Vercel 需要你自行搞定数据库,其他支持的数据库可以查看 https://db0.unjs.io/connectors 。
Cloudflare D1 数据库可以免费使用,在 Cloudflare Worker 控制面板里找到 D1 手动创建数据库,将 `database_id` 以及 `database_name` 填入 `wrangler.toml` 对应位置即可。没有 `wrangler.toml` 文件,可以把 `example.wrangler.toml` 重命名为 `wrangler.toml`, 将其修改为自己的配置,下次部署时就可以生效了。如果部署时,提示数据库里为空,可以随意创建一个表,第一次执行会自动初始化所需的表,也可以用下列语句创建 Cache Table Cloudflare D1 数据库可以免费使用,在 Cloudflare Worker 控制面板里找到 D1 手动创建数据库,将 `database_id` 以及 `database_name` 填入 `wrangler.toml` 对应位置即可。没有 `wrangler.toml` 文件,可以把 `example.wrangler.toml` 重命名为 `wrangler.toml`, 将其修改为自己的配置,下次部署时就可以生效了。
```sql
CREATE TABLE IF NOT EXISTS cache (
id TEXT PRIMARY KEY,
updated INTEGER,
data TEXT
);
```
对于 Docker 部署,只需要项目根目录 `docker-compose.yaml` 文件,同一目录下执行 对于 Docker 部署,只需要项目根目录 `docker-compose.yaml` 文件,同一目录下执行
``` ```
@ -55,7 +55,7 @@ pnpm i
pnpm dev pnpm dev
``` ```
你可能想要添加数据源,请关注 `shared/metadata` `shared/sources` `server/sources`,项目类型完备,结构简单,请自行探索。 你可能想要添加数据源,请关注 `shared/sources` `server/sources`,项目类型完备,结构简单,请自行探索。
## License ## License