UNPKG

8 kBMarkdownView Raw
1# Rekit portal
2
3Rekit portal is a new dev tool shipped with Rekit 2.0. It's a central place to manage and analyze your Rekit project. Rekit portal itself is also created with Rekit, so it's also a good real-world example of Rekit for reference.
4
5[![Version](http://img.shields.io/npm/v/rekit-portal.svg)](https://www.npmjs.org/package/rekit-portal)
6[![Build Status](https://travis-ci.org/supnate/rekit-portal.svg?branch=master)](https://travis-ci.org/supnate/rekit-portal)
7[![Dependency Status](https://david-dm.org/supnate/rekit-portal.svg?style=flat-square)](https://david-dm.org/supnate/rekit-portal)
8[![Demo](https://img.shields.io/badge/demo-link-blue.svg)](https://rekit-portal.herokuapp.com)
9[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
10
11To have a quick view on how Rekit portal works, you can look at the [live demo](https://rekit-portal.herokuapp.com).
12
13### Key features
14
151. Provide a more intuitive way to create, rename, move or delete features, components or actions than CLI. Just like you always create a Java class using an IDE like eclipse.
162. Generate diagram reports of the project architecture by source code. So that new team members, or yourself several months later could learn the project easier.
173. Easy to run tests of a single component or action by just right click on it.
184. Run build without opening a terminal.
195. Integrated test coverage report.
20
21### Installation
22You don't need to install Rekit portal manually. When a new Rekit app is created, the `rekit-portal` is auto dependent as a npm module. You should be able to access Rekit portal at [http://localhost:6076](http://localhost:6076) by default.
23
24### Project explorer
25The project explorer provides a more meaningful view of the project folder structure by grouping source files by `features`, `actions`, `components`. You can easily see the functionality structure rather than just folder structure. You can see it at the left side of Rekit portal:
26
27<img src="/images/portal-project-explorer.png" width="300" alt="project-explorer" />
28
29Besides displaying the project structure, it also provides context menus to manage project elements like component.
30
31### Dashboard
32The dashboard provides an overall status view of the project such as overview diagram, test coverage etc.
33
34<img src="/images/portal-dashboard.png" width="700" alt="dashboard" />
35
36### Overview diagram
37The most notible part of the dashboard is the overview diagram. It's an intuitive view about the architecture of a Rekit project. It's also interactive, you can mouse move to different features, components, actions to see the relationship of some specific element. You can also click a node to deep dive into it. Below information is covered by the overview diagram:
38
391. Relationship between modules.
402. The relative size of features.
413. How a feature is composed.
42
43When mouseover an element, the diagram will highlight the current element and the relationship which is only about the current element.
44
45Ideally, there should be no circular-dependecies among features. So that they are pluggable and easier to understand. But in real projects you need to balance the architecture and development efficiency. So it's acceptable if there are light-weight circular-dependencies between features while a principle is to avoid too many such dependencies. You can delay the refactor of removing dependencies when some type of dependencies become too complicated.
46
47Here is a list about what different colors and lines mean:
48
49<table>
50 <tbody>
51 <tr>
52 <td style="vertical-align: middle; text-align: center; width: 140px;"><img src="/images/overview-diagram-feature.png" width="110" alt="color-feature"/></td>
53 <td>Features.</td>
54 </tr>
55 <tr>
56 <td style="vertical-align: middle; text-align: center; width: 140px;"><img src="/images/overview-diagram-action.png" width="110" alt="color-action"/></td>
57 <td>Actions.</td>
58 </tr>
59 <tr>
60 <td style="vertical-align: middle; text-align: center; width: 140px;"><img src="/images/overview-diagram-component.png" width="110" alt="color-component"/></td>
61 <td>Components.</td>
62 </tr>
63 <tr>
64 <td style="vertical-align: middle; text-align: center; width: 140px;"><img src="/images/overview-diagram-misc.png" width="110" alt="color-misc"/></td>
65 <td>Misc files.</td>
66 </tr>
67 <tr>
68 <td style="vertical-align: middle; text-align: center; width: 140px;"><img src="/images/overview-diagram-dep1.png" width="110" alt="color-dep-on"/></td>
69 <td>A module depends on others.</td>
70 </tr>
71 <tr>
72 <td style="vertical-align: middle; text-align: center; width: 140px;"><img src="/images/overview-diagram-dep2.png" width="110" alt="color-dep-by"/></td>
73 <td>A module is dependent by others.</td>
74 </tr>
75 <tr>
76 <td style="vertical-align: middle; text-align: center; width: 140px;"><img src="/images/overview-diagram-dep3.png" width="110" alt="color-dep-internal"/></td>
77 <td>A module depends on others in the same feature.</td>
78 </tr>
79 </tbody>
80</table>
81
82### Element diagram
83While the overview diagram shows the overall architecture of the project, the element diagram provides a focused view of the relationship between the selected element and others. It helps to understand a module quickly, and helps to find out over-complicated modules.
84
85When you click an element from the project explorer or the overview diagram, it will show the element diagram by default:
86
87<img src="/images/element-diagram.png" width="550" alt="element-diagram" />
88
89### Test coverage
90Rekit uses [istanbul](https://github.com/gotwarlost/istanbul) to generate test coverage report.
91After running all tests against the project, the test coverage will be available.
92Running a single test or tests of a folder does not generate coverage report.
93Note that if some tests failed, the report data may be incomplete.
94
95You can see the overall test coverage report from dashboard or the original report generated by [istanbul-nyc](https://github.com/istanbuljs/nyc) from the test coverage detail page.
96
97### Manage project elements
98Rekit portal wraps command line tools into UI dialogs, with which you can intuitively create, rename or delete components, actions etc. To open a dialog, right click an element in the project exploer and click the corresponding menu item.
99
100<img src="/images/cmd-dialogs.png" width="700" alt="cmd-dialogs" />
101
102### Run build
103Rekit portal executes the build script `tools/build.js` under your project when click the menu item `Build`. It reads the webpack build progress data to update the progress bar. Though `build.js` created by Rekit looks a bit complex but you can update it per your requirement after you fully understand how it works.
104
105<img src="/images/portal-build.png" width="550" alt="build" />
106
107
108### Run tests
109Rekit portal executes the test script `tools/run_test.js` under your project when click the menu item `Run tests`. The script accepts the argument which tests to run, it could be one single file or a folder. When no argument provides, it runs all tests under `tests` folder, and generates test coverage report. See more in [command line tools](/docs/cli.md) page.
110
111So when click `Run test` menu item on a project element like component, it just executes `tools/run_test.js` behind and pass the current component test file as the argument to the script. You can also update `run_test.js` script on your requirement.
112
113<img src="/images/portal-test.png" width="550" alt="test" />
114
115### Code viewer
116It helps to quickly view the source code of the project. For example, when select an component, by default it shows the diagram view, but you can switch to the code view where you can view the source code of the component. And you could also easily view the style code or test file. For now Rekit hasn't support editing code directly because it doesn't intend to replace your favorite text editors.
117
118<img src="/images/element-page.png" width="700" alt="element-page" />
119