# Introducing Scaffoldly

{% embed url="<https://youtu.be/N_i9dDo0br8>" %}

Many frameworks are great at getting you started, but drop the ball when it comes time to deploy, so you're left to patchwork your own solution together to get your project hosted in the Cloud, which can sometimes take a month of clicking around in the cloud console to get your project to host on your own domain name.

Scaffoldly is picking up the ball. We're taking those frameworks and taking it a step further.

Scaffoldly uses Open Source and widely accepted tools such as [Terraform](https://terraform.io), [Serverless](https://serverless.com) and [GitHub](https://github.com). You bootstrap your project with a few lines of "Infrastructure Code" and Scaffoldly provisions and secures an AWS account, and provides templates that are ready to launch so you can [get down to business](https://open.spotify.com/track/6f3Slt0GbA2bPZlz0aIFXN?si=0cf95135cc9b424e).

Scaffoldly provides [Open Source](https://github.com/scaffoldly) templates and automations. You can have a fully functional, secure, and infinitely scalable infrastructure within minutes instead of months.

## Who's it For?

Scaffoldly is for **Startups** and **Personal Projects**. Ideally, you've written no code and you're starting with an idea and you're ready to code, but need a place to start.

## What Does it Do?

Scaffoldly aims to set up all of the primitives of hosting your project while not relinquishing any of the control to evolve over time. You own the code and infrastructure from end-to-end.

### Infrastructure

* **Infinitely Scalable**: Scaffoldly uses highly-scalable infrastructure services from AWS (Lambda, API Gateway, CloudFront). They're the experts at scaling, so you don't have to be.
* **Infrastructure-as-Code**: No more clicking around in the AWS Console "trying to get things to work". All infrastructure changes are managed via reviews and releases.
* **Cost Conscious**: Scaffoldly leverages Cloud Services that are pay-as-you-go (Lambda, CloudFront, S3, API Gateway, etc) so your month-to-month hosting costs are pennines on the dollar, and you're not paying dearly for "Idle Infrastructure".
* **Multiple Environments**: Scaffoldly provisions Non-Live and Live "environments/stages" so you have a safe place to experiment with your platform before making them available to the world.

{% hint style="success" %}
**Projects provisioned using Scaffoldly cost less than $0.15/day in Cloud costs**
{% endhint %}

### Security

* **Service-Level Identity**: Every service has an identity based on its GitHub repository name and every dependent service contains that name to restrict its access to just what it needs.
* **Logging/Auditing**: Scaffoldly automatically enables logging of your AWS Cloud Activity and Applications and those logs cannot be tampered with.
* **SSL/TLS**: Scaffoldly provisions SSL Certificates for your domain(s) so communication to your Portals and APIs are secure by default.
* **Authentication/Authorization**: Scaffoldly provides an Authentication/Authorization service out-of-the box that manages user authentication via JWT tokens that are usable throughout your Organization.
* **Complete Control**: All code is completely modify-able by you, there's no "black box".

### Applications and Services

* **Microservices**: Scaffoldly embraces the microservices architecture with a slight twist, instead of Docker Containers, each service contains multiple individual Lambda Functions that are name spaced by the GitHub repository and stage and presented as a single service.
* **Service Discovery**: Scaffoldly places a configuration file in each managed repository with a map of each service and how to communicate with them. No more complicated service mesh and discovery.
* **JWT Tokens**: Scaffoldly provides an Authentication API to generate JWT tokens for users that can be used across all applications and all services.
* **OpenAPI**: Each backend service automatically generates an OpenAPI specification and  using [tsoa decorators](https://tsoa-community.github.io/docs/) (on the backend) and the [OpenAPI generator](https://github.com/scaffoldly/openapi-generator) (backends and frontends) for a tight API contract between your backends and frontends.

### DevOps

* **Continuous Integration:** Each check-in to the main branch of a repository triggers a build and releases to Non-Live.
* **Continuous Delivery**: Each Non-Live deployment creates a Pre-Release in GitHub. When you're ready to go live, click a button in GitHub.
* **Infrastructure Changes**: Instead of running Terraform from your Laptop or clicking around in the AWS Console, all [Infrastructure-as-Code](https://en.wikipedia.org/wiki/Infrastructure_as_code). All changes are previewed and applied using GitHub Actions and GitHub Releases. Each change is versioned and there's a full audit trail and everything is predictable and uses a familiar pattern for deploying code.

## How Do I Set Started?

Start building using [Scaffoldly Start](https://start.scaffold.ly)!

Also [Join the Community on Slack](https://scaffold.ly/community)!


# How To's

## Popular How To's

### Infrastructure

#### [Find Logs](/how-tos/infrastructure/aws/finding-logs)

#### [Add Custom Terraform](/how-tos/infrastructure/terraform/custom-terraform)

#### [Deploying Changes](/how-tos/infrastructure/terraform/deploying-changes)

[Other Infrastructure How To's](/how-tos/infrastructure)

### Microservices

#### [Run Microservices Locally](/how-tos/microservices/running-locally)

#### [Add Additional Microservices](/how-tos/microservices/adding-additional-microservices)

#### [Authenticate Users within Microservices](/how-tos/microservices/user-authentication)

#### [Add API Endpoints](/how-tos/microservices/adding-api-endpoints)

#### [Deploy Changes](/how-tos/microservices/deploying-changes)

[Other Microservice How To's](#microservices)


# Infrastructure


# AWS


# Finding Logs

Documentation is in the works, [message us in #help](https://scaffold.ly/community) if you need this now.


# Migrate Account Away from the Scaffoldly Organization

This document details how to move an AWS account that was created by Scaffoldy to be a standalone root account or to migrate an account to a different AWS Organization

{% hint style="success" %}
Scaffoldly will still be able to automate and assist with infrastructure and code deployments
{% endhint %}

{% hint style="warning" %}
You can complete these steps after **7 days after** your account was first created, due to AWS Organizations rules.
{% endhint %}

### Get your Account Email Address

You can find it on the [Scaffoldly Dashboard](https://start.scaffold.ly/dashboard)

![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FwFDTIGn71F5IJNNAOPRK%2FScreen%20Shot%202021-10-20%20at%204.59.14%20PM.png?alt=media\&token=e485a059-5de8-4132-af26-40e71ba0afed)

### Go to the AWS Sign In Page

{% embed url="<https://signin.aws.amazon.com/signin>" %}

### Sign in with your account email address

![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FWpjgLctpAgY5KlSJtHq2%2FScreen%20Shot%202021-10-20%20at%205.00.27%20PM.png?alt=media\&token=14f5a49d-539d-4caa-a2e0-f9d2db87169b)

### Click 'Forgot Password'

![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2Ftthv13gzYcsnBsCDPD39%2FScreen%20Shot%202021-10-20%20at%204.56.40%20PM.png?alt=media\&token=bcaf84eb-6818-4a0b-8196-028f1eb592b2)

### Check the 'Forwards Email To' email account for the Password Reset instructions

![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FrA5Xo5oGIoFqXeslfXEJ%2FScreen%20Shot%202021-10-20%20at%205.04.18%20PM.png?alt=media\&token=c896bce8-09e7-490a-8db2-1338ad15c6e2)

### Log into the AWS Console and go to AWS Organizations

{% embed url="<https://console.aws.amazon.com/organizations/v2/home/dashboard>" %}

### Click "Leave Organization"

![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FBvQqbEvWgcyfzHrLkolD%2FScreen%20Shot%202021-10-20%20at%205.08.27%20PM.png?alt=media\&token=0061c9a3-6c35-4854-ace0-6fb0ee9ecce6) ![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2Fdk9jYJxclLL0UEY3QbT6%2FScreen%20Shot%202021-10-20%20at%205.08.37%20PM.png?alt=media\&token=37dafe62-6944-4889-af6f-f6e05899376b)

### Follow the prompts and provide your billing information

![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FMWTuDnb6me8EwBjs7gIk%2FScreen%20Shot%202021-10-20%20at%205.10.53%20PM.png?alt=media\&token=13f62188-f1ec-4439-9f9f-ddfc697341f3)

### Go back to AWS Organizations and click "Leave Organization"

{% hint style="success" %}
Your AWS account is now under your own control and billing!
{% endhint %}


# Terraform


# Custom Terraform

Documentation is in the works, [message us in #help](https://scaffold.ly/community) if you need this now.


# Deploying Changes

{% hint style="info" %}
For some coarse instructions, check out the README in your Microservice's repository
{% endhint %}

Documentation is in the works, [message us in #help](https://scaffold.ly/community) if you need this now.


# Microservices


# Running Locally

This page explains how to run a Microservice locally

After building, Scaffoldly created new repositories in your GitHub Organization. It's easy to run and debug them locally.

### Clone the Repository

```
➜  ~ git clone git@github.com:scaffoldly-demo/auth-sls-rest-api.git
Cloning into 'auth-sls-rest-api'...
remote: Enumerating objects: 98, done.
remote: Counting objects: 100% (98/98), done.
remote: Compressing objects: 100% (80/80), done.
remote: Total 98 (delta 20), reused 79 (delta 11), pack-reused 0
Receiving objects: 100% (98/98), 252.23 KiB | 1.24 MiB/s, done.
Resolving deltas: 100% (20/20), done.
```

### Download Dependencies

Run the `yarn` command

```
➜  ~ cd auth-sls-rest-api
➜  auth-sls-rest-api git:(main) yarn
yarn install v1.22.11
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
...
yarn run v1.22.11
$ tsc
✨  Done in 16.64s.
✨  Done in 135.47s.
```

This will take a minute or so...

### Starting the Application

#### Command Line

Run `yarn start` to launch the Application

```
➜  auth-sls-rest-api git:(main) ✗ yarn start
yarn run v1.22.11
$ SLS_DEBUG=* serverless offline start
Serverless: Load command interactiveCli
Serverless: Load command config
...
   ┌─────────────────────────────────────────────────────────────────────────────────────┐
   │                                                                                     │
   │   ANY     | http://localhost:3000/auth                                              │
   │   POST    | http://localhost:3000/2015-03-31/functions/lambda-handler/invocations   │
   │   OPTIONS | http://localhost:3000/auth                                              │
   │   POST    | http://localhost:3000/2015-03-31/functions/lambda-handler/invocations   │
   │   ANY     | http://localhost:3000/auth/{proxy*}                                     │
   │   POST    | http://localhost:3000/2015-03-31/functions/lambda-handler/invocations   │
   │   OPTIONS | http://localhost:3000/auth/{proxy*}                                     │
   │   POST    | http://localhost:3000/2015-03-31/functions/lambda-handler/invocations   │
   │                                                                                     │
   └─────────────────────────────────────────────────────────────────────────────────────┘

offline: [HTTP] server ready: http://localhost:3000 🚀
offline:
offline: Enter "rp" to replay the last request
```

This should take 20-30 seconds to start...

#### Within VSCode

Open the Repository in VSCode, and in the **Debug** menu, click the **Play** icon next to **Local Debug**

![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FwsGSlMor9WLPY1HubLQ3%2FScreen%20Shot%202021-10-20%20at%205.55.24%20PM.png?alt=media\&token=e20540e3-d644-4ef7-99c5-ff1bcafb169c) ![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FVd8O0RYPKaIGJUPNJdjI%2FScreen%20Shot%202021-10-20%20at%205.55.45%20PM.png?alt=media\&token=3b8dbf22-930b-45f3-8447-860d47aa5613)

![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2F7S7U8vAU1ORrsQiV6Hwa%2FScreen%20Shot%202021-10-20%20at%205.58.25%20PM.png?alt=media\&token=5c1474f7-1eda-4ef1-a175-109986f087b3)

You'll see the output in the VSCode Terminal and Debug Console.

### Use the Application

Here's a couple examples:

```
➜  ~ curl http://localhost:3000/auth/version
{"version":"1.0.0-2"}%
```

```
➜  auth-sls-rest-api git:(main) ✗ curl http://localhost:3000/auth/api/health
{"name":"auth-sls-rest-api","healty":true,"now":"2021-10-21T00:59:48.627Z","version":"1.0.0-2"}%
```

#### Swagger UI

> <https://localhost:3000/auth/swagger.html>

### Debug The Application

If you ran the project with VSCode, you can set breakpoints.

![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FyfWdAC3NZP8yObUUly5j%2FScreen%20Shot%202021-10-20%20at%206.02.14%20PM.png?alt=media\&token=cbb37e75-46a4-4441-8250-b65bcc9c7506) ![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FpQScdlkKSesirb6Px7BN%2FScreen%20Shot%202021-10-20%20at%206.02.39%20PM.png?alt=media\&token=59bc8273-144c-42f7-aa6d-77dca4e6cab5)


# Adding Additional Microservices

## Using [Scaffoldly Start](https://start.scaffold.ly)

The Scaffoldly Dashboard is an upcoming feature. Follow and upvote it in the [Issue Tracker](https://github.com/scaffoldly/start.scaffold.ly/issues/1).

For now, complete the steps Manually.

## Manually

The following instructions will allow you to provision a new Service the same way that Scaffoldly Start provisions them when the Infrastructure is first created.

### Create a Repository from the [GitHub Template](https://github.com/scaffoldly/github-template/generate)

* Add it to your Organization or User account managed by Scaffoldly
* Repository Naming:
  * Let's assume you want to call this service `payments` and have it accessible at `https://{{your-domain}}/payments`
  * Name the repository `payments-sls-rest-api` (all lower case, delimited with hyphens)
  * If you prefer, make it Private

### Render the Code Base from the Serverless Express Archetype

1. Go to **Actions** for the new repository
2. Choose **Render Template** then click **Run Workflow**
   1. **Archetype Source Git URL**&#x20;

      <https://github.com/scaffoldly/archetype-express-serverless-rest-api.git>
   2. **Archetect Render Options**

      `-s overwrite -s github -s serverless -s entity -a repository-name=payments-sls-rest-api -a persistence=dynamodb -a entities=example -a auth=true`

      1. *NOTE*: Update `repostiory-name` to match the repository name
      2. *NOTE*: Omit `-a auth=true` if you did NOT add the Authentication service (e.g.`auth-sls-rest-api` is not in your User/Organization
   3. **GitHub Token**
      1. Create and Provide a [Personal Access Token](https://github.com/settings/tokens) (if you don't already have one) that has `workflow` and `repo` permissions.
         1. NOTE: This token isn't stored anywhere, it is used once in the GitHub Action to commit changes to the repository

Click **Run Workflow**. In a few moments, you will see the Repository populated.

### Update the Scaffoldly Bootstrap Project

1. Navigate to the `scaffoldly-bootstrap` project
2. Go to **Actions**
3. Choose **Render Template** then click **Run Workflow**
   1. **Archetype Source Git URL**

      <https://github.com/scaffoldly/archetype-scaffoldly-bootstrap.git>
   2. **Archetect Render Options**

      `-s overwrite -s aws -s github -s serverless-api -a serverless-api-repos=payments-sls-rest-api`
   3. **GitHub Token**
      1. Use the same Personal Access Token from earlier

Click **Run Workflow**. In a few moments, you will see additional files added to the repository

* `aws-serverless-api-payments-sls-rest-api.tf`
* `aws-serverless-api-payments-sls-rest-api-github.tf`

### Provision the New Service

1. Within the `scaffoldly-bootstrap` project, go to **Actions**
2. Choose **Terraform Plan** then **Run Workflow**
3. No additional options are needed here, so click **Run Workflow** to start a `terraform plan` operation

A new Release will be created, which can be found by clicking **Releases** on the `scaffoldly-bootstrap` repository home page in GitHub.

![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2Fp27bqL4f34n1gFadDvq7%2FScreen%20Shot%202021-10-27%20at%208.59.01%20AM.png?alt=media\&token=bb8fe969-70e6-4b9f-8bdb-242b781afcee) ![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FD0yJreBKfH9v1GeW8ar3%2FScreen%20Shot%202021-10-27%20at%208.59.17%20AM.png?alt=media\&token=c04033e0-2056-4494-afef-b147861ff14f)

Click the **Edit** icon (✎) and then click **Publish release**

Back under **Actions** you will be able to see the changes made to AWS under the **Terraform Apply** GitHub Action.

### Initial Nonlive Deploy

After the **Terraform Apply** is complete, navigate back to your new Repository and go to **Actions**. Our automations kicked off a **Nonlive Deploy** for you.&#x20;

If this did not happen please contact `#help` in our [Scaffoldly Slack](https://scaffold.ly/community).


# User Authentication

If you enabled the Authentication microservice, additional services are pre-wired to use it for pass-through authentication.

Within other microservices, use the `@Securty('jwt')` annotation in the Controller on methods to enforce that an `Authorization` header is required with the request.

![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FMHshJTZ2sqGJ9rDBJJMa%2FScreen%20Shot%202021-10-20%20at%206.14.48%20PM.png?alt=media\&token=379dfe1b-2c99-44bf-acf8-7d1b5ae89f34)

### Testing Authentication Locally

Microservices running **Locally** are configured to allow authentication tokens from the **Nonlive** environment.

Go to the [Scaffoldly Dashboard](https://start.scaffold.ly/dashboard) and find the JWT Token Generator

![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FF1gM81K0BH1oIxqQZQx5%2FScreen%20Shot%202021-10-20%20at%206.14.30%20PM.png?alt=media\&token=97490f2b-24c8-48d5-b380-3cc0c6c77d36)

By default, emails can only be sent to your Scaffoldly email account, also shown on the Dashboard

![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FwFDTIGn71F5IJNNAOPRK%2FScreen%20Shot%202021-10-20%20at%204.59.14%20PM.png?alt=media\&token=e485a059-5de8-4132-af26-40e71ba0afed)

![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2F1LiJZxxmv2rLV5ZmA68P%2FScreen%20Shot%202021-10-20%20at%206.22.43%20PM.png?alt=media\&token=2cb77abe-7998-49ed-be43-580280a31ae5) ![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FTZy63ZAQ6VZuRvrDmMP4%2FScreen%20Shot%202021-10-20%20at%206.24.14%20PM.png?alt=media\&token=b01665d5-8c3a-4438-87c7-cadef2b19d15) ![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FNRogFBGeBadSEfbOWKpV%2FScreen%20Shot%202021-10-20%20at%206.24.55%20PM.png?alt=media\&token=bc41e8df-5d86-4bc1-a9d3-3f0b5d22149e) ![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2F6nAGyCavg0G729eDBcd8%2FScreen%20Shot%202021-10-20%20at%206.25.14%20PM.png?alt=media\&token=a4ea19db-1eb7-490f-9436-e327d918dac0)

Run your [Microservice locally](/how-tos/microservices/running-locally) (optionally in [Debug Mode](/how-tos/microservices/running-locally#debug-the-application)), and open the [Swagger UI](/how-tos/microservices/running-locally#use-the-application)

Click **Authorize** and paste the token, and invoke an endpoint with the padlock icon.

If you've set a breakpoint, you can see that the `httpRequest.user` is populated with the user's identity.

![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FVWg8C494oRaj5L70Fhfp%2FScreen%20Shot%202021-10-20%20at%206.29.38%20PM.png?alt=media\&token=f9267e35-4baa-4e89-bc55-285ce61f3ee3) ![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2Fh0S7d7xh5RtsdqXIQwaq%2FScreen%20Shot%202021-10-20%20at%206.29.55%20PM.png?alt=media\&token=caf2333b-afee-4d76-bff1-cfde921ba92e) ![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FdsP7yYctzWKo4Pm9mfiv%2FScreen%20Shot%202021-10-20%20at%206.31.30%20PM.png?alt=media\&token=eee62dc9-cdec-4872-94e3-97bece7e1c57) ![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2Fa48vkx7KayN8rKpNfMDj%2FScreen%20Shot%202021-10-20%20at%206.32.22%20PM.png?alt=media\&token=7635e921-2a5c-4aee-85de-501a7fac3531) ![](https://968799697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKLlfWGgG_lqg_w6lw2%2Fuploads%2FGwg5lNpIhv2kGUVZ3MRe%2FScreen%20Shot%202021-10-20%20at%206.33.00%20PM.png?alt=media\&token=958421b0-f321-481d-822f-0a08a2c1b2f4)


# Adding API Endpoints

Documentation is in the works, [message us in #help](https://scaffold.ly/community) if you need this now.


# Storing and Retrieving Data

Documentation is in the works, [message us in #help](https://scaffold.ly/community) if you need this now.


# Deploying Changes

{% hint style="info" %}
For some coarse instructions, check out the README in your Microservice's repository
{% endhint %}

Documentation is in the works, [message us in #help](https://scaffold.ly/community) if you need this now.


# FAQs

A collection of FAQs compiled from the Slack Community

FAQs are in the works, [message us in #help](https://scaffold.ly/community) if you have a question or issue and we'll make sure you're informed and our documentation gets updated!


# Roadmap

What do we have up and coming? Check out our Project Board

{% embed url="<https://github.com/orgs/scaffoldly/projects/2>" %}

If you'd like to raise a new issue, [message us in #help](https://scaffold.ly/community) and we'll add it to the Issue Tracker.


# Contributing

We're so glad you're interested in Contributing to Scaffoldly or interested in learning more about our open source tooling.

If you'd like to contribute, [Join the Slack Community](https://scaffold.ly/community) and hop into the `#contributing` channel.

You can also check out the various Open Source Tooling we provide, maintain, use, and contribute to below.

## Open Source Components

Scaffoldly outfits a User or Organization with a lot of tooling. For transparency, we have open-sourced the tooling and components for full transparency of stacks we create and manage

### Infrastructure

#### Terraform for AWS

When the `scaffoldly-bootstrap` project is created, it's created using the [Terraform AWS Archetype](https://github.com/scaffoldly/archetype-scaffoldly-bootstrap).

The `scaffoldly-bootstrap` then configures an AWS account using the [Terraform AWS Bootstrap](https://github.com/scaffoldly/terraform-aws-bootstrap) Terraform Module, which is generally available in [Terraform Registry](https://registry.terraform.io/modules/scaffoldly/bootstrap/aws), as well as the [Additional Modules](https://registry.terraform.io/search/modules?namespace=scaffoldly) that are used. Links to the GitHub repositories can be found in each module within the [Scaffoldly Project on GitHub](https://github.com/scaffoldly).

### Code Templates

When Scaffoldly creates Microservices, we've partnered with an open-source template rendering tool called [Archetect](https://github.com/archetect/archetect). Scaffoldly has developed a [GitHub Action for Archetect](https://github.com/scaffoldly/archetect-render-action) to render Archetypes on a repository, and all projects are created using the [GitHub Template](#open-source-components).

#### Serverless Express Microservices

When Microservices are created, they're creating using the [Serverless Express REST API Archetype](https://github.com/scaffoldly/archetype-express-serverless-rest-api). Various different ways we customize options in the generated tempates build it can be found [here](https://github.com/scaffoldly/archetype-express-serverless-rest-api/blob/2c4358a197c8daa13ec4f4d0865995a26b8a0d6b/.github/workflows/push-main.yml#L14-L21).

### CI/CD

#### Infrastructure

Scaffoldly provides a [Bootstrap Action](https://github.com/scaffoldly/bootstrap-action) to execute `terraform plan` and `terraform apply` operations within GitHub. This is automatically added to the `scaffoldly-bootstrap` repositories during [Template Rendering](https://github.com/scaffoldly/archetype-scaffoldly-bootstrap/tree/main/github/.github/workflows).

#### Microservices

Scaffoldly provides a [Bump Version Action](https://github.com/scaffoldly/bump-version-action) to execute deploys to AWS for `nonlive` and `live` environments. This is automatically added to each Microservice during [Template Rendering](https://github.com/scaffoldly/archetype-express-serverless-rest-api/tree/main/github/.github/workflows).

### Libraries

#### TypeScript

For each Serverless Express REST API that is generated, the [serverless-util](https://github.com/scaffoldly/serverless-util) [NPM package](https://www.npmjs.com/package/@scaffoldly/serverless-util) is added to simplify interaction with various components in AWS, such as Getting/Fetching Secrets, interacting with DynamoDB, and much more.

### Utilities

#### OpenAPI Generation

We've leveraged the [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) project to automatically generate OpenAPI/Swagger docs when the project is built. In TypeScript, it auto-generates the OpenAPI document using [Tsoa](https://github.com/lukeautry/tsoa).

We've written a [Wrapper to the OpenAPI CLI](https://github.com/scaffoldly/openapi-generator) to discover and auto-generate OpenAPI docs for each [microservice in your project](https://github.com/scaffoldly/archetype-express-serverless-rest-api/blob/2c4358a197c8daa13ec4f4d0865995a26b8a0d6b/immutable/serverless/package.json#L12).

#### Dotenv

Each Microservice is outfitted with [Dotenv](https://www.npmjs.com/package/dotenv). To standardize environment variable injection from multiple locations in your project, we've written the [dotenv-out](https://www.npmjs.com/package/dotenv-out) CLI to write [multiple dotenv configurations to a single file](https://github.com/scaffoldly/archetype-express-serverless-rest-api/blob/2c4358a197c8daa13ec4f4d0865995a26b8a0d6b/immutable/serverless/package.json#L11) in various formats.

### Documentation

The documentation that you're reading now is [Open Source](#docs) and we welcome contributions to it. The documentation is hosted generously for free by [GitBook](https://gitbook.com).


# Credits

A lot of people put a lot of work in, we merely connected them together. Give them 👏!

## [ngx-rocket](https://github.com/ngx-rocket)

They provided an excellent starting point for our Angular template

## [Serverless](https://github.com/serverless)

The entire API deploy pattern is build on this.

## [Terraform](https://github.com/hashicorp/terraform)

All infrastructure is built with this tool

## [tsoa](https://github.com/lukeautry/tsoa)

Method decorators in TypeScript for automatic API generation

## [Jose](https://github.com/panva/jose)

JWT Token Generation

## [openapi-generator](https://github.com/OpenAPITools/openapi-generator)

Generation of Client SDKs based on an OpenAPI document

## [serverless-express](https://github.com/vendia/serverless-express)

Making Lambda functions run on Serverless


# Open Source Components

This page is archived. Please see [Contributing](/contributing).


