very-express 0.6.11-alpha → 0.6.12-alpha
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/.github/copilot-instructions.md +2 -2
- package/README.md +46 -68
- package/dist/index.js +239 -239
- package/dist/templates/_utils/index.ts +0 -2
- package/docs/CONTRIBUTING.md +38 -0
- package/docs/ForeignKey.md +4 -4
- package/docs/roadMap/futurePlan.md +1 -2
- package/docs/roadMap/released.md +4 -22
- package/docs/vexJsonSchema.md +139 -37
- package/package.json +1 -1
- package/dist/templates/_utils/common.ts +0 -140
|
@@ -59,7 +59,7 @@ Every generator exports an async `compile(options)` that:
|
|
|
59
59
|
Custom `x-*` properties drive generation — see [docs/vexJsonSchema.md](../docs/vexJsonSchema.md):
|
|
60
60
|
|
|
61
61
|
- `x-documentConfig` — REST methods, document name
|
|
62
|
-
- `x-foreignKey`
|
|
62
|
+
- `x-foreignKey` — relationships ([docs/ForeignKey.md](../docs/ForeignKey.md))
|
|
63
63
|
- `x-vexData: "role"` — marks role field for RBAC
|
|
64
64
|
- `x-format: "ObjectId"` — MongoDB ObjectId handling
|
|
65
65
|
|
|
@@ -70,7 +70,7 @@ Custom `x-*` properties drive generation — see [docs/vexJsonSchema.md](../docs
|
|
|
70
70
|
## Key docs (link, don't duplicate)
|
|
71
71
|
|
|
72
72
|
- [docs/vexJsonSchema.md](../docs/vexJsonSchema.md) — full schema definition guide
|
|
73
|
-
- [docs/ForeignKey.md](../docs/ForeignKey.md) — foreign-key joins and `
|
|
73
|
+
- [docs/ForeignKey.md](../docs/ForeignKey.md) — foreign-key joins and `join`/`select` params
|
|
74
74
|
- [docs/appGenerated/auth.md](../docs/appGenerated/auth.md) — JWT rolling keys, OAuth2 setup
|
|
75
75
|
- [docs/developmentNote.md](../docs/developmentNote.md) — dev conventions, `FUNC{{ }}` syntax
|
|
76
76
|
- [docs/roadMap/](../docs/roadMap/) — released features and upcoming plans
|
package/README.md
CHANGED
|
@@ -1,75 +1,53 @@
|
|
|
1
1
|
# VeryExpress
|
|
2
|
-
|
|
3
|
-
with custom REST API defined in [Json Schema](https://github.com/json-schema-org) and [Open Api](https://github.com/OAI)
|
|
2
|
+
VeryExpress is a generator that reads JSON Schema and produces a complete Express.js REST API (TypeScript, Mongoose, RBAC, OAuth2, Swagger).
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
- Database Driver
|
|
13
|
-
- MongoDB by [Mongoose](https://mongoosejs.com/)
|
|
4
|
+
## Features
|
|
5
|
+
- Generate Express TypeScript server from JSON Schema
|
|
6
|
+
- API validation with `express-validator`
|
|
7
|
+
- OpenAPI generation + Swagger UI
|
|
8
|
+
- OAuth via `passport` (OAuth2)
|
|
9
|
+
- Mongoose (MongoDB) and TypeORM(SQL) DB driver
|
|
10
|
+
- CLI for quick project scaffolding
|
|
14
11
|
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
`mkdir jsonSchema`.
|
|
30
|
-
|
|
31
|
-
4. you can create your db collection/table now in directory `./jsonSchema` just created,
|
|
32
|
-
refer to [Define Json Schmea](./docs/vexJsonSchema.md),
|
|
33
|
-
every changes require to regenerate app.
|
|
34
|
-
|
|
35
|
-
6. generate the app with vex.config param.
|
|
36
|
-
`vex`
|
|
37
|
-
|
|
38
|
-
7. you should saw a express typescript app being generated (with src, package.json etc) .
|
|
39
|
-
```
|
|
40
|
-
├── jsonSchema/
|
|
41
|
-
│ └── ...
|
|
42
|
-
├── src/
|
|
43
|
-
│ └── ...
|
|
44
|
-
├── package.json
|
|
45
|
-
├── tsconfig.json
|
|
46
|
-
├── vex.config.json
|
|
47
|
-
└── .env
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
8. start the generated express app.
|
|
51
|
-
```
|
|
52
|
-
npm i
|
|
53
|
-
npm build
|
|
54
|
-
npm run start
|
|
55
|
-
```
|
|
12
|
+
## Quick Start
|
|
13
|
+
1. Install globally (optional):
|
|
14
|
+
```
|
|
15
|
+
npm i -g very-express
|
|
16
|
+
```
|
|
17
|
+
Or run via `npx`:
|
|
18
|
+
```
|
|
19
|
+
npx very-express
|
|
20
|
+
```
|
|
21
|
+
2. Initialize config in project root:
|
|
22
|
+
```
|
|
23
|
+
vex -init
|
|
24
|
+
```
|
|
25
|
+
This creates `vex.config.json`.
|
|
56
26
|
|
|
57
|
-
|
|
58
|
-
|
|
27
|
+
3. Create schema directory (or use directory set in `vex.config.json`):
|
|
28
|
+
```
|
|
29
|
+
mkdir jsonSchema
|
|
30
|
+
```
|
|
31
|
+
4. Add your JSON Schema files into `jsonSchema/` following schema guide: [docs/vexJsonSchema.md](docs/vexJsonSchema.md)
|
|
59
32
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
33
|
+
5. Generate app:
|
|
34
|
+
```
|
|
35
|
+
vex
|
|
36
|
+
```
|
|
37
|
+
6. Run generated app:
|
|
38
|
+
```
|
|
39
|
+
cd output
|
|
40
|
+
npm i
|
|
41
|
+
npm run dev
|
|
42
|
+
```
|
|
69
43
|
|
|
70
|
-
|
|
71
|
-
-
|
|
72
|
-
|
|
73
|
-
|
|
44
|
+
Notes:
|
|
45
|
+
- suffix `*.gen.ts` is regenerated by the generator. edit at own risk.
|
|
46
|
+
|
|
47
|
+
## Docs
|
|
48
|
+
- Schema reference: [docs/vexJsonSchema.md](docs/vexJsonSchema.md)
|
|
49
|
+
- Contributing: [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md)
|
|
50
|
+
- Usage & CLI: [docs/USAGE.md](docs/USAGE.md)
|
|
51
|
+
- Changelog: [docs/CHANGELOG.md](docs/CHANGELOG.md)
|
|
52
|
+
- Release notes: [docs/releaseNote/](docs/releaseNote/)
|
|
74
53
|
|
|
75
|
-
- [Discord](https://discord.gg/PZGMzDp7)
|