Code Monkey home page Code Monkey logo

percolatestudio.com's Introduction

Description

This is the code that runs Percolate Studio's website at http://percolatestudio.com . The site is a Single Page App built in React. It can be run as a node application with server side rendering, from a set of static pages that have been rendered to disk or as a pure client-side app. We run in production as a static site deployed to S3.

We believe this is a very powerful technique for building rich clientside websites that are:

  • Extremely fast (especially if served from a CDN)
  • Completely redundant/fault tolerant
  • Infinitely scalable
  • Very cheap to host
  • Can connect to and use a 'backend as a service' if desired
  • Can be trivially upgraded to a dynamic node application if required in the future

We wrote up our rationale in more detail on our blog.

Usage

First install the dependencies including grunt if you don't have it yet

$ npm install -g grunt-cli
$ npm install

Development

The run the development node server (app/server.js)

$ grunt

This will use nodemon and webpack to watch for changes and restart and rebuild as the app as needed.

Open http://localhost:3000

Production

To build the 'production' version (app/static.js)

$ grunt static

This will build a complete static site in ./static . The best way to test that this is working locally is to install and run a light http server.

$ npm install -g http-server
$ cd static
$ http-server

Open http://localhost:8080

Deployment to S3

  1. Create a bucket, e.g "percolatestudio.com"
  2. Setup bucket policy like
{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Sid": "AddPerm",
			"Effect": "Allow",
			"Principal": "*",
			"Action": "s3:GetObject",
			"Resource": "arn:aws:s3:::percolatestudio.com/*"
		}
	]
}
  1. Create a Route53 A-Alias record pointing to your S3 bucket.
  2. Create an IAM user with permissions to upload to S3.
  3. Create s3.config.json, it should look something like
{
  "key": "XXX",
  "secret": "XXX",
  "bucket": "percolatestudio.com",
  "region": "us-west-2"
}
  1. Build and deploy the site
$ grunt deploy

License & Copyright

The code in this project is copyright Percolate Studio Ltd., and licensed under the MIT license (see attached license file LICENSE.txt). All images and textual content are copyright Percolate Studio Ltd. or the respective copyright holder and ARE NOT available to be re-used.

Webfonts are copyright and subject to licensing agreements with their respective owners. They ARE NOT available for re-use. Please license them with their owners.

Maintained by Zoltan Olah (@zol).

percolatestudio.com's People

Contributors

tmeasday avatar zol avatar

Watchers

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