Giter VIP home page Giter VIP logo

jschr.io's Introduction

jschr.io - a static website generator

The stack that powers my personal website and wrote about in this post.

Featuring

How it works

A scheduled Lambda function fetches a summary of latest activity from Github, Twitter, Reddit and Medium. It then generates a new static website using this webpack config and uploads the resulting build to S3.

Terraform is used to create the required resources in AWS after setting a few environment variables, including Route53 entries for your domain and emails (via Mailgun).

Quick start

Install terraform from the downloads page

open https://www.terraform.io/downloads.html

Clone the repository (without history)

git clone --depth=1 [email protected]:jschr/jschr.io.git example.com

Install app dependencies

yarn install

Set environment variables

cd instructure/env-dev
mv vars.tfvars.sample vars.tfvars # rename sample file
open vars.tfvars # set env vars

Development

mv .env.sample .env # rename sample file
open .env # set env vars for development

yarn start # starts webpack dev server
open localhost:8080

Deploy infrastructure

yarn run terraform-plan # review the infrastructure changes
yarn run deploy

Deploying will take a few minutes but you'll need to wait about 15-20 minutes before the CloudFront distribution is created. By then the Lambda function should have ran to generate the website.

Manually triggering the Lambda

You can invoke the Lambda function by logging into the aws console and heading over to the Lambda management section.

Then go to Functions -> website_generator -> Test.

If it ran successfully you will see the result of the CloudFront invalidation.

Customizing

You can create your own components to customize the look and feel.

Modify the props passed to your components in getProps.

You can add more data sources to make your site more dynamic.

Feel free to create an issue with any questions about deploying your own version!

What does it cost?

You are mosly paying for CloudFront invalidations which by default happens every 15 minutes.

The first 1000 invalidations are free, afterwhich it's $0.005 per invalidation path. With the default settings thats about 2,880 invaldations per month for a total of ~$10/mo USD.

You can increase the render interval to 45 minutes if you'd prefer to stay within the free tier.

jschr.io's People

Watchers

Rico Moorman avatar James Cloos avatar  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.