Socket
Socket
Sign inDemoInstall

@pinegraph/react-website-cdk-constructs

Package Overview
Dependencies
3
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @pinegraph/react-website-cdk-constructs

A CDK construct for hosting a secure single page application (i.e. client side rendering). Ideal for websites written in react.


Version published
Maintainers
2
Created

Readme

Source


Discord server npm version

React Website Constructs

What is this?

This package is an AWS CDK construct for hosting a secure react website. It sets up HTTPs Certificates, S3 (for storing your assets), Cloudfront (a CDN for caching resources and speeding up delivery), and DNS records.

AWS CDK enables people to have infrastructure as code (IAC). That is, with just a few commands, you'll have a fully running and functional production ready service in the cloud.

Problem

There are 2 problems. Firstly, it's hard to setup hosting a website even with popular cloud based technologies. Second, it's hard to setup a secure website. People often forget to enable secure headers to prevent XSS, clickjacking, and encryption in transit.

Benefits

By using this construct, you'll get a secure website that you can spin up in seconds.

Setup

  1. This package assummes that you are familiar with AWS CDK and already have a CDK app created. If not, follow this tutorial.
  2. Go to the AWS console and register the domain you want. This can be done in the Route 53 console and requires you to verify multiple emails.
  3. Once you have a CDK app ready and a dmoain, create a new stack or modify an existing one to include the ReactWebsiteConstruct. See the Example CDK App Code below.
  4. Deploy your change via cdk deploy.
  5. Go to your website and voila!

Example CDK App Code

new ReactWebsiteConstruct(this, "ReactWebsiteConstruct", {
  domainName: props.domainName,
  sourceAsset: s3deploy.Source.asset("../Website/build")
}

Questions?

Reach out to us on discord.

Releasing

  1. npm run build
  2. npm publish --access public

Keywords

FAQs

Last updated on 05 Aug 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc