Skip to content

nathants/aws-gocljs

Repository files navigation

AWS-GOCLJS

Why

So you can just ship fullstack web on AWS.

How

Start with working implementations of everything, then iterate.

Fast and reliable automation.

Easy browser testing.

The tightest possible security policy, no other JS can ever run.

What

A project scaffold for a fullstack webapp on AWS with an infrastructure set ready-to-deploy with libaws.

The project scaffold contains:

  • A Go Lambda backend.
  • A ClojureScript React frontend.
  • S3 and DynamoDB for state.
  • HTTP and WebSocket APIs.
  • Logging.
  • DevOps.

A live demo is here.

Lambda Zip

The Lambda zip contains only 3 files:

>> ls -lh | awk '{print $9, $5}' | column -t

favicon.png    2.7K # favicon
index.html.gz  296K # web app
main           15M  # go binary

The index.html.gz:

<!DOCTYPE html>
<html>
    <head>
      <meta charset="utf-8">
      <meta http-equiv="Content-Security-Policy" content="script-src 'sha256-${JS_SHA256}'">
      <link rel="icon" href="/favicon.png">
    </head>
    <body>
        <div id="app"></div>
        <script type="text/javascript">
          ${JS}
        </script>
    </body>
</html>

The lambda zip itself:

>> ls -lh | awk '{print $9, $5}'
lambda.zip 4.6M

Demo

Dependencies

Use the included Dockerfile or install the following dependencies:

AWS Prerequisites

  • AWS Route53 has the domain or its parent from env.sh

  • AWS Acm has a wildcard cert for the domain or its parent from env.sh

Install

git clone https://github.com/nathants/aws-gocljs
cd aws-gocljs
cp env.sh.template env.sh # update values

Usage

bash bin/check.sh         # lint
bash bin/preview.sh       # preview changes to aws infra
bash bin/ensure.sh        # ensure aws infra
bash bin/dev.sh           # iterate on backend and frontend
bash bin/logs.sh          # tail the logs
bash bin/delete.sh        # delete aws infra

About

just ship web on aws

Resources

License

Stars

43 stars

Watchers

2 watching

Forks

Contributors