@orderstack/lighters-cli
v1.2.0
Published
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
Downloads
3
Readme
lighters-cli
How to install the CLI?
- Create a folder inside of which you want to setup your project.
- Run
npm init
inside the folder that you have created thus creating apackage.json
file in the root of your project. - 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. - Run the command
npm install @orderstack/os-lighters --save-dev
- Run command
npx lighters init
inside the root folder of your project, this will install all core dependencies and setup the boilerplate code. - 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 [email protected]