An open API service indexing awesome lists of open source software.

https://github.com/thesoftwarehouse/serverless-boilerplate

Boilerplate for serverless framework applications
https://github.com/thesoftwarehouse/serverless-boilerplate

Last synced: about 1 month ago
JSON representation

Boilerplate for serverless framework applications

Awesome Lists containing this project

README

        




Current travis build:
build status

##

Boilerplate code for rapidly creating ready-to-deploy Serverless Framework services.

##

### Quick Start

- **Install**

```
npm install
```

rename .env.dist to .env, fill all information

- **Create lambda or workflow**

```
npm run plop
```

##

### Development Local

- docker-compose up
- npm install
- rename .env.dist to .env
- fill all information
- npm run run-migrations
- npm run dev

### Debugging locally

Serverless uses workers to run lambdas locally. To debug them in your IDE you need to add `--useInProcess` flag, or run the following command:

```
npm run dev-with-debug
```

##

### Run workflow locally

```
npm run start-workflow --workflow=NAME_OF_THE_WORKFLOW
```

### Follow workflow logs

To follow all the logs from the step function executions you can use the command:

```
npm run get-sf-logs
```

##

### Develop workflow

We support ASL for Step Functions. Make sure to install AWS Toolkit so you can render graph for step functions and validate its syntax easily.

##

### SonarQube configuration

Before deployment, please ensure that a related SonarQube project has been created. After that set proper repository variables (`SONAR_TOKEN` and `SONAR_HOST_URL`) and properties in `sonar-project.properties` file.

##

### Deploy

The best choice for deployment is the bitbucket pipeline.

Deployment [pipeline](bitbucket-pipelines.yml) consist of two steps:

1. compile (automated start)
- build
- run lambda offline
- run test
2. deploy (user action required)

##

### Other good source of information

- https://serverless.com/framework/docs/providers/aws/guide/variables/
- https://serverless.com/framework/docs/providers/aws/cli-reference/config-credentials/

##

### What do we use for testing lambdas?

1. [supertest](https://github.com/visionmedia/supertest#readme)
1. [mocha](https://mochajs.org/)

Here you can check example tests: [handler.spec.ts](functions/example-lambda/tests/handler.spec.ts)

##

### What do we use for validating schemas?

We use [zod](https://zod.dev/) for schema validation.

##

### **Issues:**

If you notice any issues while using, let as know on **[github](https://github.com/TheSoftwareHouse/serverless-boilerplate/issues)**.
Security issues, please send on email

### **You may also like our other projects:**

- **[RAD Modules](https://github.com/TheSoftwareHouse/rad-modules)**
- **[RAD Modules Tools](https://github.com/TheSoftwareHouse/rad-modules-tools)**
- **[Kakunin](https://github.com/TheSoftwareHouse/Kakunin)**
- **[Babelsheet-js](https://github.com/TheSoftwareHouse/babelsheet-js)**
- **[Fogger](https://github.com/TheSoftwareHouse/fogger)**

### **About us:**


The Software House

tsh.png

##

### License

[![license](https://img.shields.io/badge/license-MIT-4dc71f.svg)](https://raw.githubusercontent.com/TheSoftwareHouse/serverless-boilerplate/main/LICENSE)

This project is licensed under the terms of the [MIT license](/LICENSE).