Buildfirst
:hammer: JavaScript Application Design: A Build First Approach. Code Samples and Snippets
Install / Use
/learn @buildfirst/BuildfirstREADME
JavaScript Application Design 
A Build First Approach
[![buildfirst.png][1]][3]
Accompanying code samples and snippets for the JavaScript Application Design: A Build First Approach book.
These are the accompanying code samples and snippets for a book I wrote about JavaScript build processes and application architecture. The samples are organized by chapter, and they appear in the same order as they do in the book, for convenience.
Fell out of the skies and would like to learn more about the book?
You could [visit its landing page][3] to learn all about it!
Book buying frenzy? [Say no more, stranger!][4]
Installation Pre-Requisites
You'll need Node.js. You can get the latest version [from their website][5], although I'd suggest using [nvm][6], which makes it super easy to install multiple versions, and switch between them.
You'll need [GraphicsMagick][20], and also phantomjs, to run some of the examples. PhantomJS comes in a module that you can conveniently install as a global.
npm install -g phantomjs
[GraphicsMagick][20] comes in different distributions for OSX, Linux, and Windows, so please [refer to their site][20] to download the appropriate distribution. If you're on Ubuntu, I'd recommend installing it through apt-get. If you're on OSX, you can use brew to install it. These kinds of tooling download automation present the most benefits when you automate all of your development environment provisioning, enhancing consistency across fresh installs in your systems. As an example, [you can take a look at my dotfiles project][21], for reference.
Installation
Once you have Node and the other tools you'll need, use the command below to clone this repository and install all of the dependencies:
curl https://raw.githubusercontent.com/buildfirst/buildfirst/master/install.sh | sh
<sub>If you're on Windows use install-dos.sh, instead.</sub>
That's it! You are now free to roam the sample directories and follow the instructions in each of them!
Manual installation instructions [can be found here][7], but you shouldn't need any of that.
Execution
To run an example, read its [README.md][8] and follow the instructions I've placed there. I tried to make them as straightforward as possible, but sometimes they might not match the examples in the book to the letter.
There are some examples here that you won't find on the book, those will generally be a bit longer: exactly the reason why I didn't include them in the book. Although the code itself might not be present in the book, most of the explaining will definitely be there, rather than here.
Table of Contents
Here is a complete list of the code samples found in this repository.
- Chapter 1
- Chapter 2
- Chapter 3
- Chapter 4
- Chapter 5
- Single Reponsibility Principle
- Information Hiding
- Context Scoping
- Hoisting
- Closures
- Prototypal Modularity
- Common.JS Modules
- Dependency Graphs
- Using RequireJS
- Compiling RequireJS during builds
- Browserify + Common.JS
- Angular.js Dependencies
- Leveraging Bower Packages
- Adopting Component
- Automated Component Build Step
- Circular Dependencies
- Harmony through Traceur, using Grunt
- Chapter 6
- Callback Hell
- Requests Upon Requests
- Error Handling
- Flow
- Functional Tasks
- Queue
- Composition
- Promise Basics
- Promise Flows
- Error Handling Promises
- Event Emitters
- Generator Basics
- [Infinite Sequence](https://github.com/buildfirst/buildfirst/tree/master/ch06/12_generator-basics/01_fibonacci-sequen
Related Skills
clearshot
Structured screenshot analysis for UI implementation and critique. Analyzes every UI screenshot with a 5×5 spatial grid, full element inventory, and design system extraction — facts and taste together, every time. Escalates to full implementation blueprint when building. Trigger on any digital interface image file (png, jpg, gif, webp — websites, apps, dashboards, mockups, wireframes) or commands like 'analyse this screenshot,' 'rebuild this,' 'match this design,' 'clone this.' Skip for non-UI images (photos, memes, charts) unless the user explicitly wants to build a UI from them. Does NOT trigger on HTML source code, CSS, SVGs, or any code pasted as text.
openpencil
2.2kThe world's first open-source AI-native vector design tool and the first to feature concurrent Agent Teams. Design-as-Code. Turn prompts into UI directly on the live canvas. A modern alternative to Pencil.
HappyColorBlend
HappyColorBlendVibe Project Guidelines Project Overview HappyColorBlendVibe is a Figma plugin for color palette generation with advanced tint/shade blending capabilities. It allows designers to
Flyaro-waffle-app
Waffle Delight - Full Stack MERN Application Rules & Documentation Project Overview A comprehensive waffle delivery application built with MERN stack featuring premium UI/UX, admin management, a
