Design Choices

Some of the biggest design choices I made were about leaning into existing frameworks, instead of re-inventing the wheel:
  1. Defining the entire stack in a series of cloudformation templates
  2. Defining the possible back-end operations upfront (and making methods work for any type of input eg storing a new article, or updating a quiz question) so I didn't have to keep redeploying lambdas
  3. Using existing design frameworks (like @mui) instead of doing the CSS myself

Why did I choose to make the entire stack a series of cloudformation templates?

Because the code-first (okay...YML first) approach forced me to visualize how everything fit together, not just how I wanted my API designed, but how I wanted the authorization (via Cognito) to allow access only to specific APIs. While this is by no means a revolutionary design choice it did force me to plan the project up-front- which means that after writing the YML I had a clear idea of what operations the front end would support and how the backend looked.

Useful tips:


To Do:

Add more code to the website page: Add walkthrough with YML snippets.
get lambda custom domain working api.yzpaul.com (check cert) and uncomment YML once cert right
finish writing tests for all api methods
make certain all pages use bootstrap styles directly (most except home stil have the old react-bootstrap syntax which doesnt load correctly)
generate lambda_cf.yml from a ts file.... there are too many fiddly settings to remember when coming back to this file after a while
use webpack instead of my standalone command to bundle files to remove dev deps from deployed zip (to reduce size):https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/webpack.html

Done:

migrate off AWS Amplify
successfully migrated to next.js to speed page loading times and make more things static
import existing HTML pages inside main site, without displaying them in a new window.
get icon text below images:https://codesandbox.io/s/kzp5wkypx?file=/index.js:199-266
change quiz display (currently a table) to flashcards:https://nabendu82.medium.com/build-a-flashcard-quiz-with-react-c1cb96e3a1e8
get article UI working
signin text on header changes on page reload (and pages treat you as signed out)
fix routing to avoid soft redirect: this is due to react router not working (the only page CF can serve is index.html):https://stackoverflow.com/a/72750469/1634753