mappjzc commented on code in PR #308:
URL: 
https://github.com/apache/incubator-devlake-website/pull/308#discussion_r1011625533


##########
docs/DeveloperManuals/Project.md:
##########
@@ -0,0 +1,226 @@
+---
+title: "Project"
+sidebar_position: 5
+description: >
+  `Project` is **a set of scopes from different domains**, a way to group 
different resources, and it is crucial for some metric calculation like `DORA`.
+---
+
+## Summary
+`Project` is **a set of scopes from different domains**, a way to group 
different resources, and it is crucial for some metric calculation like `DORA`.
+
+It contains the following two models:
+ - `projects` describes a project object, including its name, creation and 
update time and other basic information
+ - `project_metrics` describes the mapping relationship enabled by a plugin, 
including the name of the project and plugin on both sides of the mapping, and 
basic information about plugin options.
+
+![image](project_table.jpg)
+
+## projects
+
+|   **field**   | **type** | **length** | **description**               | 
**key** |
+| ------------- | -------- | ---------- | ----------------------------- | 
------- |
+| `name`        | varchar  | 255        | name for project              | PK   
   |
+| `description` | longtext |            | description of the project    |      
   |
+| `created_at`  | datetime | 3          | created time of project       |      
   |
+| `updated_at`  | datetime | 3          | last updated time of project  |      
   | 
+
+
+| **name**  | **describe**                         | **created_at**          | 
**updated_at**          |
+| --------- | ------------------------------------ | ----------------------- | 
------------------------|
+| project_1 | this is one of the test projects     | 2022-11-01 01:22:13.000 | 
2022-11-01 02:24:15.000 |
+| project_2 | this is another project test project | 2022-11-01 01:23:29.000 | 
2022-11-01 02:27:24.000 |
+
+## project_metrics
+
+|    **field**    | **type** | **length** | **description**                    
                        | **key** |
+| --------------- | -------- | ---------- | 
---------------------------------------------------------- | ------- |
+| `project_name`  | varchar  | 255        | name for project                   
                        | PK      |
+| `plugin_name`   | varchar  | 255        | name for plugin                    
                        | PK      |
+| `plugin_option` | longtext |            | check if metric plugins have been 
enabled by the project   |         |
+| `enable`        | tinyint  | 1          | if the metric plugins is enabled   
                        |         |
+
+
+| **project_name** | **plugin_name** | **plugin_option** | **enable** |
+| ---------------- | --------------- | ----------------- | ---------- |
+| project_1        | gitlab          | {}                | true       |
+| project_2        | gitlab          | {}                | false      |
+| project_2        | github          | {}                | true       |
+
+## project_mapping
+
+|   **field**    | **type** | **length** | **description**                     
                       | **key** |
+| -------------- | -------- | ---------- | 
---------------------------------------------------------- | ------- |
+| `project_name` | varchar  | 255        | name for project                    
                       | PK      |
+| `scope_id`     | bigint   | 255        | the scope id  by project mapping    
                       | PK      |
+
+
+| **project_name** | **scope_id** |
+| ---------------- | ------------ |
+| project_1        | 1            |
+| project_1        | 2            |
+| project_2        | 1            |
+
+
+It requires each plugin to implement an interface named `PluginMetric`
+
+# 如何使用 Project
+
+1. 首先我们可以通过 `POST` `/project` 接口来创建一个全新的 `project` 对象,该对象需要一个 
`project_name`字段,作为其名称,该名称唯一。
+
+当我们创建出 `project` 对象之后:
+
+- 我们可以通过 `GET` `/project` 接口来获取具体的的某一个 
`project`的信息,除了名称外,这些信息里也包含了project的更新时间和创建时间。

Review Comment:
   we have define /projects api



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to