Getting Started

Prerequisites

Manual Installation

This chapter will help you build a simple Zerone base service from scratch.

  • Step 1: Install Zerone CLI tool and create a new project
npm i -g @zeronejs/cli
zerone new project-name
cd project-name
1
2
3
  • Step 2: Install the dependencies and run them
yarn
yarn start
1
2
npm install
npm run start
1
2

Zerone launches a development server athttp://localhost:5000open in new window. http://localhost:5000/docsopen in new window started a Swagger open API.

You should now have a simple working Zerone server.

Generate CURD by one key

After the project is created, it carries a user entity, and this section will help you generate the interface with one click.

TIP

The generate command reads the table structureopen in new window of all *.entity.ts files in the current directory

You need to enter this folder

cd src/api/user/entities/
1

With a single command, a CRUD is generated。

zerone generate
1

Restart the project

yarn start
1
npm run start
1

View the generated interface on http://localhost:5000/docsopen in new window

TIP

This project is built on TypeOrm. For personalized requirements such as table association, please refer to typeormopen in new window

Backstage

Open the http://localhost:5000/adminopen in new windowto view the backstage data.

TIP

Click login directly. Configuration file in src/common/admin/adminOption.ts