Git Product home page Git Product logo

duplication_detection's Introduction

FrameWork

To Run This Application Follow The Steps Below :

$ git clone https://github.com/wohlig/Wohlig-Framework-V2
$ cd  Wohlig-Framework-V2/

Create a file named .env in root of the application and paste the content at the end of this document in newly created file.

$ npm i
$ npm run develop

For Local development :

Use nodemon in package.json (nodemon server.js)
NOTES :
Use standard.js for the VS Code for your development environment to maintain the standard of Javascript among all the team members.
Below given are the steps for installation pf  standard.js for VS code

Disable your current beautifier.

Standard Js Installation :

1. Go to Extensions in your left navigation bar of VS Code
2. Type Standard js in search box
3. Click on Standard js then install it. (It will automatically gets enabled)
4. Inside settings of standard.js enable the on-save functionality (which will automatically do beautification on CTRL + S)
npm run standard 

Developement environment .env file :

Sample .env

NODE_ENV = development
PORT = 3005
BASE_URL = ''
REDIS_INIT = false
REDIS_HOST = localhost
REDIS_NO_READY_CHECK = true
REDIS_AUTH_PASS = ''
REDIS_PORT = 6379
REDIS_DB = ''
AUTHENTICATION_INTERNAL_ALLOW = true
APP_NAME = framework
MONGO_INIT = false
MONGO_URL = mongodb://127.0.0.1:27017/myapp
APM_ENABLE_APM = false
APM_SERVICE_NAME = framework
APM_SECRET_TOKEN = twW4p9qC4vhYgWstdF
APM_SERVER_URL = https://71e04c24c1db4adf87a5d7d76f6fb555.apm.ap-south-1.aws.elastic-cloud.com:443
APM_ENVIRONMENT = development
APM_LOG_UNCAUGHT_EXCEPTIONS = true
APM_TRANSACTION_SAMPLE_RATE = 0.1
ELASTIC_CLOUD_ID = cloud:ELASTIC_CLOUD_ID
ELASTIC_USERNAME = ELASTIC_USERNAME
ELASTIC_PASSWORD = ELASTIC_PASSWORD
VAULT_ENDPOINT = VAULT_ENDPOINT
VAULT_ROLE_ID = VAULT_ROLE_ID
VAULT_SECRET_ID = VAULT_SECRET_ID
VAULT_PATH = VAULT_PATH
USE_VAULT = false
AUTHENTICATION_JWT_SECRET_KEY = bchvceydfgwfdwydrs
ELASTIC_INIT_USER_ACTIVITY = false
ADD_BASEURL_PREFIX = false
DEBUG_MODE = false
USER_BASED_CACHE = false

USER_BASED_CACHE FUNCTIONALITY :

USER_BASED_CACHE = false means the request is cached in redis based on only url
USER_BASED_CACHE = true means the request is cached in redis based on params such as "req.body, req.query, req.params"

Docker build command :

docker buildx build -t github.com/wohlig/wohlig-framework-v2 .

For Redis cache utility :

1. For redis-cache utility make sure that REDIS_INIT value in .env should be true
2. If redis-cache is not in use then make sure that REDIS_INIT value in .env should be false.
Note for point number 2, we also need to remove the cache.route() function for its controller for smoothly creating the build for the current app.

Example code caching the request :

Require the redis cache as shown below.
const cache = require('../../../middlewares/requestCacheMiddleware')
then use it wisely as second middleware of the route.
router.post('/getAllUsers/subUsers/:wa', cache.route(100), validation, getAllSubUsers)
Passing 100 as a params means expiry time is 100 sec.

duplication_detection's People

Contributors

bilal2912 avatar samayyy avatar bilalwohlig avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.