very-express 0.4.3 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,76 +1,52 @@
1
1
  # VeryExpress
2
- an generator that generate [Express](https://github.com/expressjs/express) rest-api app based on [jsonSchema](https://github.com/json-schema-org) and [openApi](https://github.com/OAI)
3
-
4
- ## Idea
5
- doing same things once is good,
6
- twice is okay, third times is wasting life.
7
-
8
- all you need is define the `JsonSchema` and `openApi` spec
9
-
2
+ this is a generator to make [Express](https://github.com/expressjs/express) REST API app based on [Json Schema](https://github.com/json-schema-org) and [Open Api](https://github.com/OAI)
3
+
4
+
5
+ ## Why?
6
+ bored on writing CRUD API time after time ?
7
+ then this tool might save your time,
8
+ all you need is define the **Json Schema** files.
9
+
10
+
10
11
  # Quick Start
11
- 1. create JsonSchmea, can refer to output/jsonSchema put it as cli config file
12
- 2. `npm i -g very-express`
13
- install package globally
14
- 3. `vex -h`
15
- this cmd create the cli config file
16
- 4. `vex `
17
- call cli with vex.config.json setting
18
- 5. `npm i`
19
- 6. `npm build`
20
- 7. `npm run start`
21
-
22
- ## JsonSchmea Setup
23
- at the root of schema :
24
-
25
- | Fields | Description |
26
- | - | - |
27
- | documentName | name of **collection** or **table**, also used at `Model`. |
28
- | interfaceName | used at endpoint and naming `Class`, `Interface`, `Files`. |
29
- | methods | available method of rest api. |
30
-
31
-
32
- "x-documentConfig": {
33
- "documentName": "user",
34
- "interfaceName": "User",
35
- "methods": [
36
- "get",
37
- "post",
38
- "put",
39
- "patch",
40
- "delete"
41
- ]
42
- }
43
-
44
- at the properites :
45
-
46
- "userContact":{
47
- "type": "string",
48
- "format": "uuid",
49
- "required": false,
50
- "x-foreignKey": "usercontact"
51
- }
52
-
53
-
54
-
55
- ## Road Map
56
- - [ ] dockernize
57
- - [x] generate express app
58
- - [x] gen. openapi based on json schema
59
- - [x] gen. controllers based on openapi
60
- - [x] CRUD + Search api
61
- - [ ] database
62
- - [x] mongodb
63
- - [ ] sql
64
- - [ ] db encrtption [PDPA](https://en.wikipedia.org/wiki/Personal_Data_Protection_Act_2012)
65
- - [ ] oauth2
66
- - [ ] google
67
- - [ ] microsoft
68
- - [ ] github
69
- - [ ] Role Base Access Control
70
-
71
- ## Enhancement To Do
72
-
73
- - Implement data encryption & hash (PDPA)
74
- - at JsonSchmea fields, add attribute
75
- `x-dataSecure: "method"` while accessing data, perform encryption based on method selected.
76
-
12
+ 1. install package globally.
13
+ ```npm i -g very-express```
14
+
15
+ 3. use cli to initialize configuration file **vex.config.json** under your project root directory.
16
+ `vex -init`
17
+
18
+ 2. create a empty directory name it as value of vex.config's "jsonSchemaDir", default **jsonSchema**.
19
+ `mkdir jsonSchema`.
20
+
21
+ 4. generate the app with vex.config param.
22
+ `vex`
23
+
24
+ 5. you should saw a express typescript app being generated (with src, package.json etc) .
25
+ ```
26
+ ├── jsonSchema/
27
+ │ └── ...
28
+ ├── src/
29
+ │ └── ...
30
+ ├── package.json
31
+ ├── tsconfig.json
32
+ ├── vex.config.json
33
+ └── .env
34
+ ```
35
+
36
+ 6. you could create your db collection/table now in directory **jsonSchema/** just created,
37
+ refer to [Define Json Schmea](./docs/defineJsonSchema.md).
38
+
39
+ 7. start the generated express app.
40
+ ```
41
+ npm i
42
+ npm build
43
+ npm run start
44
+ ```
45
+
46
+
47
+ # Resource
48
+ - [Documents](./docs/)
49
+ - [Road Map](./docs/roadMap/)
50
+ - [ReleaseNote](./docs/releaseNote)
51
+
52
+ - [Discord](https://discord.gg/PZGMzDp7)