@simpli/cli-server v2.4.3
Simpli CLI
About
Simpli CLI provides tools to generate either web-server or web-client projects based on a MySQL database scheme.
Server Project
Client projects are generated based on your
MySQL database, and it providesRestful APIs, includingLogin API. Once you have built your server, you may use theDocker,IntelliJorNetBeansin order to run your server. I will assume you know how to use Tomcat Server and Maven.
Requirements
- MVN CLI (Maven)
- Docker CLIor
- MVN CLI (Maven)
- Tomcat Server with Catalina
- MySQL ServerFeatures included
- Kotlin Language
- Login API
- API Router
- API Process
- MySQL Table Models
- Data Access Object (DAO)
- Persist Validation
- Locale support (en-US and pt-BR included)
- Swagger Documentation
- Unit TestStructure
project-root/
src/
resource/
main/
kotlin/
[module_name]/
process/
response/
app/
dao/
enums/
exception/
locale/
model/
param/
wrapper/
webapp/
META-INF/
WEB-INF/
test/
kotlin/
[module_name]/
process/
model/
resource/
database/
create.sql
data.sqlClient Project
Client projects are generated based on
swagger.jsonwhich can be found in server projects. It provides an interface withCRUDs, includingLogin System. Also,Simpli Web SDKsupports you to easily develop your platform system. Access the simpli-web-sdk documentation to further information.
Requirements
- Node.js with NPMFeatures included
- Typescript Language
- Login System
- Simpli Web Sdk
- Serialized API responses into Models
- Locale support (en-US and pt-BR included)
- Persist Validation
- Webpack with hot-reload
- VUE with SPA (VueRouter)
- VUEX
- SCSS
- TSLintStructure
project-root/
public/
img/
src/
assets/
img/
bootstrap/
components/
modals/
config/
helpers/
vuex/
locale/
model/
collection/
resource/
response/
scss/
store/
modules/
types/
views/
layouts/
list/
persist/Getting Started
Let's start by installing Simpli CLI globally with npm.
$ npm install -g @simpli/cliOnce you have installed, simply go to your workspace directory and run the following:
$ simpli new:project [project-name]You may now choose between Server Project and Client Project.
Server Project Prompt
When you choose the Server Project, you have to provide your MySQL access with the chosen database:

Then, fill the rest of the prompt and confirm. Follow this example:

Generating Fake Data
Another useful feature of Simpli CLI is Fake Data. This data can be found in root-project/src/test/resources/database/data.sql.
If you could not find it, go to the root of project and generate the data.sql by running simpli new:seed. Then run simpli server:seed to populate the fake data into your database.
The default login is
test@test.comand the password istester
Important
Make sure your database is used for testing because the command simpli server:seed will TRUNCATE your tables.
Running the Server
Make sure the port 8080 is not in use.
Go to your project directory root and seed your database:
$ simpli server:seedThen, run this shell:
$ sh build.shThis command will use the mvn CLI and the docker CLI.
Therefore, it should have those installed.
Go to localhost:8080

Copy the swagger URL in order to generate the Client Project.
Client Project Prompt
When you choose the Client Project, you have to provide the swagger URL found in your Server Project:

Then, fill the rest of the prompt and confirm. Follow this example:

Once you have generated the client, go to your project directory root and run:
$ npm run serveto enter on development mode. Or run:
$ npm run buildto build for production mode.
When you enter on dev, you may see this screen at localhost:8181:

Important
The password column of your login table must be encrypted by
double SHA-256. E.g.: The password123456should be49dc52e6bf2abe5ef6e2bb5b0f1ee2d765b922ae6cc8b95d39dc06c21c848f8cin the password column.
Commands
Check it out the Simpli CLI commands
New Project
Create a new simpli project
Usage
$ simpli new:project [options] <project-name><project-name> : The name of your root project directoryOptions
-d, --default skip prompts and use default preset
-f, --force overwrite target directory if it exists
-h, --help output usage informationNew Seed
Create test data from a backend project and store it into data.sql
Usage
$ simpli new:seedOptions
-h, --help output usage informationScaffold Inspect
inspect the models and APIs based on swagger
Usage
$ simpli scaffold:inspect [options] [paths...][paths...] : The path of a model or APIOptions
-h, --help output usage informationExample
$ simpli scaffold:inspect api.signIn
Scaffold Sync
synchronize the models of the current frontend project based on its web server swagger
Usage
$ simpli scaffold:sync [options]Options
-h, --help output usage informationServer Inspect
inspect the tables of a MySQL database
Usage
$ simpli server:inspect [options] [paths...][paths...] : The path of a tableOptions
-h, --help output usage informationExample
$ simpli server:inspect table.user
Server Sync
synchronize the tables of the current backend project based on its MySQL database
Usage
$ simpli server:sync [options]Options
-h, --help output usage informationServer Seed
Seed the database with test data from the current backend project
Make sure your database is used for testing because the command simpli server:seed will TRUNCATE your tables.
Note: For security reasons, this command only allows MySQL host from localhost.
Usage
$ simpli server:seedOptions
-h, --help output usage information6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago