Simpli CLI provides tools to generate either web-server or web-client projects based on a MySQL database scheme.
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
,IntelliJ
orNetBeans
in order to run your server. I will assume you know how to use Tomcat Server and Maven.
- MVN CLI (Maven)
- Docker CLI
or
- MVN CLI (Maven)
- Tomcat Server with Catalina
- MySQL Server
- 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)
- Preconfigured AWS Mail sender
- Swagger Documentation
- Unit Test
project-root/
src/
resource/
main/
kotlin/
[module_name]/
auth/
context/
mail/
process/
request/
response/
router/
socket
app/
dao/
enums/
exception/
locale/
model/
param/
wrapper/
webapp/
META-INF/
WEB-INF/
test/
kotlin/
[module_name]/
auth/
process/
model/
resource/
resource/
database/
create.sql
data.sql
Client projects are generated based on
swagger.json
which can be found in server projects. It provides an interface withCRUDs
, includingLogin System
. Also,Simpli Web SDK
supports you to easily develop your platform system. Access the simpli-web-sdk documentation to further information.
- Node.js with NPM
- 100% Typescript
- 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 CLI
- VUE with Typescript
- VUEX with Typescriptk
- SPA (with VueRouter)
- SCSS
- ESLint
project-root/
public/
img/
preloader/
src/
assets/
font/
img/
components/
modals/
config/
helpers/
dialog/
vuex/
locale/
model/
collection/
resource/
request/
response/
schema/
scss/
components/
setup/
store/
modules/
types/
views/
auth/
layouts/
list/
persist/
/tests/
Let's start by installing Simpli CLI globally with npm.
$ npm install -g @simpli/cli
Once 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
.
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:
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
[email protected]
and the password istester
Make sure your database is used for testing because the command simpli server:seed
will TRUNCATE your tables.
Make sure the port 8080 is not in use.
Go to your project directory root and seed your database:
$ simpli server:seed
Then, run this shell:
$ sh build.sh
This 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
.
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 serve
to enter on development mode
. Or run:
$ npm run build
to build for production mode
.
When you enter on dev
, you may see this screen at localhost:8181
:
The password column of your login table must be encrypted by
double SHA-256
. E.g.: The password123456
should be49dc52e6bf2abe5ef6e2bb5b0f1ee2d765b922ae6cc8b95d39dc06c21c848f8c
in the password column.
Check it out the Simpli CLI commands
Create a new simpli project
$ simpli new:project [options] <project-name>
<project-name> : The name of your root project directory
-d, --default skip prompts and use default preset
-f, --force overwrite target directory if it exists
-h, --help output usage information
Create test data from a backend project and store it into data.sql
$ simpli new:seed
-h, --help output usage information
inspect the models and APIs based on swagger
$ simpli scaffold:inspect [options] [paths...]
[paths...] : The path of a model or API
-h, --help output usage information
$ simpli scaffold:inspect api.signIn
synchronize the models of the current frontend project based on its web server swagger
$ simpli scaffold:sync [options]
-h, --help output usage information
inspect the tables of a MySQL database
$ simpli server:inspect [options] [paths...]
[paths...] : The path of a table
-h, --help output usage information
$ simpli server:inspect table.user
synchronize the tables of the current backend project based on its MySQL database
$ simpli server:sync [options]
-h, --help output usage information
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
.
$ simpli server:seed
-h, --help output usage information
To run simpli-cli with your changes simply run this command:
node <simpli-cli-folder>/packages/@simpli/cli/bin/simpli.js <any-command> --debug