PHPackages                             shaoyikai/api-doc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. shaoyikai/api-doc

ActiveProject[API Development](/categories/api)

shaoyikai/api-doc
=================

An excellent api document generator

v1.0.2(8y ago)191BSD-3-ClausePHPPHP &gt;=5.4.0

Since Aug 22Pushed 7y agoCompare

[ Source](https://github.com/shaoyikai/api-doc)[ Packagist](https://packagist.org/packages/shaoyikai/api-doc)[ Docs](https://github.com/shaoyikai/api-doc)[ RSS](/packages/shaoyikai-api-doc/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (10)Versions (5)Used By (0)

API 文档生成器
=========

[](#api-文档生成器)

[![Latest Stable Version](https://camo.githubusercontent.com/ac6192f40c625c8524eb42003a49b6a09c87b8d31ec4d2466531c7b17a2b43b3/68747470733a2f2f706f7365722e707567782e6f72672f7368616f79696b61692f6170692d646f632f762f737461626c652e706e67)](https://packagist.org/packages/shaoyikai/api-doc)[![Total Downloads](https://camo.githubusercontent.com/58b314752a010e3d3309b511e4c0751ef7e485ca283a3a010c3ccacafec7da1a/68747470733a2f2f706f7365722e707567782e6f72672f7368616f79696b61692f6170692d646f632f646f776e6c6f6164732e706e67)](https://packagist.org/packages/shaoyikai/api-doc)[![License](https://camo.githubusercontent.com/9381444e374e52ccddd660d7b0f8f25c5ebe8c803984c965b8120708ed21c808/68747470733a2f2f706f7365722e707567782e6f72672f7368616f79696b61692f6170692d646f632f6c6963656e73652e706e67)](https://packagist.org/packages/shaoyikai/api-doc)

随着现代应用越来越复杂，前后分离也变得越来越流行。

为什么呢？

因为分离之后，前后端可以更加专注地去做各自更擅长的事情。 前端：专心地去编写UI设计的漂亮界面和交互，功能上只需要调用后台开发好的一个个API即可； 后端：专注于应用的处理逻辑编写，数据库的设计等，最终把输入和输出封装成一个个清晰的API供前端人员调用。 前后端需求有变更的时候，各自不会互相影响，非常有利于后期的维护。

可是，前后端配合得愉快吗？……

前后分离很好，可是为什么很多开发人员，还是被沟通搞得焦头烂额了呢？ 我觉得主要是因为没有一个清晰的接口文档，更准确的说，是没有一个“及时更新的”“清晰的”接口文档！

so，本程序旨在方便快捷的编写api文档，同时提供一些有用的工具，让编写api文档成为一件轻松惬意的工作！

先睹为快
----

[](#先睹为快)

[![项目列表](./web/images/projectlist.png "项目列表")](./web/images/projectlist.png)[![接口列表](./web/images/apilist.png "接口列表")](./web/images/apilist.png)[![新建接口](./web/images/apicreate.png "新建接口")](./web/images/apicreate.png)

目录结构
----

[](#目录结构)

项目采用PHP框架yii2 framework，目录结构如下：

```
  assets/
  commands/
  config/
  controllers/
  mail/
  models/
  runtime/
  tests/
  vendor/
  views/
  web/

```

安装说明
----

[](#安装说明)

- 该程序运行所需要的PHP版本为 5.5以上，因为5.4以下的composer会报错。
- 如果尚未安装composer插件`composer-asset-plugin`，您需要执行`composer global require "fxp/composer-asset-plugin:~1.1.1"`进行安装
- 执行安装命令：`composer create-project shaoyikai/api-doc`
- 创建数据库api-doc，字符集选择utf-8，配置数据库config/db.php
- 在根目录执行命令：`php yii migrate` ，选择yes。（需将php添加到系统环境变量）
- 配置虚拟主机（如：`http://demo.api-doc.com`）到 /web/ 目录下面。

配置数据库参考
-------

[](#配置数据库参考)

编辑文件 `config/db.php`：

```
return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=localhost;dbname=api-doc',
    'username' => 'root',
    'password' => '1234', // 根据自己的环境填写
    'charset' => 'utf8',
];
```

Apache虚拟主机配置参考
--------------

[](#apache虚拟主机配置参考)

```

    ServerAdmin someone@example.com
    DocumentRoot "C:/www/api-doc/web"
    ServerName demo.api-doc.com
    ErrorLog "logs/api-doc.com-error.log"
    CustomLog "logs/api-doc.com-access.log" common

		AllowOverride all
		Require all granted

```

**注意：** 数据库需要手动创建

待开发功能
-----

[](#待开发功能)

[功能列表](todoTask.md)

License
-------

[](#license)

api-doc is released under the BSD License. See the bundled [LICENSE](LICENSE.md) for details.

###  Health Score

27

—

LowBetter than 46% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 97.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

3278d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5046267?v=4)[yikai.shao](/maintainers/shaoyikai)[@shaoyikai](https://github.com/shaoyikai)

---

Top Contributors

[![shaoyikai](https://avatars.githubusercontent.com/u/5046267?v=4)](https://github.com/shaoyikai "shaoyikai (69 commits)")[![hanjingjing](https://avatars.githubusercontent.com/u/8133624?v=4)](https://github.com/hanjingjing "hanjingjing (2 commits)")

---

Tags

project templateapi-doc

### Embed Badge

![Health badge](/badges/shaoyikai-api-doc/health.svg)

```
[![Health](https://phpackages.com/badges/shaoyikai-api-doc/health.svg)](https://phpackages.com/packages/shaoyikai-api-doc)
```

###  Alternatives

[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13926.0k66](/packages/skeeks-cms)[craftcms/cms

Craft CMS

3.6k3.7M3.4k](/packages/craftcms-cms)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k441.1k8](/packages/theodo-group-llphant)[kimai/kimai

Kimai - Time Tracking

4.8k9.4k1](/packages/kimai-kimai)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

762297.9k53](/packages/civicrm-civicrm-core)[abydahana/aksara

Aksara is a modern, developer-friendly framework and CMS built on CodeIgniter 4, featuring rapid CRUD development, modular architecture, smart routing, flexible access control, API integration, and an AI assistant to make content management faster and smarter.

1141.2k](/packages/abydahana-aksara)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
