Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add chinese version's readme #10

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions README.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Beryllium

build epub reader for self hosted

## features

- easy to deploy, and you own all of your data
- desktop and mobile support
- dark mode
- bookmark and highlight support
- multi-user support

## how to use

if you want to build from source, see `how to develop` below.

generally, you should use [docker image](https://hub.docker.com/r/lee88688/beryllium) directly. here is the example of docker compose config.

```yaml
version: "3"
services:
beryllium:
image: lee88688/beryllium
ports:
- 3000:3000
environment:
# this env should be add, do not add quote to password string
# this is used for startup. when admin user is created, this is no longer need.
- ADMIN_USER_PASSWORD=some-password
# the default admin user name is admin,
# if you want to rename, please uncomment this line
# - ADMIN_USER_NAME=some-other-name
volumes:
- /path/to/data:/app/data
```

`/app/data/db.sqlite` stores the database, and `/app/data/asar` stores the upload epub files.

### NOTE

the epub file uploaded from the user will be transformed into the asar file format. the asar file is just like tar file which combine the extracted files inside epub into one. so you should keep you epub files if you want to reuse them later. and there is a way to convert asar file to epub.

## how to development

- create `.env` file, like `.env.example`
- prisma
- `npx prisma db push`, push schema to db
- `npx prisma db seed`, seed db

This is a [T3 Stack](https://create.t3.gg/) project bootstrapped with `create-t3-app`.

## What's next? How do I make an app with this?

We try to keep this project as simple as possible, so you can start with just the scaffolding we set up for you, and add additional things later when they become necessary.

If you are not familiar with the different technologies used in this project, please refer to the respective docs. If you still are in the wind, please join our [Discord](https://t3.gg/discord) and ask for help.

- [Next.js](https://nextjs.org)
- [NextAuth.js](https://next-auth.js.org)
- [Prisma](https://prisma.io)
- [Tailwind CSS](https://tailwindcss.com)
- [tRPC](https://trpc.io)

## Learn More

To learn more about the [T3 Stack](https://create.t3.gg/), take a look at the following resources:

- [Documentation](https://create.t3.gg/)
- [Learn the T3 Stack](https://create.t3.gg/en/faq#what-learning-resources-are-currently-available) — Check out these awesome tutorials

You can check out the [create-t3-app GitHub repository](https://github.com/t3-oss/create-t3-app) — your feedback and contributions are welcome!

## How do I deploy this?

Follow our deployment guides for [Vercel](https://create.t3.gg/en/deployment/vercel), [Netlify](https://create.t3.gg/en/deployment/netlify) and [Docker](https://create.t3.gg/en/deployment/docker) for more information.
39 changes: 21 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# Beryllium

build epub reader for self hosted
专注于自部署的在线epub阅读器

## features
[English Version](./README.en.md)

- easy to deploy, and you own all of your data
- desktop and mobile support
- dark mode
- bookmark and highlight support
- multi-user support
## 特性

## how to use
- 易于部署,只需要一个docker镜像就完成
- 同时支持桌面端和移动端web页面
- 暗黑模式
- 支持书签和内容标记
- 支持多用户

if you want to build from source, see `how to develop` below.
## 如何使用

generally, you should use [docker image](https://hub.docker.com/r/lee88688/beryllium) directly. here is the example of docker compose config.
如果你想要从源码构建,请参考`如何开发`。

通常情况下,你只需要使用[docker镜像](https://hub.docker.com/r/lee88688/beryllium),下面是docker compose配置示例,docker cli参数也可以参考下方的配置。

```yaml
version: "3"
Expand All @@ -24,22 +26,23 @@ services:
ports:
- 3000:3000
environment:
# this env should be add, do not add quote to password string
# 这个环境变量是必须添加的,不要在密码两侧添加引号
# 在首次创建的时候使用,在数据库中存在admin账户后不再使用
- ADMIN_USER_PASSWORD=some-password
# the default admin user name is admin,
# if you want to rename, please uncomment this line
# - ADMIN_USER_NAME="admin"
# 默认的admin账户名称为 admin,
# 如果你想要修改admin账户的名称可以参考下面的配置
# - ADMIN_USER_NAME=some-other-name
volumes:
- /path/to/data:/app/data
```

`/app/data/db.sqlite` stores the database, and `/app/data/asar` stores the upload epub files.
`/app/data/db.sqlite` 是数据库的路径, `/app/data/asar` 用于存储电子书的路径。

### NOTE
### 注意

the epub file uploaded from the user will be transformed into the asar file format. the asar file is just like tar file which combine the extracted files inside epub into one. so you should keep you epub files if you want to reuse them later. and there is a way to convert asar file to epub.
epub文件在上传后会被转换成asar文件格式,asar文件与tar文件类似存储的是epub文件解压之后的文件。如果你想要后续再使用上传的epub文件,那就不要删除epub文件。epub文件是无法再从服务器上在此下载的。

## how to development
## 如何开发

- create `.env` file, like `.env.example`
- prisma
Expand Down
4 changes: 2 additions & 2 deletions src/pages/bookshelf/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default function Bookshelf(props: BookshelfProps) {
};

const handleSelectFile = async (file: File) => {
const snackbarId = enqueueSnackbar("upload file, please wait.", {
const snackbarId = enqueueSnackbar("正在上传文件,请不进行其他操作", {
variant: "success",
persist: true,
});
Expand All @@ -141,7 +141,7 @@ export default function Bookshelf(props: BookshelfProps) {
params: { categoryId: number; bookId: number }[],
) => {
await apiAddBooksToCategory(params);
enqueueSnackbar("add successful", { variant: "success" });
enqueueSnackbar("添加成功", { variant: "success" });
await categoryQuery.refetch();
};

Expand Down