The goal of this photo portfolio is to provide a simple, easily modifiable photo portfolio solution. The main feature is the ability to dynamically update website content from anywhere with no programming background. You can see a live example here
This backend uses the following AWS products
- Amplify
- AppSync
- Lambda
- S3
- Cognito
- Cloudfront
The front end is built with React and ReactRouter.
- Utilize the high availability and scalability of AWS services. Fixed cost to host is to basically the cost to store the website data. Other costs directly proportional to how many people view your website.
- Responsive photo albums with Yet Another React Lightbox
- Ability to dynamically update photo content from anywhere via the admin user
- Configurable list of Featured albums that display on the homescreen
- Create custom tags to organize albums (Can only view one tag at once, but one album can have multiple tags)
- Custom highlighted albums that display on the home page
- Use AWS CloudFront CDN to ensure that anyone all over the globe can quickly access any of your photos
- Signed in users can download full-size images directly from the website.
- Clone repo and install dependencies
~ git clone https://github.com/bobby060/photoportfolio.git
~ cd photoportfolio
~ npm install
- Initialize and deploy Amplify project
Ensure you have properly configured Amplify CLI, see here
~ amplify init
? Enter a name for the environment: dev (or whatever you would like to call this env)
? Choose your default editor: <YOUR_EDITOR_OF_CHOICE>
? Do you want to use an AWS profile? Y
~ amplify push
? Are you sure you want to continue? Y
? Do you want to generate code for your newly created GraphQL API? Y
-
Initialize CloudFront Content Delivery setup with the S3 storage bucket created in step 2 using these instructions. At some point this will ideally be collected a single create script
-
Upload any images you want to show in the header carousel to your AWS S3 photo bucket with the prefix 'highlights/h'. This will allow them to be automatically pulled into the header carousel
-
Start the app. Featured portion of the screen won't appear until you create a featured tag (need to add instructions on how to do that)
npm run dev
To run in production mode:
npm run build
-
Configure an admin user in AWS Cognito and add them to the user group 'portfolio-admin.' Once you log in with that user, you should be able to create albums, upload pictures, and create public tags.
-
You will need to run the
function createDefaultTags()fromhelpers/upgrade_database.jsin order for the website to run. At this point, you also have to manually pull the ID of the 'featured' Tag and paste it in line 60 ofcomponents/Carousel.js. Future iterations will solve this problem in the setup script, but for now you are stuck with it.
This app is designed to use an Amplify Graphql API with primary mode set to Cognito User pool and secondary mode set to AWS API. This means that by default, a query run in a component will be authenticated using Cognito unless you specifiy to use AWS API. The default is the secure option.
See this for what to do if your API key expires and is deleted. If the key expires and is not deleted, simply redeploying in Amplify should renew. aws-amplify/amplify-cli#808 (comment)
