Liftr — Quick Node.js & TypeScript project creation and scaling

A tool to setup and scale a Node.js and TypeScript project quickly and efficiently.

Faris Tangastani
Crowdbotics
3 min readFeb 22, 2019

--

Photo by Alexandru Acea on Unsplash

Starting a project is easy but maybe all the boilerplates out there are too overloaded and packed with nonsense dependencies and bloat. Liftr is a CLI that will help you speed up the development of your TypeScript and Node.js backend or API and give you a great base to start — and finish any project.

Liftr works as a sort of pseudo-framework based on a certain folder structure controllers/middleware/routes in the src folder. When generating new components they will automatically be added to their respective folders. This way everything remains structured and coherent — especially when projects get bigger.

Quickstart

Install Liftr as a global CLI.

npm install -g @liftr/cli

You then run

liftr -s <name-of-your-project>

This should setup a project with all the necessary folders and files so that you can begin building straight away! Your setup should look like this

├── package-lock.json├── package.json├── src│   ├── app.ts│   ├── controllers│   │   └── liftr.controller.ts│   ├── middleware│   │   └── liftr.middleware.ts│   ├── routes│   │   ├── index.ts│   │   └── liftr.route.ts│   └── server.ts└── tsconfig.json

Commands

Here are all the possibilities with Liftr

 
| | (_) / _| | |_ _ __
| | | | | |_ | __| | '__|
| |___ | | | _| | |_ | |
|_____| |_| |_| \__| |_|
# Create a setup for your Nodejs/Typescript projectliftr -s <your-project-name>liftr --setup <your-project-name># Create a route in the routes folder and add it to the routing moduleliftr -r <your-route-name>liftr --route <your-route-name># Create a controller in the controller folderliftr -c <your-controller-name>liftr --controller <your-controller-name># Create a middleware in the middleware folderliftr -m <your-middleware-name>liftr --middleware <your-middleware-name>

Contributing

Want to file a bug, contribute some code, or improve documentation? Feel free to place an issue.

First fork this project.

git clone <your-forked-repo>npm installgit checkout -b my-fix# fix some code…git commit -m “added this feature”git push origin my-fix

Lastly, open a pull request on Github.

The following npm scripts are available

  • npm start - create build, install globally and run liftr
  • npm run build - create build
  • npm run test - install globally and run liftr
  • npm run link-upstream - add remote
  • npm run sync - fetch, checkout, merge and push
  • npm run copy-templates- Moves ./templates to ./lib/templates
  • npm run refresh - removes node modules, package-lock.json, lib and re-installs everything.

Go create something awesome with Liftr!

--

--