twolfson.com

Repository for twolfson.com

MIT License

Stars
13

twolfson.com Build status

Repository for https://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 our dependencies
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 environment variables. To update a secret, update it in:

  • .env.development with a mock example
  • .env.development.local for actual usage
  • In each server, under /etc/supervisord.conf

Historically we used SOPS but it was overkill for a simple blog server, and setup across new computers was tedious with no extra value.

Additional documentation can be found in:

CSS

Our CSS is written in SASS.

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: https://livereload.com/extensions/

Code organization

Folders

  • articles/ - GitHub Flavored Markdown files for blog posts
  • bin/twolfson.com - Executable to start twolfson.com locally
  • config/ - 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 donations.

https://twolfson.com/support-me

License

Copyright (c) 2013-2014 Todd Wolfson

Licensed under the MIT license.