https://github.com/matt212/Nodejs_Postgresql_VanillaJS_Fastify
Config based Node.js and PostgreSQL Web App Boilerplate/Scaffolding with custom RBAC and stream-based CSV upload and download mechanics. Auto generated Modules through superAdmin panel with features like for API documentation - swagger , for Automation test stack - Mocha and more. Please refer Solution statement from README below.
https://github.com/matt212/Nodejs_Postgresql_VanillaJS_Fastify
api boilerplate docker fastify jenkins-pipeline mocha-chai mocha-tests multi-column-selection-predicates nodejs nodejs-api pivot-tables postgresql redis streaming-csv swagger
Last synced: 4 months ago
JSON representation
Config based Node.js and PostgreSQL Web App Boilerplate/Scaffolding with custom RBAC and stream-based CSV upload and download mechanics. Auto generated Modules through superAdmin panel with features like for API documentation - swagger , for Automation test stack - Mocha and more. Please refer Solution statement from README below.
- Host: GitHub
- URL: https://github.com/matt212/Nodejs_Postgresql_VanillaJS_Fastify
- Owner: matt212
- Created: 2020-12-04T06:00:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-08-24T16:28:06.000Z (10 months ago)
- Last Synced: 2024-08-24T21:54:24.891Z (10 months ago)
- Topics: api, boilerplate, docker, fastify, jenkins-pipeline, mocha-chai, mocha-tests, multi-column-selection-predicates, nodejs, nodejs-api, pivot-tables, postgresql, redis, streaming-csv, swagger
- Language: JavaScript
- Homepage:
- Size: 421 MB
- Stars: 10
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.MD
Awesome Lists containing this project
README
### Badges
[](https://github.com/matt212/Nodejs_Postgresql_VanillaJS_Fastify/actions/workflows/node.js.yml)[](https://github.com/matt212/Nodejs_Postgresql_VanillaJS_Fastify/actions/workflows/codeql-analysis.yml)
[](https://github.com/matt212/Nodejs_Postgresql_VanillaJS_Fastify/actions/workflows/cloneCount.yml)
[](https://github.com/matt212/Nodejs_Postgresql_VanillaJS_Fastify/issues)
### Tech stacks








π Problem Statement

π Solution Statement- Key Outcomes
π¨ Objective
π° Mandates

π¦ Features/Functionalities : Conventional Levels

π§ Features/Functionalities : Advanced Levels

π«
Scope Statement

π‘ Platform Setup
πsh file Setup
> *`chmod +x ./app/utils/serverSetup/primarySetup.sh `*
> *`sed -i -e 's/\r$//' ./app/utils/serverSetup/> primarySetup.sh`*
>*`chmod +x ./app/utils/serverSetup/secondarySetup.sh`*
>*`sed -i -e 's/\r$//' ./app/utils/serverSetup/secondarySetup.sh`*
>*`bash ./app/utils/serverSetup/primarySetup.sh`*
> _`Please note if you have node/postgres/redis server installed in your instance/machine. Please comment the install information in primarySetup.sh file and then run this file`_
π€app Setup
> **node,postgres, redis and app dependencies installation**>*`bash ./app/utils/serverSetup/primarySetup.sh`*
>*`bash ./app/utils/serverSetup/secondarySetup.sh`*
π mocha chai tests against 20,00,000 recordsets
> _`npm run LoginEval or yarn LoginEval`_
> _`npm run ModuleEval or yarn ModuleEval`_
π app Run
>*`npm run app or yarn app `*
π© app Usage
>*`goto localhost:3012/employees`*
>*`username : krennic and password:orson`*
>*`select birthdate from dropdown and select date range any from 1982 to till date`*
π app SuperAdmin Usage
>*`goto localhost:3012/black-squadron`*
>*`username : krennic and password:orson`*
>*`for any other controls other than textbox it is mandatory`*
>*`to enter PIPE "|" separator in textbox column for e.g genderid|gendername`*
π API Documentation Usage(Swagger)
>*`goto localhost:3012/getAccessToken`*
>*`Click on Get AccessToken button and copy the newly generated Access Token`*
>*`goto localhost:3013/api-docs/`*
>*`Click on authorize and paste the access Token`*
π Walkthroughs : Features/Functionalities
π Dynamic pivot operation from Postgres with highchart implementation (Redis Cached)
https://user-images.githubusercontent.com/1698139/182132755-e19fdbb3-23f3-422e-ac54-4f2e78d3a2c3.mp4
π Node.js stream based CSV download for more than 2 million recordsets from PostgresSQL with socket.io as progress feature
https://user-images.githubusercontent.com/1698139/182214015-847cced0-95a7-46ad-a9c2-c359e5dcb4de.mp4
π Automated Swagger for each Module created By build in scaffoding accessed at
http://localhost:3013/api-docs/
`yarn enable-swagger`
https://user-images.githubusercontent.com/1698139/182231396-1a483aed-7856-4302-beba-2fd879ee87d0.mp4
π Basic dashboard operation
https://user-images.githubusercontent.com/1698139/182218607-456a32d1-1239-4a98-b0a5-30ea2dc4da4a.mp4
π Boilerplate walkthrough with multi control(Radio and Checkbox-Data from respective db tables) with Automated mocha test Cases

π Boilerplate walkthrough with multi control(Radio-Data from respective db table) with Automated mocha test Cases

π€ Deliverables Timeline
π₯ 2022
π½ 2021

π 2020

####
π« Releases- ### `Release notes 23 July 2022`
>Optimized Dynamic Multi Column , Multi Select filter from 5 secs to 16 ms for 2 million rows .
>[My stack overflow solution](https://stackoverflow.com/a/73085784/1333794)
- ### `Release notes 21 July 2022`
>base and pivot Operation optimized
>incremental load (pagination section loaded after report rendered) for base report
>incremental load (pagination section loaded after report rendered) for pivot report- ### `Release notes 19 July 2022`
>github actions
>Integrated CI-workflows with redis, postgres for automation mocha test cases
>
>[Github Action - Automation mocha test cases](https://github.com/matt212/Nodejs_Postgresql_VanillaJS_Fastify/runs/7475512509?check_suite_focus=true )
- ### `Release notes 18 July 2022`>Implemented basic dark theme
- ### `Release notes 17 July 2022`
>Implemented Redis based Server-Side Caching for Pivot Operations
- ### `Release notes 1 July 2022`
> **Superadmin scaffolding/ boilerplate Access URL**
> *http://localhost:3012/black-squadron*
> _`username : krennic and password:orson`_>`for any other controls other than textbox it is mandatory `
>` to enter PIPE "|" separator in textbox column for e.g genderid|gendername`
- ### `Release notes 11 Feb 2021`
>boilerplate for multiselect integration with radio and checkboxes completed
- ### `Release notes 09 Feb 2021`
>Applied in boilerplate multi and single select Dynamic SQLConstruct with 360 degree coverage
- ### `Release notes 06 Feb 2021`
>for boilerplate multi and single select static mapping for edit and default rendering case scenarios completed
- ### `Release notes 29 Jan 2021`>validations applied for bolierplate dynamic radio button and checkboxes with
- ### `Release notes 27 Jan 2021`
>applied multi control for radio scaffolding
- ### `Release notes 20 Jan 2021`>For rbac test cases modularized
> `yarn mroleEval`
> `yarn userroleEval`
- ### `Release notes 9 Jan 2021`
>For rbac user-Role Mapping module migrated to fastify with its 35 mocha chai test cases respectively
> `yarn mroleEval`
> `yarn userroleEval`
- ### `Release notes 22 Dec 2020`
>Dynamic Bolierplate generation completed for dataType Strings , Integers and BigInt data types config based
>For rbac modname,muser modules migrated to fastify with their respective 43 and 63 mocha chai test cases
>For rbac role module migrated to fastify with its 43 mocha chai test cases
> `yarn ModEval`
> `yarn roleEval`
- ### `Release notes 21 Dec 2020`
> 73 **Modular** Mocha test cases against 20,00,000 recordset with 360 coverage including schema,NaN,Undefined,Multi Column Search,Multi Select,Pivot X and Y for pageSize and pageNo payload Validations
> `yarn ModuleEval`- ### `Release notes 20 Dec 2020`
> 73 **Modular** Mocha test cases against 20,00,000 recordset with 360 coverage including schema,NaN,Undefined,Multi Column Search,Multi Select,Pivot X and Y for pageSize and pageNo payload Validations
> `yarn ModuleEval`- ### `Release notes 11 Dec 2020`
> basic login tests are written and can view and evaluated by running below command
> `yarn LoginEval`- ### `Release notes 10 Dec 2020`
> run `yarn perfgraph`
> in new shell run autocannon `yarn customAutocannon`
> when autocannon bench is completed go back to perfgraph shell and stop the shell (ctlrl+C)
> it will generate graph html link in same perfgraph shell- ### `Release notes 7 Dec 2020`
> made date filter optional with code refractoring by introducing `disableDate=true` arguement in API payload.
π Project Statement
π°οΈ Architectureπ― Server Side
π₯ Route Structure Module Operations

π₯ Module View (EJS) Render

π² Module Load Operations

π Multipurpose Features Operations

π§ Groupby Operations

π₯ Create Operation

π₯¨ Update Operations

π₯ ETL Upload Operations

π₯ ETL Download Operations

π³ Api Cache Operations

π₯ Api Cache Operations-Drilldown

πΈ Client Side
βοΈ View Structure and Page Operations

π©οΈ Page Load and Date Range Operations

πΆ Sort and Pagination Operations
πͺ Filter Operations

β΅ Create and Update Operations

β΄οΈ Field Validations

π€ Field Validations-Event listeners

π€Ώ App Module-ActionFunctions

π· Pivot Operations

ποΈ ETL upload Operations

π± ETL download user Actions

π£ ETL download Operations

π― Database Side
π₯ RBAC-ERD

π RBAC-Case Scenarios

π Release Flowπ₯₯ Nodejs Web App Env Release Mechanism Pt-1

π Nodejs Web App Env Release Mechanism Pt-2

π How to Release Node App
πΆοΈ Performanceπ§ Normal Mode (API against 2 Million Rows )[requests:2000, concurrent:100]
https://user-images.githubusercontent.com/1698139/182044366-3edb4b47-a7f0-4330-83fd-b2a3ea773117.mp4
π₯ Cluster Mode (API against 2 Million Rows )[requests:2000, concurrent:100]
https://user-images.githubusercontent.com/1698139/182044831-87c0a025-0168-413b-a96f-b278ade5489f.mp4
#### π±Reach out to me π π€
[](https://www.linkedin.com/in/rizwan-patel/)