# midorg-com/midorg architecture

> Architecture diagram of the GitHub repository midorg-com/midorg, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/midorg-com/midorg
- Repository: https://github.com/midorg-com/midorg

## Overview

元岛 is a Uni-app community and learning mini-program backed by uniCloud functions. A typical member views course lessons, submits homework, and can later see it reviewed; staff have separate management pages. The repository also includes community discussion, teams, user accounts, and paid support. The graph captures the evidenced client-to-cloud boundary and homework-review dependencies. Many cloud functions and page relationships are known only from filenames, so their internal dispatch and data flows are not asserted.

Main entry points: [`apps/yuandao/utils/cf.js`](https://github.com/midorg-com/midorg/blob/main/apps/yuandao/utils/cf.js) (Cloud call helper), [`apps/yuandao/uniCloud-aliyun/cloudfunctions/fun/functions/checkHomework.js`](https://github.com/midorg-com/midorg/blob/main/apps/yuandao/uniCloud-aliyun/cloudfunctions/fun/functions/checkHomework.js) (Homework checker), [`apps/yuandao/pages/index/index.vue`](https://github.com/midorg-com/midorg/blob/main/apps/yuandao/pages/index/index.vue) (Home and account), [`apps/yuandao/pages/course/homework.vue`](https://github.com/midorg-com/midorg/blob/main/apps/yuandao/pages/course/homework.vue) (Homework submission)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Mini-program client"]
  node_home["Home and account<br/>[index.vue]"]
  node_user_pages["User pages"]
  node_app_shell["App shell<br/>[App.vue]"]
  node_date_format["Date formatting<br/>[date-format.js]"]
end

subgraph group_learning["Learning workflow"]
  node_course_pages["Course pages"]
  node_homework_submit["Homework submission<br/>[homework.vue]"]
  node_homework_manage["Homework review<br/>[homeworkManage.vue]"]
  node_manage_pages["Other management"]
  node_lesson_data["Lesson definitions<br/>[code.js]"]
end

subgraph group_community["Community and teams"]
  node_community_pages["Community pages"]
  node_team_pages["Team pages"]
  node_contribution["Paid support<br/>[contribution.vue]"]
end

subgraph group_backend["Cloud services"]
  node_cf["Cloud call helper<br/>[cf.js]"]
  node_fun_entry["Function entry<br/>[index.js]"]
  node_homework_check["Homework checker<br/>[checkHomework.js]"]
  node_subscribe_message["Subscribe messaging"]
  node_payment_service["Payment function<br/>[index.js]"]
end

node_member(("Member"))
node_web_examples["Static web examples"]

node_member -.->|"uses"| node_home
node_home -->|"requests user data"| node_cf
node_homework_submit -->|"submits homework"| node_cf
node_homework_manage -->|"loads and reviews"| node_cf
node_team_pages -->|"creates team form"| node_cf
node_contribution -->|"requests payment"| node_cf
node_cf -->|"calls function"| node_fun_entry
node_homework_check -->|"imports lesson data"| node_lesson_data
node_homework_check -->|"sends message"| node_subscribe_message

click node_home "https://github.com/midorg-com/midorg/blob/main/apps/yuandao/pages/index/index.vue"
click node_community_pages "https://github.com/midorg-com/midorg/tree/main/apps/yuandao/pages/community"
click node_team_pages "https://github.com/midorg-com/midorg/tree/main/apps/yuandao/pages/team"
click node_user_pages "https://github.com/midorg-com/midorg/tree/main/apps/yuandao/pages/user"
click node_course_pages "https://github.com/midorg-com/midorg/tree/main/apps/yuandao/pages/course"
click node_homework_submit "https://github.com/midorg-com/midorg/blob/main/apps/yuandao/pages/course/homework.vue"
click node_homework_manage "https://github.com/midorg-com/midorg/blob/main/apps/yuandao/pages/manage/homeworkManage.vue"
click node_manage_pages "https://github.com/midorg-com/midorg/tree/main/apps/yuandao/pages/manage"
click node_contribution "https://github.com/midorg-com/midorg/blob/main/apps/yuandao/pages/community/contribution.vue"
click node_app_shell "https://github.com/midorg-com/midorg/blob/main/apps/yuandao/App.vue"
click node_date_format "https://github.com/midorg-com/midorg/blob/main/apps/yuandao/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js"
click node_cf "https://github.com/midorg-com/midorg/blob/main/apps/yuandao/utils/cf.js"
click node_fun_entry "https://github.com/midorg-com/midorg/blob/main/apps/yuandao/uniCloud-aliyun/cloudfunctions/fun/index.js"
click node_homework_check "https://github.com/midorg-com/midorg/blob/main/apps/yuandao/uniCloud-aliyun/cloudfunctions/fun/functions/checkHomework.js"
click node_lesson_data "https://github.com/midorg-com/midorg/blob/main/apps/yuandao/uniCloud-aliyun/cloudfunctions/fun/lessons/code.js"
click node_subscribe_message "https://github.com/midorg-com/midorg/blob/main/apps/yuandao/uniCloud-aliyun/cloudfunctions/fun/utils/sendSubscribeMessage.js"
click node_payment_service "https://github.com/midorg-com/midorg/blob/main/apps/yuandao/uniCloud-aliyun/cloudfunctions/pay/index.js"
click node_web_examples "https://github.com/midorg-com/midorg/tree/main/apps/web"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_home,node_user_pages,node_app_shell,node_date_format toneBlue
class node_course_pages,node_homework_submit,node_homework_manage,node_manage_pages,node_lesson_data toneAmber
class node_community_pages,node_team_pages,node_contribution toneMint
class node_cf,node_fun_entry,node_homework_check,node_subscribe_message,node_payment_service toneRose
class node_member toneIndigo
class node_web_examples toneTeal
```

## Components

### Mini-program client

- [Home and account](https://github.com/midorg-com/midorg/blob/main/apps/yuandao/pages/index/index.vue): `apps/yuandao/pages/index/index.vue`
- [User pages](https://github.com/midorg-com/midorg/tree/main/apps/yuandao/pages/user): `apps/yuandao/pages/user`
- [App shell](https://github.com/midorg-com/midorg/blob/main/apps/yuandao/App.vue): `apps/yuandao/App.vue`
- [Date formatting](https://github.com/midorg-com/midorg/blob/main/apps/yuandao/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js): `apps/yuandao/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js`

### Learning workflow

- [Course pages](https://github.com/midorg-com/midorg/tree/main/apps/yuandao/pages/course): `apps/yuandao/pages/course`
- [Homework submission](https://github.com/midorg-com/midorg/blob/main/apps/yuandao/pages/course/homework.vue): `apps/yuandao/pages/course/homework.vue`
- [Homework review](https://github.com/midorg-com/midorg/blob/main/apps/yuandao/pages/manage/homeworkManage.vue): `apps/yuandao/pages/manage/homeworkManage.vue`
- [Other management](https://github.com/midorg-com/midorg/tree/main/apps/yuandao/pages/manage): `apps/yuandao/pages/manage`
- [Lesson definitions](https://github.com/midorg-com/midorg/blob/main/apps/yuandao/uniCloud-aliyun/cloudfunctions/fun/lessons/code.js): `apps/yuandao/uniCloud-aliyun/cloudfunctions/fun/lessons/code.js`

### Community and teams

- [Community pages](https://github.com/midorg-com/midorg/tree/main/apps/yuandao/pages/community): `apps/yuandao/pages/community`
- [Team pages](https://github.com/midorg-com/midorg/tree/main/apps/yuandao/pages/team): `apps/yuandao/pages/team`
- [Paid support](https://github.com/midorg-com/midorg/blob/main/apps/yuandao/pages/community/contribution.vue): `apps/yuandao/pages/community/contribution.vue`

### Cloud services

- [Cloud call helper](https://github.com/midorg-com/midorg/blob/main/apps/yuandao/utils/cf.js): `apps/yuandao/utils/cf.js`
- [Function entry](https://github.com/midorg-com/midorg/blob/main/apps/yuandao/uniCloud-aliyun/cloudfunctions/fun/index.js): `apps/yuandao/uniCloud-aliyun/cloudfunctions/fun/index.js`
- [Homework checker](https://github.com/midorg-com/midorg/blob/main/apps/yuandao/uniCloud-aliyun/cloudfunctions/fun/functions/checkHomework.js): `apps/yuandao/uniCloud-aliyun/cloudfunctions/fun/functions/checkHomework.js`
- [Subscribe messaging](https://github.com/midorg-com/midorg/blob/main/apps/yuandao/uniCloud-aliyun/cloudfunctions/fun/utils/sendSubscribeMessage.js): `apps/yuandao/uniCloud-aliyun/cloudfunctions/fun/utils/sendSubscribeMessage.js`
- [Payment function](https://github.com/midorg-com/midorg/blob/main/apps/yuandao/uniCloud-aliyun/cloudfunctions/pay/index.js): `apps/yuandao/uniCloud-aliyun/cloudfunctions/pay/index.js`

### Other components

- **Member**
- [Static web examples](https://github.com/midorg-com/midorg/tree/main/apps/web): `apps/web`

## Connections

- Member → Home and account: uses
- Home and account → Cloud call helper: requests user data (evidence: `apps/yuandao/pages/index/index.vue`)
- Homework submission → Cloud call helper: submits homework (evidence: `apps/yuandao/pages/course/homework.vue`)
- Homework review → Cloud call helper: loads and reviews (evidence: `apps/yuandao/pages/manage/homeworkManage.vue`)
- Team pages → Cloud call helper: creates team form (evidence: `apps/yuandao/pages/team/form.vue`)
- Paid support → Cloud call helper: requests payment (evidence: `apps/yuandao/pages/community/contribution.vue`)
- Cloud call helper → Function entry: calls function (evidence: `apps/yuandao/utils/cf.js`)
- Homework checker → Lesson definitions: imports lesson data (evidence: `apps/yuandao/uniCloud-aliyun/cloudfunctions/fun/functions/checkHomework.js`)
- Homework checker → Subscribe messaging: sends message (evidence: `apps/yuandao/uniCloud-aliyun/cloudfunctions/fun/functions/checkHomework.js`)
