addon.doc.home / Sample manual

Architecture

Overview

MVC on ThinkPHP 8 multi-app: admin / index / api / common (plus optional apps such as store).

Tree

addons/
app/{admin,api,common,index,…}
config/          # includes yetuadmin.php
public/assets/{css,js,libs,vendor}
public/index.php
runtime/ vendor/ think

Static assets ship under public/assets; PHP deps via Composer.

Apps

  • admin — back office
  • index — site + member center
  • api — App / mini-program / public APIs
  • common — shared libraries (not web-facing)

Typical feature files

app/admin/controller/Example.php
app/admin/model/Example.php
app/admin/view/example/index.html

UI strings → yt_lang. Addons → addons/{name}/.

Versioning

Keep three concerns separate:

  • Product SemVer — config/yetuadmin.php → yetuadmin.version (e.g. 5.0.1). Used for upgrades, store faversion, and “System version” in admin.
  • Asset cache stamp — DB key asset_version (aliased to site.version for legacy JS/templates). Updated automatically on wipe-cache / System config save; hidden from System config UI (not the product version).
  • App client force-update — not in core. Install the App Version addon and call /addons/appversion/api/check.

Do not treat the editable/legacy “Version” field as the framework release number. After git pull, product version comes from git; asset stamps and DB may still differ per environment until you wipe cache or save System config.

Core tables

Core table COMMENT values are English by default. CRUD / generators read them from information_schema. Prefer the same for addon-owned tables so generated titles stay language-neutral. Do not put market-region framing in comments.

TablePurpose
yt_adminAdmin accounts
yt_admin_logAdmin operation log
yt_auth_groupAdmin groups
yt_auth_group_accessAdmin group access
yt_auth_ruleAuth rules / menu nodes
yt_configSystem config
yt_attachmentAttachments
yt_lang / yt_lang_listLanguage strings / languages
yt_content_langContent translations
yt_user / yt_user_group / yt_user_ruleMembers / groups / rules
yt_user_token / yt_user_thirdMember tokens / third-party bindings
yt_user_money_log / yt_user_score_logMoney / score ledgers
yt_sms / yt_emsSMS / email verification codes
yt_region / yt_currencyRegions / currencies
yt_addon_configAddon config