pozoljs
v0.8.4
Published
Initialize a node-express project with typescript or javascript and create full components to develop your backend apps faster.
Downloads
5
Maintainers
Readme
Pozol CLI
Pozoljs is a package to initialize your node-express project with typescript or javascript and create full components to develop your backend apps faster.
Pozoljs will helps you to get a node-express project more escalable with a good estructure for folders and files.
Pozoljs is not a framework.
Getting start
Installing the CLI
Global installation.
npm install -g pozoljs
yarn global add pozoljs
Local installation.
npm install pozoljs
yarn add pozoljs
When the package is installed, you will can use pozoljs
command.
The CLI :book:
Some concepts
- Component is a small folder that contains the principal modules of an endpoint. For example, you will develop endpoints about users, so in the users folder you will have controller, service, routes files (and interface if it is a typescript project).
- Service connect with the database or return data that you need. In other words, the service provides data to the controller. In the start, the service file implements find, save, update and delete methods.
- Controller manipulate the data that obtains of the service or of the route. The controller call service methods through dependency injection.
- Routes about your component like GET, POST, PUT or DELETE.
- Interface is using in typescript like a data type.
Build your project using pozoljs
Create a new node-express projects with an initial structure.
pozoljs new <name> [options]
Options available
Files Structure
Pozoljs builds a node-express project with an initial structure. This one helps you to develop faster and escalable code. The initial structure is:
├────src
│ ├───api
│ │ └───component
│ │ │ ├───component.controller.ts/js
│ │ │ ├───component.interface.ts
│ │ │ ├───component.routes.ts/js
│ │ │ └───component.service.ts/js
│ │ └───index.ts/js
│ ├───global
│ │ ├───helpers
│ │ │ └───abstract.api-routes.ts
│ │ │ └───abstract.routes.ts
│ │ │ └───abstract.service.ts
│ │ ├───config.ts/js
│ │ ├───interfaces.ts
│ │ └───utils.ts/js
│ │ └───variables.ts/js
│ ├───middlewares
│ ├───database.ts/js
│ ├───index.ts/js
│ └───server.ts/js
├───.editorconfig
├───.env
├───.env.example
├───.gitignore
├───package.json
├───pozoljs.config.json
├───package-lock.json/yarn.lock
└───tsconfig.json
Schematics
All commands have the full type and abreviation type.
pozoljs g <schematic> [name]
Schematics availables
About the project created
The project created using pozoljs is to get an initial and generic structure of all your node projects.
In the package.json there are 3 commands:
- Run
npm run dev
/yarn dev
to execute the project in development mode. - Run
npm run build
/yarn build
to create the production project (just for typescript). - Run
npm run start
/yarn start
to execute the project in the production mode.
For more information, you can execute: pozoljs --help