an generator that generate Express rest-api app based on jsonSchema and openApi
doing same things once is good,
twice is okay, third times is wasting life.
all you need is define the JsonSchema
and openApi
spec
- create JsonSchmea, can refer to output/jsonSchema put it as cli config file
-
npm i -g very-express
install package globally -
vex -h
this cmd create the cli config file -
vex
call cli with vex.config.json setting npm i
npm build
npm run start
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"
}
- [ ] 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
- 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