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-serverlesshhas little to do with
remakeproper. David Miranda has graciously helped me better understand and appreciate
remake but, at the end of the day
remake-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.
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-serverlessto read and write data to an S3 backend instead of relying on an Express server.
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
http-serveror any other such static website server
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.