• Stars
    star
    137
  • Rank 266,121 (Top 6 %)
  • Language
    JavaScript
  • Created over 9 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A demo app, built with Ampersand and React as a static Native Web App

HubTags.com

Live site: http://hubtags.com

Sample app built using Ampersand.js using React as a view layer.

This app lets you log in with GitHub and view/edit labels for your repos.

It's compiled into a completely static site and deployed to HubTags.com staticly using Surge.sh.

Running it

You'll need Node.js installed first.

To get download and install everything:

git clone https://github.com/HenrikJoreteg/hubtags.com.git
cd hubtags.com
npm install

To run in development mode:

npm start

When you run it using npm start it will be in development mode which means styles and React components are hotloaded without needing any browser extensions, simply make changes in your editor and save.

To build:

npm run build

When you run npm run build a static site gets created ins /public which can be deployed to surge using npm run yolo (You'll have to change the domain option in package.json to run that script since you don't have permission to deploy to the production domain).

Attempting to simplify dev experience

As much as possible, I'm trying to make the tools get out of our way.

Just run npm start, write your code in the src directory (feel free to use ES6 and JSX), and run a simple deploy script to go live.

Features/Tools

At the end of the day, the goal of all this is to optimize the experience of developing a high quality Native Web App.

In the current landscape, building high quality front-end apps is a giant pain. No one seems to know where to start or what to do. They may have a favorite set of tools but there is basically zero consensus on how to actually build a whole app. Consider the following:

  • You want a run-anywhere web app
  • Devs want to build with modern language and tools (not worry about polyfills, etc)
  • In order to support proper clientside routing you need a server that isn't entirly dumb. It needs to know to have some sort of route "catchall" that returns your javascript, otherwise the client can't control routing.
  • Grunt, Gulp, Browserify, webpack.
  • The JS language itself is a moving target.
  • There's a million frameworks, and everyone including myself has opinions on what they bring to the table.
  • Performance is important
  • Isomorophic all the things! (but how?!, that stuff's hard to get right)

At the end of the day, the developer experience is basically fear, confusion, and a tangle of grunt configs.

This is an attempt to provide a good devloper experience from start to deployment (no ops expertise required) and to create a fast, small, well performing app that's simple to ship.

In order to actually provide a good workflow there's a ton of tools and tech under the hood to handle all the hairy details.

Here's what it uses:

  • Written in ES6+, compiled with Babel.js
  • Uses these Ampersand Modules:
    • ampersand-app
    • ampersand-model
    • ampersand-react-mixin
    • ampersand-rest-collection
    • ampersand-router
  • Webpack powers the development server and build system, and has been configured with hjs-webpack
    • Note that major dependencies of hjs-webpack, like webpack itself are all installed as peerDependencies to allow you to set the exact version you want to use.
    • Same is true of stuff like Babel and React
  • OAuth secrets are kept secret by using a free click-to-deploy instance of github-secret-keeper deployed to Heroku. It's only job is to keep the Client Secret for the Github app, a secret.
  • Backbutton and proper URLs are implemented with ampersand-router and made possible in a static site due to Surge's clever approach of using a 200.html file at your root as the catchall (if present). You can learn more by reading the surge intro post
  • Uses yeticss.com for styles.
    • Stylsheets are imported (required) from within the application code just like JS (thanks webpack)
    • During development they're bundled into the main JS bundle
    • When the build script is run, a seperate minified CSS file is produced in the /public dir
  • Uses autoprefixer-stylus to seemlessly insert those pesky -moz, -webkit prefixes where required.
  • Use GitHub's Octicon icon set
    • Installed via npm just like other assets.
    • required in /src/app.js with this line import octicons from 'octicons/octicons/octicons.css'
    • Thanks to the webpack file-loader as configured in hjs-webpack the icon fonts are inlined as base64 so you don't have to think about relative URLs in CSS. No manually copying assets into output directory needed, just npm install and require CSS.
  • We use React as the view layer.
  • We do partial isomorphic rendering by statically pre-rendering the React component used for layout on the front end, as well as the logged out homepage view. So, most of the benefits of isomorphic apps, but none of the complexity of trying to dynamically render client code on the server.
  • We use Surge to actually deploy (which becomes the easiest part of the whole thing).

Running it

git clone [email protected]:HenrikJoreteg/hubtags.com.git
cd hubtags.com
npm i
npm start

Then open your browser to: http://localhost:3000

More

Bu...bu...bu... but you're building apps that require JavaScript?! Yes, I explain that in this talk I gave at FFConf 2014.

I'm teaching several workshops on building static Native Web Apps, such as FluentConf, Future Insights Live, edUi, and FrontendMasters.

I wrote a book called Human JavaScript, and I'm working on a second edition covering tools/approaches introduced here.

You can also follow me on Twitter: @HenrikJoreteg.

More Repositories

1

hjs-webpack

Helpers/presets for setting up webpack with hotloading react and ES6(2015) using Babel.
JavaScript
1,789
star
2

ICanHaz.js

A clean solution for templating with Mustache.js and jQuery or Zepto
JavaScript
837
star
3

feather-app

as light as a...
JavaScript
718
star
4

create-keyframe-animation

Generate CSS keyframe animations dynamically in the browser with JavaScript.
JavaScript
716
star
5

redux-bundler

Compose a Redux store out of smaller bundles of functionality.
JavaScript
581
star
6

fixpack

A package.json file scrubber for the truly insane.
JavaScript
461
star
7

Capsule

Realtime web app framework for Backbone, socket.io and node.js
JavaScript
415
star
8

Happy.js

$('form').isHappy() – Lightweight, extensible form validation plugin for jQuery/Zepto.js
JavaScript
412
star
9

html-parse-stringify

Parses well-formed HTML (meaning all tags closed) into an AST and back. quickly.
JavaScript
337
star
10

templatizer

Simple solution for compiling jade templates into vanilla JS functions for blazin' fast client-side use.
JavaScript
303
star
11

money-clip

For managing your client side cache. Tiny wrapper over IndexedDB supporting versioning and max age.
JavaScript
233
star
12

wildemitter

A super lightweight EventEmitter similar to what comes in Node.js, but with a support for wildcard events '*'
JavaScript
213
star
13

emoji-images

replace stuff like ❤️ with <img> tags of corresponding images per: http://www.emoji-cheat-sheet.com/
JavaScript
173
star
14

moonboots

A set of conventions and tools for bundle and serving clientside apps with node.js
JavaScript
159
star
15

webrtc.js

WebRTC abstraction for managing it simple to manage multiple peer connections of various types.
JavaScript
158
star
16

getconfig

Config file reader for node.js projects that detects environment based on NODE_ENV.
JavaScript
116
star
17

andlog

Super-simple, client-side CommonJS logging thingy
JavaScript
97
star
18

github-secret-keeper

Microservice to enable GitHub login for multiple server-less applications.
JavaScript
86
star
19

human-javascript

Book on building sanely architected JS apps
CSS
80
star
20

human-model

Strict models are a drop-in replacement for Backbone models but are far more restrictive and structured.
JavaScript
75
star
21

humanjs-sample-app

Sample app for human javascript book
JavaScript
67
star
22

milliseconds

Insanely lightweight module for converting times to milliseconds.
JavaScript
62
star
23

masters

Repo to follow along with Frontend Masters class
JavaScript
60
star
24

redux-bundler-worker-example

Redux-bundler with store and bundler running inside a worker
JavaScript
58
star
25

clientconfig

Super simple clientmodule for passing config items, such as API connection URLs, debug modes, etc from server to client.
JavaScript
56
star
26

webrtcsupport

Browser module to detect support for WebRTC and extract proper constructors.
JavaScript
55
star
27

internal-nav-helper

Helper function for handling internal navigation in Single Page Apps (SPAs) in ~250 bytes before gzip.
JavaScript
52
star
28

feather-route-matcher

featherweight url to handler matching
JavaScript
42
star
29

redux-bundler-react

Bindings for redux-bundler to React
JavaScript
37
star
30

redux-bundler-example

Example app built with redux-bundler
JavaScript
34
star
31

human-view

A smart base view for Backbone apps, to make it easy to bind collections and properties to the DOM.
JavaScript
33
star
32

humanjs

Application scaffolding and documentation repo for Human JavaScript Apps
JavaScript
32
star
33

ric-shim

requestIdleCallback shim that won't blow up if used in node.js
JavaScript
29
star
34

featherweight

JavaScript
28
star
35

reformer

Self-contained, self-rendering, self-validating forms that can only output valid data.
JavaScript
26
star
36

hapi-dummy-api

Generate dummy APIs for hapi.js, for building clientside apps before the real API is done.
JavaScript
26
star
37

worker-proof

Enables calling out to main thread from a worker to register callbacks, etc.
JavaScript
26
star
38

redux-persist-middleware

Creates Redux middleware that will lazily persist data from certain reducers, when certain actions occur.
JavaScript
26
star
39

react-internal-nav

React component with single 'onInternalNav' callback for handling clicks on <a> local to domain.
25
star
40

babel-plugin-h-children-fix

Allows use of standard babel JSX tools with virtual-dom/h
JavaScript
25
star
41

appcache-serviceworker-generator

Can generate an appcache manifest and ServiceWorker from same abstraction.
JavaScript
24
star
42

image-to-data-uri.js

Clientside module (compatible with clientmodules) that takes an image url, downloads the image and creates a data URI for caching, etc.
JavaScript
23
star
43

tryit

Module to wrap try-catch for better performance and cleaner API.
JavaScript
22
star
44

window-watcher

State object you can listen to for changes to window width.
JavaScript
19
star
45

slugger

Dead simple string slugification (a. la. django) for node and the broswer.
JavaScript
18
star
46

create-selector

Wrapper for reselect to allow deferring creation of selectors.
JavaScript
18
star
47

native-promisify-if-present

Return a promise from a callback-as-last-argument function using native a Promise, but only if native Promises exist.
JavaScript
17
star
48

jquery-sliding-message

Nice way to show messages to users
JavaScript
16
star
49

semi-static

Simple, lazy way to serve a directory of semi-static pages in express.js. Handy for building quick "static" pages inside an otherwise "dynamic" app.
JavaScript
15
star
50

key-tree-store

Simple tool for storing/retrieving objects events based hierarchical key paths.
JavaScript
14
star
51

dot-net-article

13
star
52

loading-stats

Client module for reporting real-world single page application performance back to you in your metrics.
JavaScript
13
star
53

video-recorder

Experimental browser module for recording contents of a `<video>` tag by taking dataURI snapshots of it.
JavaScript
12
star
54

set-query-string

Updates the browser's query string in place, so you can bind it to some dynamic query in your app
JavaScript
11
star
55

fluent-2016

Building a lightweight mobile-web app with React and Redux
JavaScript
11
star
56

time-counter

Dead-simple js module for drawing (or simply measuring) time countdowns or counters in js. Works in node and browser.
JavaScript
11
star
57

timple

Simple templating for service workers using valid javascript files as the template
JavaScript
11
star
58

sinks

Tools for object sync (get it?!), validation, diffing, and immutable deep setting
JavaScript
10
star
59

Yo-Moma

Nerdpoints for the best nerdy yo mama joke. Bonus points for git references.
10
star
60

joreteg.com

My new site
HTML
9
star
61

system-requirements.js

Boxed software has 'em, now the web does too.
JavaScript
9
star
62

jquery.dd

Simple replacement for select boxes that are totally css stylable
JavaScript
9
star
63

favicon-setter

Dead-simple favicon updating from JS. Plays nicely with jQuery and CommonJS but has no dependencies.
JavaScript
9
star
64

redux-bundler-worker

Utilities for running a redux-bundler app inside a worker
JavaScript
9
star
65

clientmodules

A small util for using npm to install clientside packages.
JavaScript
8
star
66

fingertips

Touch event handling for mobile web apps
JavaScript
8
star
67

columnizer

A simple tool for printing text in nice columns in the terminal.
JavaScript
8
star
68

redux-bundler-preact

Preact bindings for redux-bundler
JavaScript
8
star
69

jquery-magic-labels

Grabs content of label tag to display as placeholder inside text inputs
JavaScript
8
star
70

wake-event

Browser module for detecting when your computer wakes up from sleep. Based on Alex MacCaw's clever trick.
JavaScript
7
star
71

preact-nav-helper

Preact component for catching and handling internal links in your application.
JavaScript
7
star
72

mit.joreteg.com

license site I can link to from open source projects
HTML
6
star
73

bind-transforms

Bind models properties to properly prefixed CSS transforms in backbone/humanjs views.
JavaScript
6
star
74

humanjs-resources

Curated collection of simple modules solving specific problems relating to building single page apps.
JavaScript
6
star
75

SoundEffectManager

A simple sound effect manager for playing sounds using the awesome HTML 5 Web Audio API
JavaScript
6
star
76

library-api

Simple, restful, demo JSON API written in Hapi.js
JavaScript
6
star
77

ampersand-local-cache-mixin

Only fetch when your data is old or stale. Easily configurable localStorage cache for ampersand & backbone state objects, models, and collections.
JavaScript
6
star
78

transform-style

Apply transform style property with proper prefix to an element. For use with browserify / CommonJS.
JavaScript
5
star
79

holy-grail-ios-layout

Attempt at holy grail mobile safari layout/behavior.
JavaScript
5
star
80

edui

Codebase for edui workshop
JavaScript
5
star
81

labelr-ampersand

class outline and resources
JavaScript
5
star
82

jsconfbr

Sample code for simple webrtc demo
JavaScript
5
star
83

statey

An observable, extensible state object with derived watchable properties.
JavaScript
5
star
84

extend-object

Underscore's extend method as a standalone Common JS module.
JavaScript
5
star
85

google-cloud-signedurl-test-case

Trying to figure out how to make this work :-/
JavaScript
5
star
86

array-next

Advance to the next item in the array looping when hitting the end.
JavaScript
5
star
87

cookie-getter

Super simple, performant, clientside cookie reader and nothing else. CommonJS and clientmodules compatible.
JavaScript
5
star
88

Half-SASS

A partial SASS implementation written in CF
ColdFusion
4
star
89

add-keyup-events

Emit custom events from an input so you can do stuff like listening for "enter" and "esc" events the same way as you would "keyup".
JavaScript
4
star
90

humanjs-codealong-app

JavaScript
4
star
91

get-css-translated-position

Get position of DOM elements positioned with CSS translate
JavaScript
4
star
92

docs.humanjavascript.com

Docs site for humanjs tools
JavaScript
4
star
93

Strophe.js-Plugins

A collection of strophe plugins that let you work with native JavaScript instead of XML
JavaScript
4
star
94

wakelock-lazy-polyfill

Use nosleep.js as a lazy-loaded polyfill for WakeLock API
JavaScript
4
star
95

rollup-plugin-css

Rollup plugin for aggregating and outputting CSS
JavaScript
4
star
96

labelr

JavaScript
3
star
97

dob-to-age

Determines current age based on a date of birth string YYYY-MM-DD using same weird logic we humans do.
JavaScript
3
star
98

reality

Physics simulation runner for web UIs
JavaScript
3
star
99

dotnet-dashboard.andbang.com

A team dashboard app for And Bang 2.0
JavaScript
3
star
100

parse-dob

Turn a wide range of freeform inputs describing someone's birth date into `YYYY-MM-DD` using locale to get proper day / month order.
JavaScript
3
star