npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@simitgroup/simpleapp-generator

v1.6.6-i-alpha

Published

frontend nuxtjs and backend nests code generator using jsonschema

Downloads

20

Readme

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
[email protected]    #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] [worker init] Cannot find package 'memory-cache' imported

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