Skip to content

jfroom/portfolio-web

Repository files navigation

portfolio-web Build Status Built with Grunt

 

Overview

Static portfolio website & blog template http://jfroom.github.io/portfolio-web

Intent

This project is used to generate my portfolio site and blog. It's a loose framework stubbed out with generic data. Via the settings and data files, meaningful content can be loaded in. The project has been open sourced for academic and sharing purposes. Fork it if you want to, but it not closely maintained.

Technologies

The project leverages:

  • [GruntJS]1
  • [Assemble]2 with [Handlebars]3
  • [Angular]4
  • [Coffeescript]5
  • [Karma Runner]6
  • [Protractor]7
  • [Bootstrap]8
  • [Sass]9
  • [Bower]10
  • [Yeoman]11
  • [Travis]12
  • [Video.js]13
  • [Plato Reporter]14

Getting Started

If you'd like to see the functional end product, the demo site is at http://jfroom.github.io/portfolio-web. Those final static production files, can be found on gh-pages branch.

This codebase requires Node >=4.0, NPM >=3, and Grunt ~1.0.

If you haven't used [Node]15 and [NPM]16 before, be sure to check out the linked documentation.

If you haven't used [grunt]1 before, be sure to check out the [Getting Started]17 guide.

Dependencies

Run npm install in the project folder to install all node dependencies. All bower components are currently part of this repo. (There is some debate on best practices with this - more reading by this SO thread for NPM and [Addy Osmani for Bower components]18.)

node-spritesheet requires ImageMagick be installed.

Build

These build tasks are derived from [Yeoman]11's [WebApp]19 generator (on older grunt version, they've now moved over to gulp!) and a handful of other tools in the grunt ecosystem.

####Development

grunt dev Create the development build.

grunt serve Create the development build, start a local webserver, serve it with live reload and watch for file changes for a refresh.

grunt images Create the spritesheets. grunt dev and grunt prod will passively create the output sprites if they do not exist, but currently if you want to include new sprites or alter existing ones, you'll need to do a foced new build by running this command.

Production

grunt prod Create a deployable build in the dist folder.

grunt serve:prod Create a deployable build, start a local webserver and serve it with live reload.

Deploy

grunt upload Compile the production build and push the results to Amazon's S3 storage based on configuration settings.

grunt gh-pages-upload Do production build, upload to github pages.

Project Settings

In settings.json are configuration variables that will be merged back into node's globally accessible process.env object. Example variables include: SERVER_HOSTNAME, SERVER_PORT, S3_PORTFOLIO_USER, PATH_BLOB.

These values can also be overwritten by any environment variables, this is how secret values such as S3 or credentials get passed in. To learn more about configuring environment variables for your OS, reference google search.

In a shell, an alternate settings file can be loaded: PATH_PORTFOLIO_SETTINGS=~/sites/private/settings.json grunt serve. This is how I can use the same codebase to develop the generic framework and my personal portfolio and blog.

Demo Data

This repository contains generic demo data for the projects section. The PATH_PORTFOLIO_DATA settings/environment variables provide a way to pass in data from an alternate location. This is how I'm able to store the project data in a private repository.

Test

Units

grunt test:unit Runs the Karma Runner tests localed in test/unit folder.

For configuration options, see tasks/test_task.js and tasks/options/karma.js.

Integration/E2E

The integration tests use [Protractor]7 and [Selenium's WebDriver][^seleniumwebdriver] API for browser automation. You can see these instructions on how to get Selenium & Protractor installed locally on your system. Here's a quick list of how to get this working (which worked as of this writing).

  1. npm install -g protractor@4.0.14

  2. webdriver-manager update

  3. Have latest verison of FireFox installed.

  4. grunt serve (or grunt serve:prod).

  5. In a new terminal, grunt test:e2e to run the protractor/jasmine tests located in test/e2e.

TODOs (low priority)

  • Remove compiled css from repo. Should be compiled only into served temp dir and prod dist dir.
  • In the past grunt-protractor-runner was installed to leverage grunt to launch the tests. But there's some type of version conflict in that repo that needs to be resolved. So for now we need to have protractor globally installed and run locally with grunt-shell.
  • Integrate protractor into travis after protractor-runner working again
  • Re-integrate [SauceLabs][^sauce] support

License

Copyright © JFMK, LLC Released under the [MIT License]20.

Footnotes

  1. http://gruntjs.com/ 2

  2. http://assemble.io/

  3. http://handlebarsjs.com/

  4. http://angularjs.org/

  5. http://coffeescript.org/

  6. http://karma-runner.github.io/

  7. https://github.com/angular/protractor 2

  8. http://getbooktstrap/

  9. http://sass-lang.com/

  10. http://bower.io/

  11. http://yeoman.io/ 2

  12. https://travis-ci.org/

  13. http://video.js

  14. https://github.com/es-analysis/plato

  15. http://nodejs.org

  16. https://npmjs.org/

  17. http://gruntjs.com/

  18. http://addyosmani.com/blog/checking-in-front-end-dependencies/

  19. https://github.com/yeoman/generator-webapp

  20. https://github.com/jfroom/portfolio-web/blob/master/LICENSE