Remake-Serverless — use Remake without a server
--
This is Part 2 of a two part series introducing you to Remake. This is Part 1 which covers the rationale behind using Remake.
tl;dr; — a deep dive into Remake’s serverless version backend.
Full Disclosure — remake-serverless
hhas little to do with remake
proper. David Miranda has graciously helped me better understand and appreciate remake
but, at the end of the dayremake-serverless
scratches a personal itch — since I’m very much invested in the Serverless ecosystem, particularly AWS, remake
in its original form wouldn’t work for me.
Introduction
In Part 1, I briefly talked about remake-serverless (Github)
which makes it possible for you to use Remake without needing to spin up an Express server.
In this article, I will dive more deeply into how we can use remake-serverless
to read and write data to an S3 backend instead of relying on an Express server.
Orientation
Since we are going to use Remake in a Serverless environment, we can no longer rely on the Express server to manage user auth and file management.
Therefore, user auth is being handled by AWS Cognito while file management is being handled by a combination of S3 and a single Lambda function.
Of course, once you understand how these are being used, you can always fork the repo and use your own Auth and file management subsytems.
Note that JSON files you save to the Serverless backend are publicly available and visible to anyone who knows the URL. It is delivered globally using CloudFront, AWS’s CDN.
First things first
- Clone this repository
git clone https://github.com/saiorama/remake-serverless.git
- …then
cd remake-serverless
- Start
http-server
or any other such static website server - Visit
http://localhost:8080/remake.html
Signup
When you first visit the above URL, you will notice a message like the below. Clicking on Sign up/login will kick off the Cognito account creation flow.