All Projects → redbadger → website-honestly

redbadger / website-honestly

Licence: other
🦄 The Red Badger website. Honestly.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
Pug
443 projects
Makefile
30231 projects
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to website-honestly

posthtml-css-modules
Use CSS modules in HTML
Stars: ✭ 54 (+107.69%)
Mutual labels:  css-modules
phoenix-react-apollo-demo
Example app using the Phoenix Framework with React and GraphQL
Stars: ✭ 37 (+42.31%)
Mutual labels:  css-modules
yake
A Rake-like DSL for writing AWS Lambda handlers
Stars: ✭ 146 (+461.54%)
Mutual labels:  lambda
hot-redux-chassis
Modern React/Redux/RxJS application using all the latest and greatest stuff from the community 🔥
Stars: ✭ 20 (-23.08%)
Mutual labels:  css-modules
modular
Scaffold a react monorepo and its component parts.
Stars: ✭ 13 (-50%)
Mutual labels:  css-modules
css-art-gallery
A collection of CSS Arts.
Stars: ✭ 127 (+388.46%)
Mutual labels:  css-modules
react-module-boilerplate
Sample React presentational components package.
Stars: ✭ 16 (-38.46%)
Mutual labels:  css-modules
terraform-aws-lambda-function
A Terraform module for deploying and managing Lambda functions on Amazon Web Services (AWS). https://aws.amazon.com/lambda/
Stars: ✭ 37 (+42.31%)
Mutual labels:  lambda
nextjs-components
A collection of React components, transcribed from https://vercel.com/design.
Stars: ✭ 92 (+253.85%)
Mutual labels:  css-modules
jess
If you like CSS, Less, Sass, and/or CSS modules, you're gonna want to star this repo.
Stars: ✭ 26 (+0%)
Mutual labels:  css-modules
nextjs-with-jest-typescript
A very simple example of Next.js-based website with Jest tests, all written in TypeScript
Stars: ✭ 70 (+169.23%)
Mutual labels:  css-modules
Bank-Account-Simulation
A Bank Account Simulation with JavaFX and SQLite back-end. Material UX|UI.
Stars: ✭ 19 (-26.92%)
Mutual labels:  css-modules
zappa-ffmpeg
Run ffmpeg inside a lambda for serverless transformations.
Stars: ✭ 14 (-46.15%)
Mutual labels:  lambda
Mailbox
🌸🎉使用react+redux+webpack搭建的邮箱应用🎉🌸
Stars: ✭ 16 (-38.46%)
Mutual labels:  css-modules
workshop-serverless-graphql
[AWSKRUG Serverless Group 2019] Serverless GraphQL Workshop
Stars: ✭ 80 (+207.69%)
Mutual labels:  lambda
vital
Starter template for Vite with React (TypeScript). Supports Tailwind with CSS-Modules. Jest and @react/testing-library configured and ready to go. Also ESLint, Prettier, Husky, Commit-lint and Atomic Design for components.
Stars: ✭ 151 (+480.77%)
Mutual labels:  css-modules
twitter-web-react
twitter-web-react.now.sh
Stars: ✭ 104 (+300%)
Mutual labels:  css-modules
aws-lambda-scheduler
aws-lambda-scheduler is EventBridge Rule manager that lets you call any existing AWS Lambda Function you have in a set future time with pre-set parameters. Allows more rule creation than AWS limit.
Stars: ✭ 58 (+123.08%)
Mutual labels:  lambda
docker-selenium-lambda
The simplest demo of chrome automation by python and selenium in AWS Lambda
Stars: ✭ 172 (+561.54%)
Mutual labels:  lambda
macos-preact
macos-preact.now.sh
Stars: ✭ 1,019 (+3819.23%)
Mutual labels:  css-modules

Website. Honestly. 🦄

CircleCI Maintainability Test Coverage

Red Badger Website Episode 6: Return of the Jedi.

Usage

Codespaces

Github Codespaces is enabled for this repository to get your development environment up and running as quickly as possible. To get started,

  • Click the Code drop-down menu, and then in the Codespaces tab, click New codespace.
  • A pop up should appear to select the size of the VM, select a 4 core VM or higher.
  • Then select whether you would like to use VSCode in the browser (preferably a chromium based browser) or the native app on your local machine.
  • Follow instructions on how to run the website locally.

Note: All the necessary credentials for local development should already be embedded within the codespaces environment on the startup automatically.

Local Setup

You will require the correct version of Node.js installed - check it in the .node-version file. On OSX you can use nvm and avn to install and manage versions (avn will read the .node-version file).

First set up your dev environment and install global dependencies:

# Install the package manager
npm install --global yarn

# Clone the repo
git clone https://github.com/redbadger/website-honestly.git

# Install the deps
yarn

# Set up the environment variables. Follow the instructions of this command:
make keyrings

# Go to https://github.com/redbadger/blackbox-secrets/blob/master/README.md
# Follow instructions to
# - "Getting Blackbox"
# - "Get access to existing blackbox secrets"

# Make sure you have git-secrets installed by running
brew install git-secrets

# Set up git secrets to scan for secrets pre-commit. Follow the instructions of this command:
make scanner

# Go to https://github.com/redbadger/secrets-scanner/blob/master/README.md
# Follow instructions to
# - "Getting Git Secrets"
# - "Setting up to scan"

# Fetch and stash dynamic data for development. You might need to do this
# every time you want to get updated data from staging for local development.
make fetch

Running the website

Now start the website:

make                   # Print the help
make dev               # Run the dev server (url - localhost:8080)
make clean dev-static  # Compile the site locally (url - localhost:8000)

# Deploy to dev lambda environment
make clean services-deploy

# Invoke dev lambdas
make services-invoke-publish

Technical Overview

This site is a static site hosted on AWS S3 behind a proxy that provides HTTPS. You can find the proxy here: https://github.com/redbadger/website-next-proxy

The code used to build the site's HTML and CSS can be found in the site/ directory. It's mostly React components and CSS modules.

The same React app in the site/ directory is used on the front end for interactive features such as the "Sign Up" form. The entry point for the front end Javascript can be found in the client/ directory.

The content for the site is (will be) pulled from the Badger Brain GraphQL service before compilation. The code for fetching and preprocessing this data can be found in the state/ directory.

Generation of the site is done on AWS Lambda, so there are no production servers to look after. This lambda function is to be called any time there is a content update on the Prismic CMS. This and other lambda functions can be found in the services/ directory.

The lambda functions are managed and deployed using Serverless framework, and AWS CloudFormation is used with Serverless to provision the rest of the new site infrastructure.

The dev/ directory contains two entry points to the application. The first is browser-app/, which is the site mounted as a regular React app in the browser.

Test data is loaded from assets/state.json during development and can be re-fetched by running make fetch.

When make dev is run this app will be served with webpack-dev-server, allowing for a fast feedback loop development. This is likely to be where you will spend most your time while working on this application.

The other entry point in dev/ is static/ which is similar to the site generator on lambda, but it runs locally and writes the pages to the local filesystem instead of to AWS S3. This is useful for checking functionality that might not work with the front end dev app.

Deployment

We use CircleCI for running tests, building the app, and deploying the app.

When a branch is pushed to CircleCI will compile the app, copy the CSS and client-side JS to a folder in the staging S3 bucket and deploy the lambda to a staging environment. The staging lambda is invoked, writing the HTML pages to the same folder in the staging bucket. Lastly a "View deployment" link is added to any pull request open on GitHub for that branch so it can be tested and reviewed.

When the master branch is updated, CircleCI will do the same deploy + invoke process, writing to the root of the staging bucket. The staging site always reflects the current state of master.

There is only one staging lambda function instance, so there is no guarantee that the correct version will be currently deployed when viewing a branch preview. This matters if you are testing the "sign up" form, for example.

Deploys to the live prod environment are done by starting a parameterised build on CircleCI that does the deploy + invoke process for the production lambda service and S3 bucket. This build can be started via @badgerbot on Slack.

See bin/ci-deploy.sh for more detail on deployment.

Monitoring

We use AWS CloudWatch for monitoring our staging and prod lambdas; all alarms should be picked up by bugsnag and sent to the slack channel #internal-projects.

Assets

SVGs can be just inlined as JSX but they should be optimised first, SVGOMG is a really handy tool for this.

Responsive loader can be used to create an srcSet attribute with multiple sizes of an image (so that appopriately sized images can be served to mobile, tablet and desktop devices for improved performance). See the plugin’s options for more details. Example usage:

import badgers from './badgers.jpeg?min=320&max=1600&steps=6';

const image = (
  <img
    src={badgers}
    srcSet={badgers.srcSet}
    sizes="(min-width: 1200px) 1200px, 100vw"
    alt="Badgers working in a team"
  />
);

Images are automatically optimised by imagemin-webpack-plugin in production.

Tracking

Analytics are tracked through google tag manager. This requires a gtm or container id which should be stored as an environment variable.

We use TagManager supplied by the react-gtm-module package. It is initialised in site/client/index.js with the primary data layer which provides the current domain.

The tag manager is setup for each page during the makeApp step

The rational for using google tag manager is that individual events can be setup and tracked without dev support.

Blog

The blog /blog is hosted on hubspot and can be managed there.

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].