Skip to content

Installation

Lesgo! Framework

A lightweight Node.js boilerplate framework designed with serverless architecture.

Bootstrap your next serverless microservice with a ligh-weight Node.js app built on top of the Serverless Framework on AWS.

Why Lesgo! Framework?

Like any other frameworks out there, we built this Framework because we couldn't find one that fits our needs. We believe that a framework for the Serverless Architecture should fit the following criteria:

  • Super lightweight. The bundled lambda function should only bundle what is necessarily required by the function, and nothing else. This is why we chose the Serverless Framework as the basic building block for this framework. It provides the necessary tools to build, bundle, and deploy direct to AWS via CloudFormation, while still allowing the option to bundle each function individually.
  • Easy to understand file structure. Most of our file structure, scripts, and helper functions is inspired from the Laravel Framework. The primary reason being that all the original developers and current maintainers have years of experience building applications on Taylor Otwell's Laravel Framework. If you know Laravel, you will know Lesgo!
  • Highly adaptable for any use case. We have built multiple microservices for the last 3 years from a simple "Unique Name Generator", to a process-intensive "Photo Processor" and "Image Moderation", to complex projects building a Social Network App using this very same framework!
  • Continous upgrades. As long as we continue to use this framework, we will continue to maintain and expand its functionalities. This framework will continue to grow with us. We take the learnings from our other microservices and upgrade this framework accordingly.

Quick Start

Prerequisites

Install Serverless Framework globally with: npm install -g serverless. Refer to https://serverless.com/framework/docs/getting-started/ for additional info.

Create Serverless project:

sls create --template-url https://github.com/reflex-media/lesgo/tree/master --path my-service
cd my-service

Install dependencies:

npm install

Start local:

npm start

Access local url via browser or Postman: http://localhost:8181/ping.

Configuration

There are 3 layers of configurations for the Lesgo! framework.

The project configurations (serverless config) are stored in config/ directory as .yml files. These configuration files affect your project set up and build.

The application configurations (app config) are stored in src/config/ directory as .ts files. These are application/business specific configurations.

The environment configurations (env config) are stored in config/environments/ directory and is stored as DOTenv syntax. These are useful to set configuratuins per environment.

Each configuration is documented, so feel free to look through the files and get familiar with the options relevant to you.