Repository for twolfson.com
JavaScript CSS HTML Shell Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
articles
bin
config
docs
public
server
test
.gitignore
.jscsrc
.jshintrc
.nodemonignore
.travis.yml
CHANGELOG.md
LICENSE-MIT
README.md
Vagrantfile
gulpfile.js
package.json

README.md

twolfson.com Build status

Repository for http://twolfson.com/

This server is written on top of express, for routing and views, and jojo, for blog entries.

We use inuit.css as our CSS framework to provide OOCSS and BEM conventions.

Getting started

The following steps will get a server running locally:

# Clone the repository
git clone https://github.com/twolfson/twolfson.com
cd twolfson.com

# Install dependencies and copy non-decrypted config
CONFIG_COPY_ONLY=TRUE npm install

# Run the server
npm start # should say 'Server running at http://localhost:8080/'
# For continuous development, use `nodemon`
# nodemon -x bin/twolfson.com

The server should be accessible via your browser at http://localhost:8080/

Documentation

Development

Configuration

Our secrets are stored in version control and managed via SOPS. To update a secret, run:

# Opens file in `$EDITOR` and syncs secret to decrypted fiile
bin/edit-config-file.sh {{file}}
# Example: bin/edit-config-file.sh config/secret.enc.json`

To decrypt the current secrets in config, run:

# Decrypts all secret files in `config` (e.g. `secret.enc.json`)
bin/decrypt-config.sh

CSS

Our CSS is written in SASS and compiled via libsass.

CSS compilation is run by default as part of the main gulp build task but can be run standalone:

gulp build-css

Images

Images are compiled into spritesheets via gulp.spritesmith. These are run via a standalone gulp task:

gulp sprite

JS

External JS libraries are managed via bin/bootstrap.sh. To install the latest versions, please run:

bin/bootstrap.sh

As with CSS these are run by default as part of the main gulp build task but can be run standalone:

gulp build-js

Automated recompiled and refreshes

We leverage gulp to automatically re-run JS and CSS tasks when their files change.

Additionally, they are integrated with LiveReload. When the complementary browser extension is installed, your browser will automatically reload CSS or refresh the page upon changes.

npm run develop

LiveReload extension: http://livereload.com/extensions/

Code organization

Folders

  • articles/ - GitHub Flavored Markdown files for blog posts
  • bin/twolfson.com - Executable to start twolfson.com locally
  • config/ - Decrypted files from config.env/
  • config.enc/ - Static configuration files and resource initialization
  • dist/ - Minified public files
  • server/ - Container for majority of app
    • index.js - Constructor for server that binds view and routing middlewares
    • controllers/ - Business logic for server endpoints
    • models/ - External data for the server to read in
    • routes.js - Attachements for controllers/ to URLs
    • views/ - HTML templates written in Jade
  • public/ - CSS, images, and JavaScript for client side pages
  • test/ - Container for various test types
    • integrations-tests/ - BDD tests written in mocha that test server behavior
    • perceptual-tests/ - Perceptual diffs that detect visual changes across pages
    • production-tests/ - BDD tests written in Mocha for [twolfson.com][twolfson.com]
    • utils/ - Common utilities used for starting up/tearing down servers and making HTTP requests

Files

  • CHANGELOG.md - Record of changes that have happened on the server
  • README.md - Documentation for the project
  • gulpfile.js - Configuration for various tasks via gulp

Donating

Support this project and others by twolfson via gratipay.

Support via Gratipay

License

Copyright (c) 2013-2014 Todd Wolfson

Licensed under the MIT license.