# 项目结构

## Yaa 项目结构如下

```
├── README.md
├── composer.json
├── package.json
├── pnpm-lock.yaml
├── postcss.config.cjs
├── public 
├── src
├── tailwind.config.cjs
├── tsconfig.json
├── tsconfig.node.json
├── ui
├── vite.config.ts
└── yii
```

## public&#x20;

该项目的静态资源文件夹、也是部署服务器的运行入口文件夹、也是vue编译打包资源所在地。

## src

Yaa项目中php主要的核心代码文件夹。

里面包含`common、config、database、modules` 四个主要文件夹。具体如下:

```
├── common                # 公共资源文件夹、
│   ├── commands          #--- yii2 中的console 编写文件夹
│   ├── mail              #--- 邮箱模块文件
│   └── models            #--- 公共资源实例模型文件夹
├── config                # 配置文件夹
│   ├── common.php        #--- 公共参数配置文件
│   ├── console.php       #--- console模式配置文件
│   ├── db.php            #--- db配置文件
│   ├── env.php           #--- .env.* 配置读取文件
│   ├── log.php           #--- log 配置文件
│   ├── mongodb.php       
│   ├── msg.php
│   └── web.php           #--- 整个web项目的配置文件
├── database
│   └── migrations        #--- migrate 生成文件所在文件夹
└── modules               # 各个模块文件夹 
    ├── ModulesConfig.php #--- 各个模块配置文件
    ├── api               #--- api 模块
    │   └── base          #--- api base接口模块
    ├── backend           #--- backend 模块
    │   ├── api           #--- backend api 模块
    │   └── web           #--- bakend web 模块
    └── website           #--- website 模块
```

主要参与项目编码地大多数集中在每个模块上。

在 Yaa 中每个模块目录下必定存在三个文件，分别是：`Module.php、ModuleBootstrap.php、Controller.php`

**因此创建一个新模块必定需要这三个文件。**

### Module.php

该文件可声明自定的url访问路径，在创建新模块的情况下，需要声明以下2个参数。

* moduleId // 模块的id
* urlPrefix  // 模块的url访问路径

### ModuleBootstrap.php

新建该文件后继承 `umono\multiple\modules\AbstractModuleBootstrap`

### Controller.php

需要该模块是因为该模块需要自定的主要公共控制器，便于各个模块之间的管理。

### ModulesConfig.php

该文件用于配置各个模块的启动，所以需要将建立的新模块对应数据填入该文件中。

## ui

编写前端代码vue的集中地，相关配置在根目录。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yaa.docs.speaks.life/ji-chu/xiang-mu-jie-gou.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
