Giter VIP home page Giter VIP logo

ts-react-s3-circleci-portfolio's Introduction

CircleCI

ts-react-s3-circleci-portfolio

an offline-friendly, cache-first website frontend built with material ui, typescript, react and webpack with Jest unit testing

Highlights:

  1. Website deployed to an S3 bucket with Cloudfront as CDN: https://www.markz-portfolio.net/ and https://markz-portfolio.net/ are redirected to a CloudFront distribution. The CloudFont distribution is configured to redirect all http to https. Some Cache-Control headers are configured for different built files of the React app for performance and cost.
  2. SPA: all 400 class errors are redirected to /index.html by cloudfront.
  3. service-worker.js is used in a way that when new version is continuosly deployed to S3, a React snackbar displays notification, letting user choose whether they want to 'skipWaiting' and get the latest content. If they choose not to 'skipWaiting', the old content will remain on ALL TABS. This ensures cross browser tab data consistency.
  4. Infra as code with AWS CDK here: https://github.com/MarkZhuVUW/aws-cdk-all image
  5. Currently the cost of maintaining the website is around 0.65usd per month.
  6. I call it a "higher-order react hook" that wraps the useReducer hook, and adds the ability to attach middleware and afterware. image
  7. Inspired by Downshift and react-virtualized, I have decoupled all states into dedicated custom hooks while providing render props for allowing the customization of some parts the components image
  8. Accessibility. All interact-able icons, button either have text within it or a unique aria-label. image

How to install dev environment and contribute

Fork it (feel free to submit pull requests :) )

In the project directory, you can run:

npm install

npm run serve

  • Runs the app in webpack development mode with live reloading.

  • Open http://localhost:4000 to view it in the browser.

The app features husky pre-commit linting checks (eslint and prettier)

Circle CI is used to test, build and serve the static React App to an S3 bucket on Master branch change.

On branches other than master, only unit testing will be done on commit.

FAQ

Q. Husky pre-commit hooks are not working?

try:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.