very-express
v0.3.6
Published
based on json schema and openapi, generate Express RestApi server with mongoDb
Downloads
707
Readme
VeryExpress
an generator that generate Express rest-api app based on jsonSchema and openApi
Idea
doing same things once is good,
twice is okay, third times is wasting life.
all you need is define the JsonSchema
and openApi
spec
Quick Start
- create JsonSchmea, can refer to output/jsonSchema put it as cli config file
npm i -g very-express
install package globallyvex -h
this cmd create the cli config filevex
call cli with vex.config.json settingnpm i
npm build
npm run start
JsonSchmea Setup
at the root of schema :
| Fields | Description |
| - | - |
| documentName | name of collection or table, also used at Model
. |
| interfaceName | used at endpoint and naming Class
, Interface
, Files
. |
| methods | available method of rest api. |
"x-documentConfig": {
"documentName": "user",
"interfaceName": "User",
"methods": [
"get",
"post",
"put",
"patch",
"delete"
]
}
at the properites :
"userContact":{
"type": "string",
"format": "uuid",
"required": false,
"x-foreignKey": "usercontact"
}
Road Map
- [ ] dockernize
- [x] generate express app
- [x] gen. openapi based on json schema
- [x] gen. controllers based on openapi
- [x] CRUD + Search api
- [ ] database
- [x] mongodb
- [ ] sql
- [ ] db encrtption PDPA
- [ ] oauth2
- [ ] microsoft
- [ ] github
- [ ] Role Base Access Control
Enhancement To Do
- Implement data encryption & hash (PDPA)
- at JsonSchmea fields, add attribute
x-dataSecure: "method"
while accessing data, perform encryption based on method selected.
- at JsonSchmea fields, add attribute