{"id":21252587,"url":"https://github.com/cartercobb/autogram","last_synced_at":"2026-04-12T07:32:48.655Z","repository":{"id":44148526,"uuid":"458312409","full_name":"CarterCobb/Autogram","owner":"CarterCobb","description":"Serverless Instagram Clone","archived":false,"fork":false,"pushed_at":"2022-02-28T21:00:08.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T11:29:07.933Z","etag":null,"topics":["aws-lambda","faas","reactjs","serverless"],"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/CarterCobb.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}},"created_at":"2022-02-11T19:18:23.000Z","updated_at":"2022-02-11T19:22:06.000Z","dependencies_parsed_at":"2022-09-05T06:40:52.785Z","dependency_job_id":null,"html_url":"https://github.com/CarterCobb/Autogram","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CarterCobb/Autogram","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarterCobb%2FAutogram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarterCobb%2FAutogram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarterCobb%2FAutogram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarterCobb%2FAutogram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CarterCobb","download_url":"https://codeload.github.com/CarterCobb/Autogram/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarterCobb%2FAutogram/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31707953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T06:22:27.080Z","status":"ssl_error","status_checked_at":"2026-04-12T06:21:52.710Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-lambda","faas","reactjs","serverless"],"created_at":"2024-11-21T03:48:00.199Z","updated_at":"2026-04-12T07:32:48.635Z","avatar_url":"https://github.com/CarterCobb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Autogram\n\nAn Instagram clone built by Carter J. Cobb\n\n## Details\n\nThis project uses\n\n- AWS Lambda\n- AWS DynamoDB\n- AWS API Gateway\n- AWS EventBridge\n- AWS SQS\n- AWS SES\n- AWS ECR\n- AWS S3\n- React.js\n\nto create a simplified Instagram clone.\n\n## Project description\n\nAutogram is a simplistic Instagram clone. It features, a login, registration form, posts, 24 hour stories, verified accounts, suggested accounts, an explore page, account following logic, and email notifications. There are features still being added that are templated in the current architecture. These include but are not limited to, post likes and post comments.\n\nPlease note that the code in this repository is to build serverless functions (FAAS) through AWS and cannot run standalone.\n\n## Requirements to deploy and run\n\n- AWS account [sign up here](https://portal.aws.amazon.com/billing/signup#/start)\n- AWS CLI installed [download link](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)\n- Node.js installed [download link](https://nodejs.org/en/download/)\n- Docker insalled [download link](https://www.docker.com/products/docker-desktop)\n- WSL2 installed (WindowsOS Only) [download link](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi)\n\n## Recommended but not required items\n\n- Postman installed [download link](https://www.postman.com/downloads/)\n- Visual Studio Code (The Code editor used to develop this project) [download link](https://code.visualstudio.com/download)\n\n## Prepare to run\n\nBecasue this project is built with AWS as a dependancy you will need to follow these instructions closely to run the project.\n\n### Create ECR repositories in AWS\n\nIn order to deploy the lambdas, you will need to create the following blank ECR repositories in AWS [here](https://us-west-1.console.aws.amazon.com/ecr/repositories):\n\n- autogram/account\n- autogram/auth\n- autogram/email\n- autogram/login\n- autogram/remove\n\n### Create an AWS API Gateway\n\nThis is an imprtant step to complete before editing other files.\n\n- Navigate to [AWS API Gateway](https://us-west-1.console.aws.amazon.com/apigateway/main/apis) and click `Create API`.\n- Select `REST API` and click `Build`\n- Keep all the settings default and give the API a name like `Autogram` and click `Create`\n- Keep this tab open for later!!\n\n### Create an AWS S3 Bucket\n\nAWS S3 is the container to store profile pictures, posts, and stories.\n\n- Navigate to [AWS S3](https://s3.console.aws.amazon.com/s3/home) and click `Create Bucket`\n- Give your bucket a name AND keep note of it.\n- Enable ACLs with default settings\n- UNCHECK `Block all public access` and confirm your understanding\n- Keep all other settings default\n\n### Create DynamoDB Tables\n\nThis project requires three tables to be made. Two of whitch must be pre-populated.\n\n- Navigate to [AWS DynamoDB](https://us-west-1.console.aws.amazon.com/dynamodbv2/home) and click `Create table`\n- Create three tables named `permission`, `security_group`, and `users` \u003c- Names are important do NOT neglect these names\n- Enter the `permissions` table and add the following items:\n\n```jsonc\n/*\n* This table contains permissions for users.\n* The intent here was to mock AWS's style for user authentication for a more secure system.\n*/\n\n// Item 1\n{\n    \"id\": \"d1e6e9acb16f03b526d392e52fdb49e6f77d573c\",\n    \"descriptor\": \"CAN_POST_STORY\",\n    \"metadata\": \"{\\\"can_post_story\\\": true}\"\n}\n// Item 2\n{\n    \"id\": \"0abdacaab05aca1be4deb2e73581bf14f32bf492\",\n    \"descriptor\": \"CAN_DELETE_STORY\",\n    \"metadata\": \"{\\\"can_delete_story\\\": true}\"\n}\n// Item 3\n{\n    \"id\": \"370e8fe25ce0646c410588348232a036ad1d2c41\",\n    \"descriptor\": \"IS_ADMIN\",\n    \"metadata\": \"{\\\"is_admin\\\": true}\"\n}\n// Item 4\n{\n    \"id\": \"89e6723e5d370c0e98e9dfbead03442666894859\",\n    \"descriptor\": \"CAN_DELETE_POST\",\n    \"metadata\": \"{\\\"can_delete_post\\\": true}\"\n}\n// Item 5\n{\n    \"id\": \"dac04d4bf710d4bf1fbcb45ee0dd1284604794f6\",\n    \"descriptor\": \"CAN_POST\",\n    \"metadata\": \"{\\\"can_post\\\": true}\"\n}\n// Item 6\n{\n    \"id\": \"9ef964e457e4149c03043ddeafc3f519fb51fc5e\",\n    \"descriptor\": \"IS_VERIFIED\",\n    \"metadata\": \"{\\\"is_verified\\\": true}\"\n}\n```\n\n- Next is to create three user security groups; in the `security_group` table add these items:\n\n```jsonc\n/*\n* This groups are basically lists of permissions.\n* Each group gives access to all the permissions from the last table listed in a group.\n*/\n\n// Item 1\n{\n    \"id\": \"e254c3485122ff610e6c686803f757f3c21ca434\",\n    \"descriptor\": \"USER\",\n    \"permissions\": [\n        \"d1e6e9acb16f03b526d392e52fdb49e6f77d573c\",\n        \"0abdacaab05aca1be4deb2e73581bf14f32bf492\",\n        \"89e6723e5d370c0e98e9dfbead03442666894859\",\n        \"dac04d4bf710d4bf1fbcb45ee0dd1284604794f6\"\n    ]\n}\n// Item 2\n{\n    \"id\": \"820a43084308df6675891b69418228170c8ba827\",\n    \"descriptor\": \"ADMIN\",\n    \"permissions\": [\n        \"370e8fe25ce0646c410588348232a036ad1d2c41\"\n    ]\n}\n//Item 3\n{\n    \"id\": \"254ca7b7dd947f80b54ea6f1da2c396330961d86\",\n    \"descriptor\": \"VERIFIED_USER\",\n    \"permissions\": [\n        \"d1e6e9acb16f03b526d392e52fdb49e6f77d573c\",\n        \"0abdacaab05aca1be4deb2e73581bf14f32bf492\",\n        \"89e6723e5d370c0e98e9dfbead03442666894859\",\n        \"dac04d4bf710d4bf1fbcb45ee0dd1284604794f6\",\n        \"9ef964e457e4149c03043ddeafc3f519fb51fc5e\"\n    ]\n}\n```\n\n### Create AWS role for all resources\n\nIts important to give permissions to the services being used so they can talk to each other.\n\n- Navigate to [AWS roles](https://console.aws.amazon.com/iamv2/home?#/roles) and click `Create role`\n- Attach the following policies:\n  - AmazonSQSFullAccess\n  - AmazonS3FullAccess\n  - CloudWatchFullAccess\n  - AmazonDynamoDBFullAccess\n  - AmazonSESFullAccess\n  - CloudWatchLogsFullAccess\n  - AWSLambdaSQSQueueExecutionRole\n  - CloudWatchEventsFullAccess\n- Name the role something easy to remember like `autogram-role`\n- Create the role and copy the ARN that AWS generates\n- Now create an inline policy and paste the following JSON into the JSON tab\n  - NOTE: replace `\u003cAWS_ARN_HERE\u003e` with the ARN you just coppied\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:GetRole\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"\u003cAWS_ARN_HERE\u003e\"\n        }\n    ]\n}\n```\n\n- Save the role and coppied ARN\n\n### Edit deploy script with your AWS details\n\nIn the file named `deploy_script.bat` replace all the items in `\u003c\u003e` with your account details.\n\ne.g:\n\n- `\u003cREGION\u003e` -\u003e `us-west-1`\n- `\u003cACCOUNT_ID\u003e` -\u003e `123456789012` [more info here](https://docs.aws.amazon.com/IAM/latest/UserGuide/console_account-alias.html)\n\n### Run the deploy script\n\nThis is the first time you will need to run this script.\n\nSimply right click on the `deploy_script.bat` and select `Reveal in File Explorer` and double click the file in the File Explorer\n\n### Create Lambdas\n\nCreate all the lambdas that are being used for the project. Some will need to be re-deployed later.\n\n- Navigate to [AWS Lambda](https://us-west-1.console.aws.amazon.com/lambda/home) and click `Create function`\n- Select `Container image` and name the lambda relative to each ECR repository for the project.\n- Browse images and find the image from ECR for each repository.\n- IMPORTANT: select the dropdown for `Change default execution role` and choose `Use an existing role`; choose the role you created earlier.\n- Create the function - do this for all five ECR repositories.\n\nFor the following lambdas add the `SECRET=\u003crandom JWT secret\u003e` environment variable under the `Configuration` tab:\n\n- Account\n- Auth\n- Login\n\n### Create AWS SQS Queue\n\nIn order to send email notifications to the users, SQS needs to be configured. Also make sure in AWS SES to verifiy your emails that will be used on the project.\n\n- Navigate to [AWS SQS](https://us-west-1.console.aws.amazon.com/sqs/v2/home) and click `Create queue`\n- Select `FIFO` and name the queue; all other settings remain default\n- Once the queue is created, enter it and select the `Lambda triggers` tab\n- Add the Email lambda you just configured.\n\nAWS SQS will not deliver emails if you dont allow the `email` lamda to be invoked by SQS. To allow it invocation:\n\n- Navigate to the `email` lambda in AWS\n- Select the `Configuration` tab and then select `Permissions`\n- Scroll down to `Resource-based policy` and click on `Add permissions`\n- Choose `AWS service` and select `SQS from the dropdown`\n- Set `Statement ID` to `1`\n- Keep the `Principle` the same (`sqs.amazonaws.com`)\n- Set the `Source ARN` to your AWS SQS `.fifo` URL\n- Set the `Action` to `lambda:InvokeFunction`\n\n### Edit Lambda files to use your AWS account direct links\n\nStarting from the top most directory open `./account/account.py`.\n\n- On line 431 paste the ARN to the `remove` lambda\n- On line 432 paste the ARN to the AWS role you created earlier\n- On line 455 paste the `.fifo` URL to the AWS SQS queue\n- On line 491 paste the AWS S3 bucket name to the variable\n\nNext is `./email/email_lambda.py`\n\n- On line 4 replace the email in `\u003c\u003e` with one of your verified AWS SES emails\n- On line 5 replace the region with your AWS region\n\nLast is `./story-remove/remove.py`\n\n- On line 11 put your AWS S3 bucket name\n\n### Run the deployment script again\n\nThis first deployment script run was to build out the lambdas. This one is to update the lambdas to use your AWS resources.\n\nRight click on the `deploy_script.bat` and select `Reveal in File Explorer` and double click the file in the File Explorer\n\n### Build the API\n\nReturn back to your AWS API Gateway tab.\n\n- Under the `Resources` tab on the left select `Actions` and create a resource named `account`\n- Create another resource named `login`\n\nNext you need to build an Autorizer. To do this select `Authorizers` on the left\n\n- Click `Create New Authorizer`\n- Name the authorizer something recognisable\n- The type is `Lambda`\n- Choose the `auth` lambda\n- Leave `Lambda Invoke Role` blank\n- For the `Lambda Event Payload` select `Request`\n- Enter `Authorization` in the `Identity Sources` input field\n- Disable `Authorization Caching`\n- Create\n\nThis next part relates to the `/account` resource back in the `Resources` tab on the left\n\n- Select the `Create Method` option under the `Actions` dropdown and create the following methods:\n  - DELETE\n  - GET\n  - PATCH\n  - POST\n  - PUT\n\nUnder each method configure it the same as follows:\n\n- `Integration type` is `Lambda Function`\n- Choose the `account` lambda function\n- Keep all other settings default and save.\n- On the `Method Execution` screen for each method:\n  - Select `Integration Request`\n  - Expand the `Mapping Templates` section\n  - Select `When there are no templates defined`\n  - Click `Add mapping template`\n  - Enter `application/json` in the text input and click the check mark icon\n  - Pase the following into the code editor that pops up and click `Save`:\n\n```vtl\n{\n  \"body\" : $input.json('$'),\n  \"headers\": {\n    #foreach($header in $input.params().header.keySet())\n    \"$header\": \"$util.escapeJavaScript($input.params().header.get($header))\" #if($foreach.hasNext),#end\n\n    #end\n  },\n  \"httpMethod\": \"$context.httpMethod\",\n  \"pathParameters\": {\n    #foreach($param in $input.params().path.keySet())\n    \"$param\": \"$util.escapeJavaScript($input.params().path.get($param))\" #if($foreach.hasNext),#end\n\n    #end\n  },\n  \"queryStringParameters\": {\n    #foreach($queryParam in $input.params().querystring.keySet())\n    \"$queryParam\": \"$util.escapeJavaScript($input.params().querystring.get($queryParam))\" #if($foreach.hasNext),#end\n    #end\n  }  \n}\n```\n\nThe following applies to methods `DELETE`, `PATCH`, and `PUT`:\n\n- Back on the `Method Execution` screen for each method click on `Method Request`\n- Under `Settings` find `Authorization` and click the pencil icon\n- Select the authorizer you made earlier and click the check mark icon\n\nNext is the `/login` resource.\n\n- Create a method `POST`\n- As before `Integration type` is `Lambda Function`\n- Choose the `login` lambda function\n- Keep all other settings default and save.\n\nNext CORS needs to be enables so that the React.js front-end can call the API\n\n- Under BOTH the `/account` and `/login` resource select the `Enable CORS` button in the `Actions` dropdown\n- Make sure all the methods avaliable are selected\n- Keep all the settings default and click `Enable CORS and replace existing CORS headers`\n\nFinally the API can be staged and deployed.\n\n- Under the `Actions` button select `Deploy API`\n- Set the Deployment stage to `[New Stage]`\n- Set the Stage name to `v1`\n- Click `Deploy`\n- Under the `Stages` section on the left, click on `v1`\n- Copy the `Invoke URL` from the blue header.\n\n### Edit React.js API file to point to your API\n\nThe front-end needs to point to your AWS API Gateway API. To do this you simply need to edit the base URL for the API  as follows:\n\n- Enter the `client` folder in the root directory\n- Under the `src/api` directories there is a file named `account.js`\n- On line 7 paste that `Invoke URL` to the variable\n\n## Run the App\n\nGood news, the setup is finally done. The last step is to actually run the project.\n\n- Run `cd client` in the root directory (Open a new terminal to do so)\n- Run `npm i`\n- After the install finishes, run `npm run start`\n- Autogram will automatically open on [localhost:3000](http://localhost:3000)\n\nYou will be greeted with a login page. Because its the first time running the project you will need to register a new user.\n\n- Click `register` under the login button\n- Fill out the form\n- Register\n\nNow you can play around with the program. Feel free to edit code and mess around. If you find an issue and or have a new feature dont hesitate to submit a pull request.\n\n## Additional Details\n\nThis was built as an assignment for a college class at [Neumont College of Computer Science](https://www.neumont.edu/). Please do not use any part of this project in any way that would be considered plagiarism.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcartercobb%2Fautogram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcartercobb%2Fautogram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcartercobb%2Fautogram/lists"}