'init'
This commit is contained in:
196
README.md
196
README.md
@@ -1,92 +1,174 @@
|
||||
# nomadlms
|
||||
# 🌍 LMS - 轻量级课程落地页与学习系统
|
||||
|
||||
一个基于 Next.js 的课程落地页与视频学习系统,支持配置化课程、学习进度、支付对接、PWA 等。开箱即用,适合知识付费、在线课程、培训等场景。
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
## Getting started
|
||||
## ✨ 功能特性
|
||||
|
||||
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
||||
### 课程展示
|
||||
- **落地页**:Hero、受众、收益、课程大纲、导师、FAQ、CTA
|
||||
- **课程大纲**:模块折叠、全文搜索、收藏标记、完成状态
|
||||
- **试看机制**:前 2 节免费试看,可配置
|
||||
|
||||
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)!
|
||||
### 学习体验
|
||||
- **继续学习**:记住上次观看章节,一键续播
|
||||
- **学习进度**:完成度展示、进度条
|
||||
- **视频播放**:续播提示、倍速、全屏、观看进度自动保存
|
||||
- **收藏/书签**:章节收藏,便于回看
|
||||
- **课程证书**:完成全部课程后可查看证书
|
||||
|
||||
## 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:
|
||||
### 支付与接入
|
||||
- **支付对接**:支持第三方支付(如 ZPay 等),可扩展
|
||||
- **支付状态**:本地模拟 / 服务端校验,可配置
|
||||
|
||||
### 其他
|
||||
- **PWA**:manifest.json,支持添加到主屏
|
||||
- **深色模式**:跟随系统主题切换
|
||||
- **响应式**:适配桌面与移动端
|
||||
|
||||
---
|
||||
|
||||
## 🛠 技术栈
|
||||
|
||||
| 类别 | 技术 |
|
||||
|------|------|
|
||||
| 框架 | Next.js 16 (App Router)、React 19 |
|
||||
| 语言 | TypeScript 5 |
|
||||
| 样式 | Tailwind CSS 4、animate.css |
|
||||
| 动画 | Framer Motion、tsParticles |
|
||||
| 文档 | react-markdown、remark-gfm、rehype-highlight |
|
||||
| 其他 | highlight.js、github-markdown-css |
|
||||
|
||||
### 核心依赖
|
||||
|
||||
- **framer-motion**:滚动入场、组件动画
|
||||
- **@tsparticles/react**:粒子背景效果
|
||||
- **animate.css**:Hero 入场动画
|
||||
- **react-markdown**:课程配套文档 Markdown 渲染
|
||||
|
||||
---
|
||||
|
||||
## 📁 项目结构
|
||||
|
||||
```
|
||||
cd existing_repo
|
||||
git remote add origin http://gitlab.yidooplanet.com/gitlab-instance-0a899031/nomadlms.git
|
||||
git branch -M main
|
||||
git push -uf origin main
|
||||
lms/
|
||||
├── app/
|
||||
│ ├── api/ # API 路由
|
||||
│ │ ├── pay/ # 支付相关
|
||||
│ │ └── pay/status/ # 支付状态
|
||||
│ ├── certificate/ # 证书页
|
||||
│ ├── course/[module]/[lesson]/ # 课程详情页
|
||||
│ ├── pay/ # 支付页
|
||||
│ ├── components/ # 组件
|
||||
│ │ ├── custom/ # 自实现封装(无依赖可选)
|
||||
│ │ └── sections/ # 区块组件
|
||||
│ ├── lib/ # 业务逻辑
|
||||
│ │ ├── learning.ts # 学习进度、收藏、笔记
|
||||
│ │ └── payment.ts # 支付状态
|
||||
│ └── providers/ # 主题等 Provider
|
||||
├── config/
|
||||
│ ├── course.ts # 课程落地页配置
|
||||
│ └── lessons.ts # 章节详情
|
||||
├── public/
|
||||
│ └── manifest.json # PWA Manifest
|
||||
└── ...
|
||||
```
|
||||
|
||||
## Integrate with your tools
|
||||
---
|
||||
|
||||
- [ ] [Set up project integrations](http://gitlab.yidooplanet.com/gitlab-instance-0a899031/nomadlms/-/settings/integrations)
|
||||
## 🚀 快速开始
|
||||
|
||||
## Collaborate with your team
|
||||
### 环境要求
|
||||
|
||||
- [ ] [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)
|
||||
- Node.js 18+
|
||||
- pnpm / npm / yarn
|
||||
|
||||
## Test and Deploy
|
||||
### 安装
|
||||
|
||||
Use the built-in continuous integration in GitLab.
|
||||
```bash
|
||||
# 使用 pnpm(推荐)
|
||||
pnpm install
|
||||
|
||||
- [ ] [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)
|
||||
# 或 npm
|
||||
npm install
|
||||
|
||||
***
|
||||
# 或 yarn
|
||||
yarn install
|
||||
```
|
||||
|
||||
# Editing this README
|
||||
### 开发
|
||||
|
||||
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.
|
||||
```bash
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
## 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.
|
||||
访问 [http://localhost:3000](http://localhost:3000)
|
||||
|
||||
## 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.
|
||||
```bash
|
||||
# 构建
|
||||
pnpm build
|
||||
|
||||
## 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.
|
||||
# 启动生产服务
|
||||
pnpm start
|
||||
```
|
||||
|
||||
## 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.
|
||||
### 课程配置 `config/course.ts`
|
||||
|
||||
## 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.
|
||||
| 配置项 | 说明 |
|
||||
|--------|------|
|
||||
| `SITE_CONFIG` | 站点名称、Footer 等 |
|
||||
| `HERO_CONFIG` | 标题、副标题、数据卡片 |
|
||||
| `CURRICULUM_CONFIG` | 课程模块与章节 |
|
||||
| `AUDIENCE_CONFIG` | 受众说明 |
|
||||
| `BENEFITS_CONFIG` | 学完收益 |
|
||||
| `INSTRUCTORS_CONFIG` | 导师信息 |
|
||||
| `FAQ_CONFIG` | 常见问题 |
|
||||
| `COMMUNITY_CONFIG` | 社群入口、二维码 URL |
|
||||
| `DOWNLOAD_CONFIG` | 网盘下载模块 |
|
||||
|
||||
## Roadmap
|
||||
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
||||
### 章节配置 `config/lessons.ts`
|
||||
|
||||
## Contributing
|
||||
State if you are open to contributions and what your requirements are for accepting them.
|
||||
- 视频 URL、Markdown 文档
|
||||
- 按 `moduleIndex`、`lessonIndex` 映射
|
||||
|
||||
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.
|
||||
- 支付逻辑在 `app/lib/payment.ts`,通过 `localStorage` 的 `pay` 键判断是否已支付
|
||||
- 测试时可手动设置:`localStorage.setItem('pay', 'ok')` 模拟已报名
|
||||
|
||||
## 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.
|
||||
1. **配置驱动**:课程内容、落地页、FAQ、社群等均通过配置修改,无需改组件
|
||||
2. **轻量学习逻辑**:进度、收藏、笔记、证书基于 localStorage,无后端即可运行
|
||||
3. **动画体验**:使用 Framer Motion、tsParticles、animate.css 等库,提供流畅动效
|
||||
4. **自实现可选**:`app/components/custom/` 提供无依赖的粒子与滚动动画实现,可替换第三方库
|
||||
5. **PWA 支持**:可安装到主屏,支持离线访问
|
||||
|
||||
---
|
||||
|
||||
## 📄 许可证
|
||||
|
||||
MIT
|
||||
|
||||
---
|
||||
|
||||
## 🤝 贡献
|
||||
|
||||
欢迎提交 Issue 和 Pull Request。
|
||||
|
||||
Reference in New Issue
Block a user