Giter Site home page Giter Site logo

annalytics.co.uk's Introduction

Annalytics Website

Website built using NextJs and deployed using CDK to AWS.

NextJs website is exported to static web content and is privately hosted in an S3 bucket and exposed using CloudFront.

Updates to the website can then either be performed by re-deployment or by simply overwriting the files stored on S3.

Install and Setup

Project is a Node.js project with Typescript therefore to install simply use npm

npm install

You will need to create a .env file that matches your environment.

DEPLOYMENT_STAGE=dev
DOMAIN=example.com
WEBSITE_DOMAIN=www.example.com
AWS_ACCOUNT=<YOUR AWS ACCOUNT NUMBER>

Local Deployment for Development

To run the site locally use

npm run dev

This will start a watched instance on http://localhost:3000 any updates you make will be reflected instantly.

You can also build/export the site as static assets and then preview the output. This allows you to check for broken links/images etc when the site is built.

npm run build
npm run preview

Deployment

The website is deployed using AWS CDK. To run this locally simply run

npm run deploy

This assumes you have already run CDK before and you have bootstrapped the CDK in your account for region us-east-1 If you have not used the CDK before then you should follow the guide here to get started

The CDK code here will deploy 2 stacks:

  • A certificate stack to setup and manage an SSL cert for your website domain. This assumes you already have setup a hosted zone for your primary domain and that the AWS Certificate Manager has permission to create new subdomain certs for your domain. This certificate has to be created in the us-east-1 region so that it is compatible with CloudFront.
  • The website stack consisting of an S3 Bucket and CloudFront distribution. The stack will also setup the Route53 A (and AAAA) records for your subdomain.

annalytics.co.uk's People

Contributors

brettwold avatar annalytics avatar

Watchers

 avatar

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.