Back-end developer
★ Hard to hire
★ Used to work with:
★ Databases
★ Services
★ Ruby
Slide 9
Slide 9 text
Front-end developer
★ Even harder to hire
★ Today mostly JavaScript based:
★ Grunt/Gulp/Broccoli/Webpack/etc.
★ Might not like use Ruby
Slide 10
Slide 10 text
Working as a team
★ JavaScript/Node might be harder to install
than expected
★ Ruby might be harder to install than expected
★ Note to self: Not everybody is using a
MacBook
Slide 11
Slide 11 text
Do you want to
combine this?
Slide 12
Slide 12 text
Might cost time.
Slide 13
Slide 13 text
Better use the time
to separate concerns.
Slide 14
Slide 14 text
Split up your
architecture
Slide 15
Slide 15 text
A typical project
Slide 16
Slide 16 text
Why
Phone
Apps?
Slide 17
Slide 17 text
Why
Phone
Apps?
APP
APP
HTML
and
CSS
Slide 18
Slide 18 text
(The architecture might look like this:)
Slide 19
Slide 19 text
(Step 1: Get the CSS out of the applications by creating a global front-end style guide)
(3 × copy & paste)
(actual Step 1: We created an additional version of the HTML templates and more complexity)
Slide 24
Slide 24 text
(Step 2: Get the HTML out of the applications and providing the templates as API)
Slide 25
Slide 25 text
HTML can’t live without CSS
CSS can’t live without HTML
CSS
HTML
Slide 26
Slide 26 text
(Example for a style guide describing an API partial. The style guide is just the API
documentation.)
Slide 27
Slide 27 text
Remote partials
Slide 28
Slide 28 text
How to implement?
Slide 29
Slide 29 text
Different approaches
★ Completely separate
★ Two applications combined
★ As Ruby Gem
★ Monolith application
Slide 30
Slide 30 text
Completely separate
+Back end (Rails)
+Front end (JS on developing machine)
−Slow change processes
★ API:
★ Provide templates (e. g. as JSON)
★ Load all templates into back end at startup
Slide 31
Slide 31 text
Two apps combined
+Run the application (e. g. Rails) normally
+Run the front-end app (e. g. Middleman)
+Changes can be done more easily
−Still does not solve different working
environments
#protip: Use Foreman
Slide 32
Slide 32 text
GEM
+Include it into every app
+Helpers can be shared
+Form builders are possible
−Ruby back end only
−Harder to develop (Git)
Slide 33
Slide 33 text
One app
+Nothing much to change
+Share partials between app and style guide
−Still does not solve different working
environments
Slide 34
Slide 34 text
Versioning
Slide 35
Slide 35 text
Visual changes
★ CSS changes in the style guide
★ HTML in the app must reflect this
Slide 36
Slide 36 text
Example
Old version: New version:
(Applying this wrapper to all fields in the application might be a lot of work)
Slide 37
Slide 37 text
Version numbers
★ Gem version
★ NPM version
Slide 38
Slide 38 text
Git commit hash
★ Just refer to latest commit hash
★ Get the matching HTML for the CSS
Slide 39
Slide 39 text
Testing
Slide 40
Slide 40 text
Atomic design
@brad_frost
Slide 41
Slide 41 text
Split it up
Front end templates
(partials)
Back end views
(e. g. Rails)
API
Slide 42
Slide 42 text
Test it
Unit tests
(regression testing)
Integration tests
(e. g. Cucumber)
API
Slide 43
Slide 43 text
Regression testing
Old version: New version:
(Button height fails: Pink parts show diff.)
Slide 44
Slide 44 text
Default test Edge case test
Test cases
Slide 45
Slide 45 text
What’s an edge case?
★ Having the same HTML with different amount
of text
★ Having the same HTML without image (user
with no profile image)
★ Having the same HTML with too small image
Slide 46
Slide 46 text
Front end
Takes care that the
★ design won’t break
★ content won’t break
★ devices won’t break
Back end
Takes care that the
★ work flows won’t break
★ user input won’t break
★ security won’t break
Slide 47
Slide 47 text
JavaScript
Slide 48
Slide 48 text
Depends on the
framework.
(Backbone, React, and Ember might work well, Anguler could be tricky.)
Slide 49
Slide 49 text
I18n
Slide 50
Slide 50 text
Might be part of the
front end.
Slide 51
Slide 51 text
Why?
★ Translations need typography
★ Typography requires designers
★ Designers work in the front-end team
Slide 52
Slide 52 text
100 % 50 % 0%
(a designer knows which spacing is right)
Slide 53
Slide 53 text
I18n is design
and user experience.
Slide 54
Slide 54 text
Conclusions
Slide 55
Slide 55 text
Learnings
★ Keep it as simple as possible
★ Try using Mustache
★ Test the setup before releasing to your co-
workers (Readme, Mac/Win/Linux, …)
Slide 56
Slide 56 text
Takeaways
★ Your team must feel comfortable with your
architecture
★ Front end and back end getting more and
more different
★ Cherry-pick the parts you need
★ Some JS frameworks might be hard to use