All Projects → cornelcroi → photo-sharing-website

cornelcroi / photo-sharing-website

Licence: MIT license
Static pre-rendered photo-sharing website

Programming Languages

SCSS
7915 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to photo-sharing-website

graphql-ttl-transformer
♻ Enable DynamoDB's time-to-live feature to auto-delete old entries in your AWS Amplify API!
Stars: ✭ 75 (+127.27%)
Mutual labels:  dynamodb, amplify, amplify-cli
gozeit
GoZeit
Stars: ✭ 19 (-42.42%)
Mutual labels:  dynamodb, cloudfront
aws-appsync-iot-core-realtime-dashboard
This sample application demonstrates a React based web dashboard receiving real-time updates from IoT sensors. The solution is built with AWS AppSync, AWS Amplify, Amazon Location Service, and AWS IoT Core technologies.
Stars: ✭ 75 (+127.27%)
Mutual labels:  dynamodb, amplify
amazon-ivs-chime-messaging-ugc-demo
This demo is designed to educate people who want to build live streaming platform with chatting feature. This demo is implemented using Amplify with Amazon IVS, ChimeSDK Messaging.
Stars: ✭ 20 (-39.39%)
Mutual labels:  amplify, amplify-cli
Workshop Donkeytracker
Workshop to build a serverless tracking application for your mobile device with an AWS backend
Stars: ✭ 27 (-18.18%)
Mutual labels:  dynamodb, cloudfront
jarvis-workshop
Amazon re:Invent workshop - "Alexa, Ask Jarvis to Create a Serverless App for Me" -
Stars: ✭ 14 (-57.58%)
Mutual labels:  dynamodb
sam-python-crud-sample
This project is an example about lambda, SAM, dynamodb. This repository contains source code and supporting files for a serverless application that you can deploy with the SAM CLI. It includes the following files and folders.
Stars: ✭ 71 (+115.15%)
Mutual labels:  dynamodb
akka-persistence-dynamodb
DynamoDBJournal for Akka Persistence
Stars: ✭ 85 (+157.58%)
Mutual labels:  dynamodb
serde dynamodb
Talk with dynamodb using your existing structs thanks to serde
Stars: ✭ 28 (-15.15%)
Mutual labels:  dynamodb
react-deploy-s3
Deploy create react app's in AWS S3
Stars: ✭ 67 (+103.03%)
Mutual labels:  cloudfront
data
[deprecated] Generate a DynamoDB data access layer from an .arc file. Automatically disambiguates testing (in memory) from deployment staging and production tables
Stars: ✭ 20 (-39.39%)
Mutual labels:  dynamodb
parser
arc.app, .arc, arc.json, arc.yaml, and arc.toml support
Stars: ✭ 20 (-39.39%)
Mutual labels:  dynamodb
amazon-ivs-ugc-web-demo
This repository shows how you can build a compelling user-generated content (UGC) live streaming webapp with Amazon IVS.
Stars: ✭ 14 (-57.58%)
Mutual labels:  dynamodb
static-aws-deploy
A tool for deploying files to an AWS S3 bucket with configurable headers and invalidating AWS Cloudfront Objects.
Stars: ✭ 27 (-18.18%)
Mutual labels:  cloudfront
aiodynamo
Asynchronous, fast, pythonic DynamoDB Client
Stars: ✭ 51 (+54.55%)
Mutual labels:  dynamodb
cognito-amplify-custom-auth
A React/Redux web application that implements a custom UI for Cognito Userpool Auth using AWS Amplify
Stars: ✭ 27 (-18.18%)
Mutual labels:  amplify
lockbot
🔒 Coordinate use of your team's shared resources, in Slack 🤝
Stars: ✭ 47 (+42.42%)
Mutual labels:  dynamodb
dynocsv
Exports DynamoDB table into CSV
Stars: ✭ 34 (+3.03%)
Mutual labels:  dynamodb
terraform-aws-dynamodb-autoscaler
Terraform module to provision DynamoDB autoscaler
Stars: ✭ 21 (-36.36%)
Mutual labels:  dynamodb
dynamolock
DynamoDB Lock Client for Go
Stars: ✭ 100 (+203.03%)
Mutual labels:  dynamodb

Photo-sharing website

Static pre-rendered photo-sharing website to share publicly your pictures without needing to run or maintain servers.

Concept

  • A static website - publicly accessible web app,
  • An admin web application - password protected web application (React.js web application) used to generate the static website on demand.

The below YouTube video shows how everything works:

How ManBehindLens.com is made | Pre rendered static photo-sharing website

Architecture

  1. CloudFront distribution with / path in S3 bucket as the origin
  2. CloudFront distribution with /website path in S3 bucket as the origin (the static website static source code)
  3. S3 Bucket which holds the all the static resources (html, css, javascript and images)
  4. S3 Bucket with the initial uploaded pictures
  5. AWS Lambda used to generate the static website's HTML source code
  6. AWS Lambda used to generate thumbnails and to detect relevant labels for uploaded photos using Amazon Rekognition
  7. Amazon Cognito to provide an authentication for admin user

Deployment

Prerequisites

Instructions

1. Clone the repository

git clone https://github.com/cornelcroi/photo-sharing-website.git

2. Preliminary operations

  • Admin user email

    • replace [email protected] with your own email address in amplify/backend/boostrap/adminuser/parameters.json
  • Image resize

    • The application resizes images using the sharp library packaged as Lambda Layer,
    • Create a sharp layer. Follow this tutorial to create a sharp layer in your desired region and then update the layer arn in amplify/backend/function/S3TriggeraXXXX/S3TriggeraXXXX-cloudformation-template.json.

3. Installs the dependencies

npm install

4. Deploy the stack to your AWS account

  • Initialize your Amplify powered cloud application
    amplify init
    
  • Provisions cloud resources with the local developments run
    amplify push
    
  • Publish static assets to Amazon S3
    amplify publish
    

Enjoy !

⚠️ You may need to wait a couple of hours after the first deployment so the DNS name of the S3 bucket to be propagated! (if you cannot log in after the deploiment using the temporary password received by email, this must be it, just wait before trying again, there is nothing wrong with the code)

Key points

  • AWS Lambda generates the static files using html templates and data stored in DynamoDB,
  • React.js application built using AWS Amplify,
  • there is a single admin user created at first deployment,
  • the static website (with html template files) is generated on demand by a AWS Lambda,
  • 4 html files are used to generate the static website,
  /albums-gallery-template.html                                       <-- template for an album gallery page
  /albums-template.html                                               <-- template for list of albums page
  /album-item-template.html                                           <-- template for one album used in list of albums page
  /photo-item-template.html                                           <-- template for one photo used on album gallery page
  • each html template contains variables to be replaced by lambda like the piece of code bellow
  <div>
    <h2>{ALBUM_NAME}</h2>
    <div>{ALBUM_PHOTOS} photos · {ALBUM_DATE}</div>
  </div>

Advantages of pre-rendered static website

  • pre-rendered static HTML of static sites loads much faster than the pages on a dynamic site. Fast websites are really important for a good user experience, and also for boosting your site in search engine rankings,
  • static site generators reduce site complexity. That, in turn, improves speed and reliability, and smooths the developer experience,
  • you don’t have to worry about database-toppling traffic spikes,
  • you can host your site with a content delivery network that scales with your site’s traffic,
  • lower costs,
  • better SEO,
  • good caching.

I used this repository to build my own website ManBehindLens.com.

Tools

  • AWS Amplify JavaScript library to connect our front end to cloud resources

  • Amazon Cognito to handle admin sign up authorization

  • Amazon Simple Storage Service (S3) to store and serve as many photos as I wish to upload,, to host the React.js app assets for our app and to host the static generated website

  • Amazon CloudFront to store and serve as many photos as our users care to upload, and to host the static assets for our app

  • Amazon DynamoDB to provide millisecond response times to API queries for album and photo data

  • AWS AppSync to host a GraphQL API for our front end

  • AWS Lambda to create photo thumbnails asynchronously in the cloud & to generate the static website on demand

  • Amazon Rekognition to detect 5 labels for each uploaded photo

Costs

Less than a cup of coffee per month

Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].