generator-express-crud
v0.5.3
Published
A NPX tool that allows to the developer to deploy fast backend apps only passing a few arguments, like the port, url database or entity model in yaml format
Downloads
9
Readme
generator-express-crud
A NPX tool that allows to the developer to deploy fast TypeScript backend apps only passing a few arguments:
- Backend port
- Mongo URL Database || Docker Mongo Database
- Entity model in YAML format
Stack
- ExpressJS
- Swagger
- Typescript 4
- Tsoa
- Mongoose
- Docker
Installation and execution example
Steps to reproduce:
- Create test folder
- Execute
npm i generator-express-crud
- Execute
npx express-crud
- Generate Swagger API documentation and running it by execution
npm run dev
-@Mac-Mini-M1 testFolder % npm i generator-express-crud
up to date, audited 454 packages in 670ms
51 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
-@Mac-Mini-M1 testFolder % npx express-crud
_-----_
| |
|--(o)--| ╭──────────────────────────╮
`---------´ │ generator-express-crud │
( _´U`_ ) ╰──────────────────────────╯
/___A___\ /
| ~ |
__'.___.'__
´ ` |° ´ Y `
? Insert you model .yaml filename that contains your data model business: model.yaml
? Insert the port where you want to startup your app: 8080
? Insert your URL MongoDB database: mongodb://mongo:[email protected]:6754
Documentation API Generated via Swagger
You can check it by executing 'npm run dev' and checking http://localhost:8080/docs
conflict package.json
? Overwrite package.json? overwrite
force package.json
create src/database.ts
create tsconfig.json
create tsconfig-build.json
create tsoa.json
create nodemon.json
create src/ioc/ioc.ts
create src/dao/repository/AlumnoRepository.ts
Changes to package.json were detected.
Running npm install for you to install the required dependencies.
create src/interfaces/dao/IAlumnoDao.ts
create src/dao/AlumnoDaoImpl.ts
create src/models/entities/Alumno.ts
create src/interfaces/service/IAlumnoService.ts
create src/service/AlumnoServiceImpl.ts
create src/controllers/Alumno/AlumnoController.ts
create src/dao/repository/ProfesorRepository.ts
create src/interfaces/dao/IProfesorDao.ts
create src/dao/ProfesorDaoImpl.ts
create src/models/entities/Profesor.ts
create src/interfaces/service/IProfesorService.ts
create src/service/ProfesorServiceImpl.ts
create src/controllers/Profesor/ProfesorController.ts
create src/common/exception/DaoError.ts
create src/common/exception/ServiceError.ts
create src/index.ts
added 604 packages, removed 328 packages, and audited 730 packages in 41s
101 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
-@Mac-Mini-M1 testFolder % npm run dev
> [email protected] dev
> npm run generate && ./node_modules/nodemon/bin/nodemon.js
> [email protected] generate
> tsoa routes && tsoa swagger
[nodemon] 2.0.19
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): src/**/*
[nodemon] watching extensions: ts
[nodemon] starting `npm start`
> [email protected] prestart
> npm run build
> [email protected] build
> npm run clean && tsc -p tsconfig-build.json
> [email protected] clean
> rm -rf dist
> [email protected] start
> node ./dist
connecting to database
connected to database
Server started at http://localhost:8080
Example entity model in YAML format
Alumno:
nombre: String
apellidos: String
edad: Number
nota: Number
Profesor:
nombre: String
apellidos: String
edad: Number
NPM Package
You can check this package too in NPMJS