@orderstack/lighters-cli

1.2.0 • Public • Published

lighters-cli

How to install the CLI?

  1. Create a folder inside of which you want to setup your project.
  2. Run npm init inside the folder that you have created thus creating a package.json file in the root of your project.
  3. Create a .npmrc file with the npm OrderStack access token //registry.npmjs.org/:_authToken=token-will-be-right-here inside the root directory of your project, as this will be required for installing the cli and also for one of the core dependencies.
  4. Run the command npm install @orderstack/os-lighters --save-dev
  5. Run command npx lighters init inside the root folder of your project, this will install all core dependencies and setup the boilerplate code.
  6. You can now simply uninstall using npm uninstall @orderstack/os-lighters as the boilerplate has now been setup.

Boilerplate's folder structure

lighters-boilerplate
        app [common convention for server-side code]
            |- controllers [routes definition]
            |- listeners [application logic, actual implementation of the routes]
            |- models [schema information, and collection and index initialization]
            |- policies [here endpoint middlewares are defined]
            |- services [application logic, actual implementation inside async functions]
        config [core area]
            |- env [env files and env injection entrypoint js file resides here]
            |- validatorConfig [custom validator configs for object validation]
            |- constant.js [app wide constant values defined here]
            |- databases.js [manages connection to DB]
            |- enumerables.js [app wide enumerables defined here]
            |- http.js [cors policy, bodyparser defined here]
            |- routes.js [api versioning definition]
            |- sockets.js [socket middlewares defined here]
        app.js [dumb - no app logic, just entry point to "light" up the framework]
        lighters.js [core lighters logic which loads up and assembles all the dependencies]

Other notes

Please feel free to navigate around the example-structure/ to get more understanding of the boilerplate code which will be generated.

For any queries please contact rohan@orderstack.xyz

Readme

Keywords

none

Package Sidebar

Install

npm i @orderstack/lighters-cli

Weekly Downloads

1

Version

1.2.0

License

ISC

Unpacked Size

60.2 kB

Total Files

31

Last publish

Collaborators

  • taherpardawala