A bleeding edge Serverless Framework boilerplate
Tags: showdev, javascript, serverless
Published: 2018-08-15 14:35:53

---
title: A bleeding edge Serverless Framework boilerplate
canonical_url: https://www.orangejellyfish.com/blog/introducing-our-serverless-starter-kit/
description: Introducing the orangejellyfish Serverless starter kit
published: true
tags: showdev, javascript, serverless
---

At [orangejellyfish][oj] we are big fans of the [Serverless][sls] framework and use it in a number of projects. Over time we have realised the need for a boilerplate Serverless app to save time when getting started, and that's what we have built.

{% github https://github.com/orangejellyfish/serverless-starter %}

The starter kit is an opinionated boilerplate for a Serverless app running in AWS. It's been designed to offer as much future-proofing as possible, a tricky challenge in the fast-moving JavaScript ecosystem! Our starting point was the fantastic "[Modern Serverless Starter Kit][mssk]" by [Postlight][pl]. While that project has "modern" in the name we felt that we could safely go a bit closer to the cutting edge.

## Features

When designing the Serverless starter kit we had a few key requirements in mind
which directly translate into features:

- **Node 8 support**. This was a key one for us. AWS has [supported Node 8][n8] as a Lambda runtime environment since April 2018, bringing native support for a whole host of recent ECMAScript features (including async/await), performance improvements and reduced memory consumption thanks to the more recent version of V8.

- **Webpack 4 support**. It was important that we could bundle our Lambda function code with Webpack to reduce the size of the package uploaded to AWS. [Webpack 4][wp4] is the latest and greatest version, offering major speed improvements and much simpler configuration compared to previous iterations.

- **Babel 7 support**. This one is more a straightforward case of future-proofing. There's currently little technical reason to favour Babel 7 over the arguably more stable version 6 but it's fun to push the boundaries sometimes!

- **Local development support**. If you have to deploy functions to AWS every time you make a change the developer experience is somewhat poor. Fortunately this problem has been solved by the [serverless-offline][so] plugin which emulates AWS Lambda and API Gateway locally.

- **Jest support**. Unit testing is important. [Jest][jest] is, in our opinion, the best tool for the job. The starter kit includes Jest configuration to automatically collect code coverage information.

- **ESLint configuration**. We're firm believers in [the need for consistent code][cc] and therefore the starter kit ships with a pre-configured ESLint set up, along with Husky and lint-staged to efficiently lint and auto-fix code at commit time.

## Usage

The Serverless CLI allows you to scaffold a new Serverless application from a template on GitHub. Run the following command to use our starter kit:

```sh
serverless create --template-url https://github.com/orangejellyfish/serverless-starter --path your/local/path
```

## What's next?

We think that the feature set provided by this starter kit give you a really solid start for any Serverless application but it's only the basics. Watch this space for more advanced kits, built upon this one, in the future, adding pre-configured support for things like DynamoDB.

[oj]: https://www.orangejellyfish.com/
[sls]: https://serverless.com/framework/
[gatsby]: /blog/introducing-our-gatsby-starter-kits/
[repo]: https://github.com/orangejellyfish/serverless-starter
[mssk]: https://github.com/postlight/serverless-babel-starter
[pl]: https://github.com/postlight
[n8]: https://aws.amazon.com/blogs/compute/node-js-8-10-runtime-now-available-in-aws-lambda/
[wp4]: https://medium.com/webpack/webpack-4-released-today-6cdb994702d4
[so]: https://github.com/dherault/serverless-offline
[jest]: https://jestjs.io/
[cc]: /blog/code-consistency-with-eslint-and-husky/