Giter VIP home page Giter VIP logo

globalgoals.org's Introduction

The Global Goals

Website GitHub tag style

Screenshot

Website for The United Nations Global Goals for Sustainable Development www.globalgoals.org

Setup

The application requires Node.js version 7 or later. Start with installing all dependencies by running the following command:

$ npm install

Environment variables

The application (both server and front end) depend on a set of environment variables. Define them in a .env file in the project root. The following command will generate a template for you which you to populate with secret keys and whatnot:

$ npm run setup

Start the server

During development use the restart script which loads the variables in the .env file, before starting the server. The server watches for file changes and restarts when needed.

$ npm restart

Technologies

The stack consists of a Node server running Koa and a front end built with Choo. Content is being fetched from the headless CMS Prismic.io.

Routing to and rendering views are all handled by Choo, the server only fetches content and caches the response.

Koa

Koa is a small framework for node which uses the new async/await syntax of ES2017. Just like most other popular web frameworks, Koa relies on middleware that intercepts and handles requests before (optionally) falling through to the next middleware. With Promises and the new async/await syntax this makes for building very lean and expressive applications.

Choo

Choo is a front-end framework for authoring websites and apps using standard JavaScript syntax and APIs. Templates are defined in JavaScript files as template literals and transformed to actual DOM nodes. The generated tree is then compared with and morphed into the real DOM tree updating where needed, much like React, just without the virtual DOM-part.

Note: Choo is currently exploring ways to incorporate components at the framework level. A preview of the proposed solution is implemented in this application.

SUIT CSS

The CSS is written and organized following the SUIT CSS principles. The source is then processed with a few postcss plugins.

Build and deploy

When building the application, take care to update the version field in package.json. The version number is used for breaking cache and ensuring that clients are receiving up to date assets. Npm has a version command that does just this, commits it and generates a git tag.

$ npm version 2.1.0

To build and minify the client application and styles run the build command. The build script will try and load the local .env file so make sure to define (overwriting) the appropriate variables before executing the script.

$ NODE_ENV=production npm run build

The application is built for running on Now but is in no way required to. Any server with node installed should be able to build and host the application.

License

Creative Commons Attribution 3.0 Unported (CC-BY)

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.