Configuration

Shelter

Shelter is combination of utility and application level scripts

Config:entry-interface.js

This file the heart of any application in jswalker.every config variable is put here affect directly to application.



var JSWALKER=require("jswalker/system/js-walker.js");

 JSWALKER.load({

  startup:{scripts:["test-1","test-2"], },

  host: {
     application_name:{
        host:["localhost","jswalker.in"],
        path:"application_name",
        auth:"authentication",
        default_routing:{
            initial_page:{flag:true,from:"/",to:"demo"}
        },
        base:{
           app_path:process.cwd(),
           uglify:{flag:false},
           minify:{flag:false}
        },
        glance:{
          flag:true,
          http:[
                {  
                  "*": { entry:true , exit:true , scripts:["glance1.js","glance2.js"]  }
                },
                {  
                  "/test": { entry:true , exit:true , scripts:["glance1.js","glance2.js"]  }
                }
          ],
          ajax:[],
          socket:[]
        }
    }
  }
 
  cluster:{flag:false},

  error_push:{
      file:{flag:true},
      mysql:{flag:true}
  },

  console_trace:{flag:true},

  redis:{flag:false,port:6379},

  favicon:{path:process.cwd()+"/shelter/utility/favicon/favicon.ico"},

  template:{cache:false},

  default_routing:{user_friendly_error:false},

  http:{
      base:{port:80,},
      socket:{flag:true,port:8081},
  },
  https:{
      flag:false,
      base:{port:443 },
      certificate_path:"ssl_certificate",key:"localhost.com",certificate:"localhost.com",
      socket_server_bind_port:8081,
      socket:{flag:true, port:8081 }
  },

  system_micro_service:{

     memory_trace:{
       flag:true,
       file:true,
       mysql:true
     },
     error_trace:{
       flag:true,
       file:true,
       mysql:true
     },
     database_trace:{
       flag:true,
       file:true,
       mysql:true
     }
  },


  database:{
      mongo_pool:{
          flag:true,
           dbs:[
             {name:"test1",host:"127.0.0.1",port:27017,user:"root",password:"password"},
             {name:"test2",host:"127.0.0.1",port:27017,user:"root",password:"password"}
           ]
      },

      mysql_pool:{
         flag:true,
         dbs:[
          {prefix:"jswalker,name:"jswalker",host:"127.0.0.1",user:"root",password:"password",mysql_path:false},
          {prefix:"test",name:"test",host:"127.0.0.1",user:"root",password:"password",mysql_path:false},
         ]
      }
  }

});


Startup

Startup scripts are useful to initiate while on project startup,it is also helpful in cluster no duplicate startup scripts called in cluster mode.

All startup scripts are found in : shelter/startup/task

Host

Host is responsibe all application and its related config variables

application_name : top level directory name inside host directory

  • host : Array of main domain name (localhost) is must to run on local machine
  • path : Top level application name inside host directory
  • Auth : Authentication file name which is reside in host/application_name/auth
  • default_routing : Index page of any url if no controller passed in url it will call default controller
  • base : This variable responsibe for supply minify and uglify resources.
  • glance : If we want watch or do something async task on every or specific controller eg : memory trace | Updating files and also supplied all kind of request ( Http | Ajax | Socket )

Note : all variables are self-explanatory.

Cluster

If cluster flag true Now jswalker use all of cpu core.

Console trace

One of the finest approach in jswalker to trace error inside 'BROWSER CONSOLE' to trace success as well as faulty code.

Redis

Best for session if Redis installed on machine to use persist session.

Favicon

Path

Template

This is cache mechanism of template set true when remtoe server used.

Default routing

It is Show either system error or user friendly error

Http

By default app is running no http server with port setting

Https

Https just add path for key and certificate and also socket bind port for socket transmission

System micro service

Memory trace and error trace in jswalker either in file or mysql ( Mysql is recommended for dashboard )

  • memory trace : Track Memory usage
  • error trace : Track Error occurence
  • database trace : Track Mysql Database Memory situational snap

Database

Nervous system of jswalker or Every enterprise.
What enterprise valuable resource is database and not one there are many databases used in single application and jswalker core is designed exactly according to that. Currently jswalker is by default supplied with two major database : MySql(Multi flavour) And MongoDb(Multi flavour)
and many more database supported (if node.js driver for database available) then it is perfectly used in jswalker. to handle at native level.