3.4.17 • Published 5 years ago

webux-app v3.4.17

Weekly downloads
-
License
SEE LICENSE IN li...
Repository
github
Last release
5 years ago

Webux-app

This module contains the definition of the whole app, it uses global variable to simplify the app structure.

Installation

npm i --save webux-app

Usage

@ 2019-07-13 I will soon start to write a complete documentation, I recommend you to check the example directory to get a good understanding of the application

This module is a wrapper of the entire app, you can use it to centralise the management, all the modules work together without major issues.

For an example about how to use it, check the examples directory.

Otherwise here is the two files that use especially the webux-app module,

LoadApp.js it contains the application definition.

const path = require("path");
const Webux = require("webux-app");

async function LoadApp() {
  // Load configuration
  await Webux.LoadConfiguration(path.join(__dirname, "config"));

  // Create logger
  await Webux.CreateLogger();

  // initialize the Database
  await Webux.InitDB();

  // initialize the Database Models
  await Webux.LoadModels();

  // load default values
  await Webux.LoadSeed();

  // request logger
  await Webux.OnRequest();

  // Load security
  await Webux.LoadSecurity();

  // Load Language
  await Webux.LoadLanguage();

  // Create Limiter
  await Webux.CreateLimiter();

  // routes
  await Webux.CreateRoutes();

  // sockets
  await Webux.CreateSockets();

  // error handling
  await Webux.GlobalErrorHandler();

  // start server
  await Webux.StartServer();

  // start sockets
  await Webux.StartSocket();

  return Webux;
}

module.exports = LoadApp;

app.js This is the entry point for the application

const LoadApp = require("./LoadApp");

try {
  LoadApp();
} catch (e) {
  process.exit(1);
}

The application recommended architecture

./
  actions/
    user/
      create.js
      find.js
      findOne.js
      update.js
      remove.js
    language/
      find.js
  config/
    db.js
    language.js
    limiter.js
    logger.js
    mailer.js
    request.js
    routes.js
    security.js
    seed.js
    server.js
    socket.js
  constants/
    user.js
  defaults/
    00_language.js
  locales/
    fr.json
    en.json
  models/
    user.js
    language.js
  validations/
    user.js
  app.js
  LoadApp.js
  package.json
  .gitignore

for further details, i'm currently writing the whole document for the framework... Feel free to ask questions,

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

SEE LICENSE IN license.txt

3.4.17

5 years ago

3.4.16

5 years ago

3.4.15

5 years ago

3.4.14

5 years ago

3.4.13

5 years ago

3.4.11

5 years ago

3.4.10

5 years ago

3.4.9

5 years ago

3.4.8

5 years ago

3.4.7

5 years ago

3.4.6

5 years ago

3.4.5

5 years ago

3.3.0

5 years ago

3.2.0

5 years ago

3.1.5

5 years ago

3.1.4

5 years ago

3.1.3

5 years ago

3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.5

5 years ago

3.0.4

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.9.2

5 years ago

2.9.1

5 years ago