{"id":15091687,"url":"https://github.com/saiorama/remake-serverless","last_synced_at":"2026-01-20T02:09:38.499Z","repository":{"id":170258067,"uuid":"443043818","full_name":"saiorama/remake-serverless","owner":"saiorama","description":"Read and write JSON files to (my) S3 using presigned urls (needs an account). To write to your own S3, fork this code, edit constants in `scratchpad.js`, and specify the right env vars in your presigned url lambda","archived":false,"fork":false,"pushed_at":"2022-01-13T14:18:15.000Z","size":19,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T17:11:44.502Z","etag":null,"topics":["aws","aws-lambda","aws-s3","cognito","handlebars","handlebarsjs","remake"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saiorama.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-30T10:38:12.000Z","updated_at":"2023-01-28T15:30:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"c04a82c3-e6c6-49fd-a4f5-a3e807f28c79","html_url":"https://github.com/saiorama/remake-serverless","commit_stats":null,"previous_names":["saiorama/remake-serverless"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saiorama%2Fremake-serverless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saiorama%2Fremake-serverless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saiorama%2Fremake-serverless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saiorama%2Fremake-serverless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saiorama","download_url":"https://codeload.github.com/saiorama/remake-serverless/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247386680,"owners_count":20930694,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","aws-s3","cognito","handlebars","handlebarsjs","remake"],"created_at":"2024-09-25T10:42:44.564Z","updated_at":"2026-01-20T02:09:38.436Z","avatar_url":"https://github.com/saiorama.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## remake-serverless\n\n### Getting Oriented\n\n`remake-serverless` is built on top of the `remake` client side [framework](https://github.com/remake/remake-framework). \n\n`remote-serverless` provides a serverless, globally available backend to store JSON files spit out by the core `remake-framework`. The original remake framework linked above uses an express server to receive and persist files.\n\n`ScratchPad` is the name of the serverless backend which manages user auth (built on AWS Cognito), generation of presigned urls (AWS Lambda + S3), and saving json files to S3.\n\n1. User auth is used to create and limit users to a user specific namespace in the ScratchPad backend\n2. Presigned URLs are a safe way to PUT JSON files in S3\n3. Your JSON files are publicly visible \n\n### Getting Started\n\n1. Clone this repository `git clone https://github.com/saiorama/remake-serverless.git`\n2. ...then `cd remake-serverless`\n3. Start `http-server` or any other such static website server\n3. Visit `http://localhost:8080/remake.html`\n\nYou should see a set of To-Dos along with a message that you need to signup/login to use the ScratchPad server. Without signing up, you will only be able to save and read JSONs locally.\n\nClicking on the Sign up/Login link takes you to an AWS Cognito page where you can create or log in to your ScratchPad account\n\n### Saving your latest JSON to ScratchPad\n\nEvery time you click on `Save`, it automatically writes the JSON file to S3. Keep in mind that this is just a demo repository. Your own implementation will vary, e.g., you can choose to implement periodic saves.\n\n### Reading your JSON files from ScratchPad\n\nLogin and then refresh the page, it should read the latest JSON file from SratchPad. Keep in mind that this is just a demo repository. Your own implementation will vary, e.g., in your project, you can force the user to click on a button before loading the JSON.\n\n## FAQs\n\n1. What is my namespace?\n\nAll JSON files are stored inside user specific directories inside the main ScratchPad bucket. The root URL of that directory is `https://moogle.cc/gallery/nirvaancms/attachments/`. Inside the root URL, each ScratchPad user gets a direcctory whose name is determined is as follows - strip out any non-alphanumeric character from the email you used to sign up for ScratchPad. That's your working directory. E.g., if you use name@example.com to sign up for ScratchPad, your working directory is `nameexamplecom`. The URL of your working directory will be `\u003cROOT-DIRECTORY\u003e/nameexamplecom`.\n\nThis becomes your namespace\n\n2. Can I create subdirectories within my namespace?\n\nYes. While requesting a presigned URL from the ScratchPad backend, you have to send a query param called `filename`. `Filename` can be the full path to a specific json file.\n\nE.g., if you are using this repo for a class project for a CS101 course, you may want to save files inside `classprojects/cs101/content.json`. In this case, simply pass `classprojects/cs101/content.json` as the `filename` parameter.\n\n3. How do I name my JSON files?\n\nBy default, filenames are generated by replacing all non-alphanumeric chars in the current URL (minus http:// or https://)into hyphens.\n\nE.g., if you are using remake on `https://example.com/classproject/cs101/index.html`, the default json filename will be `example-com-classprojects-cs101-index-html.json`\n\nOf course, this is just a demo project so you can implement your own naming convention for JSON file names.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaiorama%2Fremake-serverless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaiorama%2Fremake-serverless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaiorama%2Fremake-serverless/lists"}