Loading repository data…
Loading repository data…
ladjs / repository
Node.js framework made by a former @expressjs TC and @koajs team member. Built for @forwardemail, @spamscanner, @breejs, @cabinjs, and @lassjs.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Lad boasts dozens of features and is extremely configurable.
These microservices are preconfigured for security, performance, and graceful reloading.
Finally a framework that solves i18n everywhere; complete with automatic translation.
Our beautiful email engine uses [email-templates][] (which is also made by the creator of Lad)!
We've spent a lot of time designing a beautiful error handler.
text/html, application/json, and text response typesSee [koa-better-error-handler][] for a complete reference.
We strictly support Mac and Ubuntu-based operating systems (we do not support Windows).
Please ensure your operating system has the following software installed:
[Git][] - see [GitHub's tutorial][github-git] for installation
[Node.js][node] (v10+) - use [nvm][] to install it on any OS
nvm you will need to run nvm install node[MongoDB][] (v3.x+):
Mac (via [brew][]): brew tap mongodb/brew && brew install mongodb-community && brew services start mongodb-community.
Ubuntu:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
sudo apt-get update
sudo apt-get -y install mongodb-org
[Redis][] (v4.x+):
Mac (via [brew][]): brew install redis && brew services start redis
Ubuntu:
sudo add-apt-repository -y ppa:chris-lea/redis-server
sudo apt-get update
sudo apt-get -y install redis-server
[npm][]:
npm install -g lad
[yarn][]:
yarn global add lad
lad new-project
cd new-project
To begin, try typing npm start (or yarn start) on command line. This will display to you all the scripts you can run.
The start script (among many others) uses [nps][] and [nps-utils][] under the hood. This helps to keep scripts very developer-friendly, and rids the need to write in JSON syntax.
This script accepts a <task> argument, whereas a task of all will spawn, watch, and re-compile all of the microservices mentioned above.
Just open http://localhost:3000 for testing!
[npm][]:
npm start all
[yarn][]:
yarn start all
DEBUG - debug using [debug][] output (widely adopted package in the community for debugging across all Node packages):
DEBUG=* ...
NODE_DEBUG - debug [node][] internal modules:
NODE_DEBUG=* ...
MONGOOSE_DEBUG - debug Mongoose raw database operation output:
MONGOOSE_DEBUG=true ...
TRANSPORT_DEBUG - debug Nodemailer transport:
TRANSPORT_DEBUG=true ...
REDIS_MONITOR - debug Redis using MONITOR (uses [@ladjs/redis][ladjs-redis] and passes true for the monitor argument):
REDIS_MONITOR=true ...
REDIS_FRIENDLY_ERROR_STACK - debug Redis with friendly error stack messages (see [showFriendlyErrorStack][show-friendly-error-stack] option of [ioredis][])
REDIS_FRIENDLY_ERROR_STACK=true ...
We strongly recommend using [SemaphoreCI][], [PM2][], and [Digital Ocean][do] for production deployment.
We've provided you with a preconfigured ecosystem.json deployment file. You will need to modify this file with your server's IP, hostname, and other metadata if needed.
Make sure that your project's assets are built with NODE_ENV=production flag, e.g. NODE_ENV=production npm run build (or with yarn as yarn build);this creates a build/rev-manifest.json file per [koa-manifest-rev][].
You can test this locally by installing [PM2][] globally with [npm][] or [yarn][], and then running the following command:
NODE_ENV=production pm2 start
See the Continuous Integration and Code Coverage and Tutorials sections below for instructions on how to setup continuous integration, code coverage, and deployment.
If you specify an environment variable value for AWS_CF_DOMAIN and NODE_ENV=production is set then your assets will need to be published to Amazon S3/Cloudfront. To do so run npm start publish-assets (or with yarn as yarn start publish-assets). This command automatically sets NODE_ENV=production for you as well via cross-env.
See the ansible folder for our [Ansible][] configuration and playbooks, which we use to provision servers with.
We recommend you to install [yamllint][] and configure it in your editor while working with [Ansible][] playbooks.
Also note that [ansible-lint][] is a helpful linting tool you can use if you plan on making changes to playbooks. Note that our current playbooks have several existing lint errors.
First you must provision Ubuntu 18.04 LTS 64-bit server(s) using [Digital Ocean][digital-ocean], [Linode][], [Vultr][], or your host of choice. These newly provisioned server(s) should have your SSH key automatically added.
Follow the Deployment guide below for automatic provisio