'更新readme'
This commit is contained in:
162
README.md
162
README.md
@@ -1,92 +1,118 @@
|
||||
# digital
|
||||
# Digital Nomad Guide | 数字游民指南
|
||||
|
||||
开源免费的数字游民资源平台,支持多主题切换、国际化、电子书、课程、加入申请与支付等能力。
|
||||
|
||||
## 功能特性
|
||||
|
||||
## Getting started
|
||||
- **多主题**:内置数字游民、一人公司、TikTok 运营、独立开发等主题,可快速克隆扩展
|
||||
- **国际化**:中英双语,基于 next-intl 的 i18n 方案
|
||||
- **7 天路线图**:首页展示数字游民入门路径,支持按天查看详情
|
||||
- **工具导航**:按主题加载工具分类与链接
|
||||
- **电子书**:Markdown 电子书阅读,支持目录、懒加载、阅读进度
|
||||
- **课程页**:视频课程大纲、学习进度、讲师介绍
|
||||
- **加入申请**:表单提交 + PocketBase 存储 + 支付(Z-Pay / XorPay)
|
||||
- **暗色模式**:跟随系统或手动切换
|
||||
|
||||
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
||||
## 技术栈
|
||||
|
||||
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
||||
- **框架**:Next.js 16、React 19
|
||||
- **样式**:Tailwind CSS 4
|
||||
- **国际化**:next-intl
|
||||
- **后端服务**:PocketBase(用户/申请)、MinIO(文件存储)、自建支付 API
|
||||
|
||||
## Add your files
|
||||
## 快速开始
|
||||
|
||||
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
|
||||
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
|
||||
### 环境要求
|
||||
|
||||
```
|
||||
cd existing_repo
|
||||
git remote add origin http://gitlab.yidooplanet.com/gitlab-instance-0a899031/digital.git
|
||||
git branch -M main
|
||||
git push -uf origin main
|
||||
- Node.js 20+
|
||||
- pnpm(推荐)
|
||||
|
||||
### 安装与运行
|
||||
|
||||
```bash
|
||||
# 安装依赖
|
||||
pnpm install
|
||||
|
||||
# 开发模式
|
||||
pnpm dev
|
||||
|
||||
# 构建
|
||||
pnpm build
|
||||
|
||||
# 生产运行
|
||||
pnpm start
|
||||
```
|
||||
|
||||
## Integrate with your tools
|
||||
开发模式下访问 `http://localhost:3000`(或终端显示的端口)。
|
||||
|
||||
- [ ] [Set up project integrations](http://gitlab.yidooplanet.com/gitlab-instance-0a899031/digital/-/settings/integrations)
|
||||
### 环境变量(可选)
|
||||
|
||||
## Collaborate with your team
|
||||
创建 `.env.local` 覆盖默认配置:
|
||||
|
||||
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
||||
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
||||
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
||||
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
||||
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
||||
| 变量名 | 说明 | 默认值 |
|
||||
|--------|------|--------|
|
||||
| `NEXT_PUBLIC_THEME` | 当前主题 | `digital-nomad` |
|
||||
| `NEXT_PUBLIC_POCKETBASE_URL` | PocketBase 地址 | `https://pocketbase.hackrobot.cn` |
|
||||
| `POCKETBASE_JOIN_COLLECTION` | 申请集合名 | `solan` |
|
||||
| `PAYMENT_API_URL` | 支付 API 地址 | 开发 `127.0.0.1:8700`,生产 `https://api.hackrobot.cn` |
|
||||
| `PAYMENT_PROVIDER` | 支付提供商 | `zpay` |
|
||||
| `MINIO_ENDPOINT` | MinIO 端点 | `minioweb.hackrobot.cn` |
|
||||
| `MINIO_BUCKET` | 存储桶 | `hackrobot` |
|
||||
| `NEXT_PUBLIC_SITE_URL` | 站点根地址(支付回跳等) | 开发 `http://localhost:3001` |
|
||||
| `NEXT_PUBLIC_SHOP_URL` | 电商独立站链接 | `https://store.hackrobot.cn/` |
|
||||
|
||||
## Test and Deploy
|
||||
## 项目结构
|
||||
|
||||
Use the built-in continuous integration in GitLab.
|
||||
```
|
||||
├── app/
|
||||
│ ├── [locale]/ # 多语言路由 (zh, en)
|
||||
│ │ ├── page.tsx # 首页
|
||||
│ │ ├── about/ # 关于我们
|
||||
│ │ ├── course/ # 课程页
|
||||
│ │ ├── ebook/ # 电子书
|
||||
│ │ ├── join/ # 加入申请
|
||||
│ │ ├── jobs/ # 招聘
|
||||
│ │ └── day/[id]/ # 路线图每日详情
|
||||
│ ├── api/ # API 路由
|
||||
│ │ ├── join/ # 申请提交
|
||||
│ │ ├── pay/ # 支付
|
||||
│ │ └── upload-media/ # 媒体上传
|
||||
│ ├── components/ # 公共组件
|
||||
│ ├── context/ # React Context
|
||||
│ ├── data/ # 静态数据(如 ebook.md)
|
||||
│ └── lib/ # 工具与配置
|
||||
├── config/
|
||||
│ ├── site.config.ts # 主题配置
|
||||
│ └── services.config.ts # 服务配置(PocketBase、支付、MinIO)
|
||||
├── content/themes/ # 主题内容
|
||||
│ └── digital-nomad/
|
||||
│ ├── messages/ # 文案 (zh.json, en.json)
|
||||
│ └── data/ # 工具等数据
|
||||
└── i18n/ # 国际化路由
|
||||
```
|
||||
|
||||
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
|
||||
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
||||
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
||||
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
||||
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
||||
## 主题配置
|
||||
|
||||
***
|
||||
切换主题:设置 `NEXT_PUBLIC_THEME` 或修改 `config/site.config.ts` 中的 `CURRENT_THEME`。
|
||||
|
||||
# Editing this README
|
||||
内置主题:`digital-nomad` | `solo-company` | `tiktok-ops` | `indie-dev`。
|
||||
|
||||
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
||||
新增主题步骤:
|
||||
|
||||
## Suggestions for a good README
|
||||
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
||||
1. 在 `config/site.config.ts` 的 `THEME_CONFIGS` 中添加配置
|
||||
2. 在 `content/themes/[theme-id]/` 下添加 `messages` 和 `data`
|
||||
3. 在 `app/lib/theme-data.ts` 的 switch 中添加对应 case
|
||||
|
||||
## Name
|
||||
Choose a self-explaining name for your project.
|
||||
## 脚本
|
||||
|
||||
## Description
|
||||
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
||||
| 命令 | 说明 |
|
||||
|------|------|
|
||||
| `pnpm dev` | 启动开发服务器 |
|
||||
| `pnpm build` | 构建生产版本 |
|
||||
| `pnpm start` | 启动生产服务器 |
|
||||
| `pnpm lint` | 运行 ESLint |
|
||||
|
||||
## Badges
|
||||
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
||||
## 开源与致谢
|
||||
|
||||
## Visuals
|
||||
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
||||
|
||||
## Installation
|
||||
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
||||
|
||||
## Usage
|
||||
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
||||
|
||||
## Support
|
||||
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
||||
|
||||
## Roadmap
|
||||
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
||||
|
||||
## Contributing
|
||||
State if you are open to contributions and what your requirements are for accepting them.
|
||||
|
||||
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
||||
|
||||
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
||||
|
||||
## Authors and acknowledgment
|
||||
Show your appreciation to those who have contributed to the project.
|
||||
|
||||
## License
|
||||
For open source projects, say how it is licensed.
|
||||
|
||||
## Project status
|
||||
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
||||
- 电子书样式参考 [nomadbook](https://www.hackrobot.cn/book)
|
||||
- 使用 [next-intl](https://next-intl-docs.vercel.app/) 实现国际化
|
||||
|
||||
Reference in New Issue
Block a user