1.6.3-alpha • Published 10 days ago

@simitgroup/simpleapp-generator v1.6.3-alpha

Weekly downloads
-
License
ISC
Repository
github
Last release
10 days ago

Introduction

SimpleApp generator is a typescript code generator for convert jsonschemas become workable frontend (nuxt) and backend (nest). There is plenty of benefit included: 1. complex multi-tenancy data isolation structure which support tenant/organization/branches 2. unified frontend and backend data validation according jsonschemas 3. Auto generate frontend template, frontend developer freely modify layout without worry integration lose 4. It design as easy to understand as possible, developer can work at frontend and backend separately after code generated. 5. It design with concept allow unlimited regenerate without break your codes, schemas can change anytime and the impact should be minimal 6. visualize as much as possible programming design, formula in jsonschemas, reduce burden of software audit and handover. included a. schemas b. additional api besides CRUD c. document status d. authorization e. formulas of specific fields f. data types and validations 7. build in enterprise functionality included: a. document numbering x b. authentication and authorization x c. data modification audit trail [] d. SSO x e. openapi interface x f. pdf document [] g. document uploads[] 8. BPMN workflow integration a. streamline business flow with BPMN b. implement philosophy of bpmn documentation is source code c. fill in minimal source code in generated listener to run whole bpmn process d. build in integrate between both frontend and backend e. declare workflow in jsonschema 9. graphql

Documentation

  1. jsonschemas
  2. backend walk through
  3. frontend walk through
  4. End to End test
  5. BPMN walk through
  6. Language
  7. Viewer, with add, update. using event after and properties paras
  8. Document Status
  9. Additional Api & define api schema 10.SimpleAppInputs 11.Role Base Access Control 12.graphql

Quick start

  1. Simpleapp implement database transaction, and require mongodb cluster, below setup 3 nodes
#create network
docker network create mongoCluster
#prepare node1
docker run -d -p 27017:27017 --name mongo1 --network mongoCluster mongo:6 mongod --replSet myReplicaSet --bind_ip localhost,mongo1
#prepare node2
docker run -d  -p 27018:27017 --name mongo2 --network mongoCluster mongo:6 mongod --replSet myReplicaSet --bind_ip localhost,mongo2
#prepare node3
docker run -d  -p 27019:27017 --name mongo3 --network mongoCluster mongo:6 mongod --replSet myReplicaSet --bind_ip localhost,mongo3


# build cluster
docker exec -it mongo1 mongosh --eval "rs.initiate({
 _id: \"myReplicaSet\",
 members: [
   {_id: 0, host: \"mongo1\"},
   {_id: 1, host: \"mongo2\"},
   {_id: 2, host: \"mongo3\"}
 ]
})"

# set mongod1 high priority as primary server
docker exec -it mongo1 mongosh --eval "cfg = rs.conf()
cfg.members[0].priority = 50
cfg.members[1].priority = 1
cfg.members[2].priority = 1
rs.reconfig(cfg)"

#check cluster status
docker exec -it mongo1 mongosh --eval "rs.status()"

** you may need to append below code into your /etc/hosts

127.0.0.1 mongo1 mongo2 mongo3
  1. create project folder
mkdir ~/project1
cd ~/project1
  1. install latest simpleapp-generator
npm install -g @simitgroup/simpleapp-generator ts-node
  1. init project folder, it will create some samples too
simpleapp-generator -g init
# !important
# Modify value in config.json, it will copy over to both frontend and backend .env
  1. prepare backend
./build.sh backend
  1. update backend configurations file by modify ~/project1/backend/.env, change mongodb, keycloak settings according your requirements
  2. start backend:
cd ~/project1/backend
pnpm start:dev
  1. prepare frontend (i use pnpm cause faster)
./build.sh frontend
  1. modify frontend configuration by modify ~/project1/frontend/.env, change keycloak settings
OAUTH2_BASEURL=https://server-url    #keycloak server url
OAUTH2_CONFIGURL=https://server-url/realms/testingrealm
OAUTH2_REALM=testingrealm
OAUTH2_CLIENTID=client1
OAUTH2_CLIENTSECRET=aaaa-xxxxx-yyyy-zzzzz-www
ADMIN_EMAIL=your@ykeycloakemail.com    #if you have multiple, separate by ','
  1. start frontend:
cd ~/project1/frontend
pnpm dev

#or use production way
nuxi build
nuxi preview

Perform Development

  1. add some schemas at ~/project1/schemas
  2. then run
./build.sh updatebackend
./build.sh updatefrontend
  1. to add different user group permission, you may change project1/groups

Error Troubleshoot

Cannot start backend due to Unable to connect to the database. Retryi...

  1. You may have wrong configuration of mongodb connection string, try use mongodb compass access your clusters using same connection string
  2. the mongodb primary node may switch to another host, try restart mongodb container node2,node3 until primary server at node1. monitor using
docker exec -it mongo1 mongosh --eval "rs.status()"

ERROR worker reload Cannot find package 'memory-cache' imported

  1. nuxt seems have some issue, try install this package manually
cd ~/project1/frontend
pnpm install memory-cache
1.6.3-alpha

10 days ago

1.6.2-alpha

16 days ago

1.6.1-alpha

18 days ago

1.6.0-alpha

26 days ago

1.5.1-alpha

1 month ago

1.5.0-alpha

2 months ago

1.4.2-alpha

2 months ago

1.4.1-alpha

2 months ago

1.4.0-alpha

2 months ago

1.3.4-alpha

2 months ago

1.3.5-alpha

2 months ago

1.3.3-alpha

2 months ago

1.3.2-alpha

2 months ago

1.3.1-alpha

2 months ago

1.3.0-alpha

2 months ago

1.2.8

3 months ago

1.2.7

3 months ago

1.2.6

3 months ago

1.2.5

3 months ago

1.2.3

3 months ago

1.2.2

3 months ago

1.2.1

3 months ago

1.2.0

3 months ago

1.1.28

3 months ago

1.1.27

3 months ago

1.1.26

4 months ago

1.1.25

4 months ago

1.1.24

4 months ago

1.1.22

4 months ago

1.1.21

4 months ago

1.1.20

4 months ago

1.1.19

4 months ago

1.1.18

4 months ago

1.1.17

4 months ago

1.1.16

5 months ago

1.1.15

5 months ago

1.1.14

5 months ago

1.1.12

5 months ago

1.1.11

5 months ago

1.1.10

5 months ago

1.1.9

5 months ago

1.1.8

5 months ago

1.1.7

5 months ago

1.1.6

5 months ago

1.1.5

5 months ago

1.1.4

5 months ago

1.1.3

5 months ago

1.1.2

6 months ago

1.1.1

6 months ago

1.1.0

6 months ago

1.0.64

6 months ago

1.0.63

6 months ago

1.0.62

6 months ago

1.0.61

6 months ago

1.0.60

6 months ago

1.0.59

6 months ago

1.0.58

6 months ago

1.0.57

6 months ago

1.0.56

6 months ago

1.0.55

6 months ago

1.0.54

6 months ago

1.0.53

6 months ago

1.0.52

6 months ago

1.0.51

6 months ago

1.0.50

6 months ago

1.0.49

6 months ago

1.0.48

6 months ago

1.0.47

6 months ago

1.0.46

6 months ago

1.0.45

6 months ago

1.0.41

6 months ago

1.0.40

6 months ago

1.0.39

6 months ago

1.0.38

6 months ago

1.0.36

6 months ago

1.0.35

6 months ago

1.0.33

7 months ago

1.0.32

7 months ago

1.0.31

8 months ago

1.0.29

8 months ago

1.0.28

8 months ago

1.0.27

8 months ago

1.0.25

8 months ago

1.0.24

8 months ago

1.0.23

8 months ago

1.0.22

8 months ago

1.0.21

8 months ago

1.0.20

8 months ago

1.0.19

8 months ago

1.0.16

8 months ago

1.0.15

8 months ago

1.0.14

8 months ago

1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago