SlideShare a Scribd company logo
Rails, Postgres,
Angular, and Bootstrap
The Power Stack
@davetron5000
Journey through the
“stack”
Full Stack is important
“Jack of all trades,
master of none…
…oftentimes better
than master of one”
UI
Rails, Postgres, Angular, and Bootstrap: The Power Stack
Rails, Postgres, Angular, and Bootstrap: The Power Stack
Learn about design
Rails, Postgres, Angular, and Bootstrap: The Power Stack
MY AMAZING
APP!
MY AMAZING
APP!
Text
Modular Type Scale
Subhead 1
Subhead 2
Subhead 3
Body Text
Captions & Secondary Text
About Us
The place for all your needs
We’ve got everything you
could ever want and then
some. It’s just that simple to
be as awesome as we are,
and it shows.
You can’t find this much great
stuff anywhere else, so what
are you waiting for? Sign up
Sign Up
Log In
Help
Rails, Postgres, Angular, and Bootstrap: The Power Stack
Rails, Postgres, Angular, and Bootstrap: The Power Stack
<div class="row">
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
</div>
<div class="row">
<div class="col-md-8">.col-md-8</div>
<div class="col-md-4">.col-md-4</div>
</div>
<form class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">Email</label>
<div class="col-sm-10">
<input type="email" class="form-control" id="inputEmail3" placeholder="Email">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-2 control-label">Password</label>
<div class="col-sm-10">
<input type="password" class="form-control" id="inputPassword3" placeholder="Password">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox"> Remember me
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default">Sign in</button>
</div>
</div>
</form>
<form>
<label for="inputEmail3" class="col-sm-2 control-label">Email</label>
<input type="email" class="form-control" id="inputEmail3" placeholder="Email">
<label for="inputPassword3" class="col-sm-2 control-label">Password</label>
<input type="password" class="form-control" id="inputPassword3" placeholder="Password">
<label>
<input type="checkbox"> Remember me
</label>
<button type="submit" class="btn btn-default">Sign in</button>
</form>
<button type=“button” class=“btn btn-default”>Default</button>
<button type=“button” class=“btn btn-primary”>Primary</button>
<button type=“button” class=“btn btn-primary btn-lg”>Large</button>
<button type=“button” class=“btn btn-primary btn-xs”>XS</button>
Default
Default
Default
Default
<div class=“alert alert-success”>…</div>
alert-info
alert-warning
alert-danger
Panel
Icons
Sub-panel
Well
Disabled
Badge
Interaction
JavaScript & jQuery
You shouldn’t think about
locating DOM elements and
firing or responding to events
<div class=“dialog js-dismissable”>
<h1>OK?</h1>
<nav>
<button data-dismiss=“yes”>Close</button>
<button data-ok>OK</button>
</nav>
</div>
$(“.js-dimissable”).find(“[data-ok]”).click(function() {
// ...
});
Components &
Behavior
<dialog>
<title>OK?</title>
<dismiss>Close</dismiss>
<confirm>OK</confirm>
</dialog>
dialog.on_confirm(function() {
// ...
});
Rails, Postgres, Angular, and Bootstrap: The Power Stack
Some
Documentation
Kinda
Works
No
Support
Yeah, there’s probably some
code comments, and it’s
entirely possible I used great
variable names. Functions
and objects should be
consistent, but probably
aren’t. I think there was a
demo page somewhere,
maybe?
It still doesn’t handle that
weird case on IE 8, and I
never tested what happens if
you use two containers in the
same DOM subtree, but CSS
polyfills mostly work for major
browsers. No, there’s no test
suite.
I’m moving onto a project
using Node, Elixir, Redis,
Mongo, and Kubernetes, so
the best thing to do is hang
out on the Slack channel. I
live in New Orleans, but work
Amsterdam hours, so I’m not
always around.
JS
Rails, Postgres, Angular, and Bootstrap: The Power Stack
<aside class=“modal-dialog”>
<h1>{{ title }}</h1>
<p ng-if=“message”>
{{ message }}
</p>
<button ng-click=“dismiss()”>Close</button>
<button ng-click=“ok(‘ok’)”>OK</button>
<button ng-click=“ok(‘maybe’)”>Maybe</button>
</aside>
“DialogController”,
function($scope, $dialog, opts) {
$scope.title = opts.title;
$scope.message = opts.message;
$scope.ok = function(data) {
if (data == ‘ok’) {
$dialog.confirm();
}
else {
$dialog.confirm(withData: data)
}
}
$scope.dismiss = function() {
$dialog.cancel();
}
User = $resource(“/users/:id”);
$scope.user = User.get(id: $routeParams.id);
<article>
<h1>{{ user.name }}</h1>
<h2>{{ user.email }}</h2>
<ul ng-repeat=“login in user.recentLogins”>
<li>
<strong>{{ login.date }}</strong> -
{{ login.ipAddress }}
</li>
</ul>
</article>
angular.module(‘controllers’).controller(
“DialogController”,
function($scope, $dialog, opts) {
$scope.title = opts.title;
$scope.message = opts.message;
$scope.ok = function(data) {
if (data == ‘ok’) {
$dialog.confirm();
}
else {
$dialog.confirm(withData: data)
}
}
$scope.dismiss = function() {
$dialog.cancel();
}
});
“customConfirmation”,
function() {
return {
confirm: function($dialog,data) {
if (data == ‘ok’) $dialog.confirm();
else $dialog.confirm(withData: data);
}
}
}
);
angular.module(‘controllers’).controller(
“DialogController”,
function($scope, $dialog, opts, customConfirmation) {
$scope.title = opts.title;
$scope.message = opts.message;
$scope.ok = customConfirmation.confirm;
$scope.dismiss = function() {
$dialog.cancel();
}
Angular is Popular
The “Back End”
Middleware
Parse HTTP
Extract params, headers,
cookies, etc
Route to code
Read result
Generate response, cookies,
headers, etc.
Database Access
Package Assets
Run Tests
Schema Management
Configuration & Deployment
Parse HTTP
Extract params, headers,
cookies, etc
Route to code
Read result
Generate response, cookies,
headers, etc.
Database Access
Package Assets
Run Tests
Schema Management
Configuration & Deployment
Plumbing
Your Code
Don’t make decisions
Rails, Postgres, Angular, and Bootstrap: The Power Stack
Rails, Postgres, Angular, and Bootstrap: The Power Stack
Rails, Postgres, Angular, and Bootstrap: The Power Stack
Data
Durability
Integrity
Speed
Modeling
SQL RDBMS
First: Learn SQL. You
won’t regret it.
Rails, Postgres, Angular, and Bootstrap: The Power Stack
ALTER TABLE
users
ADD CONSTRAINT
valid_emails
CHECK (
( guest = true AND
email ! ‘[A-Za-z0-9._%-]+@example.com’)
OR
( guest = false AND
email ~ ‘[A-Za-z0-9._%-]+@example.com’)
)
CREATE INDEX
users_name_index
ON
users (lower(name))
SELECT * FROM users
WHERE lower(name) = ‘bob’;
UPDATE users
SET config = ‘auto_save => true,
color => default’::hstore;
CREATE INDEX user_config
ON users USING GIN(config);
ALTER TABLE
users
ADD COLUMN
config HSTORE;
SELECT * FROM users
WHERE config @> ‘auto_save => true’;
ALTER TABLE
users
ADD COLUMN
roles text[];
UPDATE users
SET roles = ‘{staff,admin}’;
CREATE INDEX user_roles
ON users USING GIN(roles);
SELECT * FROM users
WHERE roles @> ‘{admin}’;
ALTER TABLE
transactions
ADD COLUMN
braintree_response JSONB;
UPDATE transactions
SET braintree_response = ‘{
“processor_response”: “decline”,
“processor_code”: 1234,
“details”: {
“charge_type”: “authorization”,
“amount”: 12.45,
“zip”: “20002”
}
CREATE INDEX txn_responses
ON transactions
USING GIN(braintree_response);
SELECT * FROM
transactions
WHERE
roles @>
‘{“processor_response”: “decline”}’::jsonb;
SQL Knowledge + Postgres
== Powerful data layer
Putting it all Together
Be Honest about
Weaknesses
Bootstrap
• JS-based components require jQuery
• Angular-UI-Bootstrap
Angular
• Protractor (end-to-end testing) totally disconnected
from Rails/back-end
• Use Capybara/PhantomJS for E2E testing
Rails
• Strange view/front-end/JS/AJAX design
• Avoid
• Disable turbolinks
• Asset Pipeline oddities
• Learn to use it—it’s actually powerful
Rails
• Database Migrations “DSL”
• You are not making a database-agnostic app
• Use execute
• Use SQL-based schema
config.active_record.schema_format = :sql
Rails
• ActiveRecord
• Examine queries in the log—look for
optimizations
• Let SQL shine
• Don’t fear .where() or
ActiveRecord::Base.connection.exec_query()
Postgres
• Stored Procedures
• Triggers
• Avoid putting business logic here
You don’t have to use
every feature
These are powerful
tools
The reduce the decisions
you have to make to only
what’s important.
If you are making decisions
not related to your product…
…consider Bootstrap,
Angular, Rails, or Postgres

More Related Content

KEY
Week 4 - jQuery + Ajax
PPTX
jQuery from the very beginning
PPTX
jQuery PPT
ODP
Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...
PDF
jQuery in 15 minutes
PPTX
JavaScript and jQuery Basics
PPTX
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Week 4 - jQuery + Ajax
jQuery from the very beginning
jQuery PPT
Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...
jQuery in 15 minutes
JavaScript and jQuery Basics
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology

What's hot (20)

PPTX
jQuery Best Practice
PDF
Hacking Your Way To Better Security - php[tek] 2016
PPT
JQuery introduction
PPT
PPT
PDF
Javascript
PDF
22 j query1
PPTX
AngulrJS Overview
PDF
Learning jQuery in 30 minutes
PPTX
PDF
Scalable vector ember
KEY
jQuery Anti-Patterns for Performance & Compression
PDF
Devoxx 2014-webComponents
PPT
Javascript1
PDF
Web 6 | JavaScript DOM
ODP
Introduction to jQuery
PPTX
jQuery Presentation
PDF
jQuery and Rails, Sitting in a Tree
PPTX
Hacking Your Way To Better Security - DrupalCon Baltimore 2017
PPTX
Jquery Complete Presentation along with Javascript Basics
jQuery Best Practice
Hacking Your Way To Better Security - php[tek] 2016
JQuery introduction
Javascript
22 j query1
AngulrJS Overview
Learning jQuery in 30 minutes
Scalable vector ember
jQuery Anti-Patterns for Performance & Compression
Devoxx 2014-webComponents
Javascript1
Web 6 | JavaScript DOM
Introduction to jQuery
jQuery Presentation
jQuery and Rails, Sitting in a Tree
Hacking Your Way To Better Security - DrupalCon Baltimore 2017
Jquery Complete Presentation along with Javascript Basics
Ad

Similar to Rails, Postgres, Angular, and Bootstrap: The Power Stack (20)

PPT
Heroku Waza 2013 Lessons Learned
KEY
CICONF 2012 - Don't Make Me Read Your Mind
PDF
Yii blog-1.1.9
PDF
Solid in practice
PDF
ITB2019 10 in 50: Ten Coldbox Modules You Should be Using in Every App - Jon ...
PDF
From University to Real Life
PDF
SOLID in Practice
PDF
Do your test
PDF
www.webre24h.com - [O`reilly] javascript cookbook - [powers]
PDF
PDF
User Login in PHP with Session & MySQL.pdf
PPTX
Database Trends for Modern Applications: Why the Database You Choose Matters
PPTX
PHP_Course_Final.pptx
DOCX
resume
PDF
Building scalable products with WordPress - WordCamp London 2018
KEY
深入淺出RoR
DOCX
Angular
PDF
Why ruby on rails
PDF
[2015/2016] Local data storage for web-based mobile apps
PDF
Road to Rails
Heroku Waza 2013 Lessons Learned
CICONF 2012 - Don't Make Me Read Your Mind
Yii blog-1.1.9
Solid in practice
ITB2019 10 in 50: Ten Coldbox Modules You Should be Using in Every App - Jon ...
From University to Real Life
SOLID in Practice
Do your test
www.webre24h.com - [O`reilly] javascript cookbook - [powers]
User Login in PHP with Session & MySQL.pdf
Database Trends for Modern Applications: Why the Database You Choose Matters
PHP_Course_Final.pptx
resume
Building scalable products with WordPress - WordCamp London 2018
深入淺出RoR
Angular
Why ruby on rails
[2015/2016] Local data storage for web-based mobile apps
Road to Rails
Ad

Recently uploaded (20)

PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Nekopoi APK 2025 free lastest update
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
AI in Product Development-omnex systems
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Introduction to Artificial Intelligence
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Digital Strategies for Manufacturing Companies
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Transform Your Business with a Software ERP System
Odoo POS Development Services by CandidRoot Solutions
PTS Company Brochure 2025 (1).pdf.......
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
How Creative Agencies Leverage Project Management Software.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
wealthsignaloriginal-com-DS-text-... (1).pdf
Nekopoi APK 2025 free lastest update
Which alternative to Crystal Reports is best for small or large businesses.pdf
AI in Product Development-omnex systems
Design an Analysis of Algorithms I-SECS-1021-03
Introduction to Artificial Intelligence
How to Migrate SBCGlobal Email to Yahoo Easily
Digital Strategies for Manufacturing Companies
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Transform Your Business with a Software ERP System

Rails, Postgres, Angular, and Bootstrap: The Power Stack

Editor's Notes

  • #2: • thanks for coming • this is a powerful stack • can solve many common problems
  • #3: • stop along the way • outline common problems when working in that part • see how these technologies solve those problems
  • #4: • important to understand why this is important • we are at a full stack conference
  • #5: • I like the more rare, complete version • with an holistic view, you can solve problems end-to-end • little friction between what you want to deliver and what you can deliver • work with specialists if you need them
  • #6: • this is what your users think of as “the app” • how should it look? • how should it work?
  • #7: • We aren’t creating products differentiated on HCI • We aren’t creating a product that innovates on HCI
  • #8: • solving people’s problems • helping someone be more successful at their job • can’t build the former without a lot of the latter
  • #9: • a little goes a long way • with a few hours reading, you will be leveled up
  • #10: • Grid based design foundation of print and web design
  • #11: • Everything on a page should be aligned to a grid
  • #12: • when it’s aligned, your design is cohesive, polished, and professional
  • #13: • The grid reduces choices to just a few that will work great. • you can apply the same logic to font sizes • you just need six or seven fonts
  • #14: • The grid reduces choices to just a few that will work great. • you can apply the same logic to font sizes • you just need six or seven fonts
  • #15: • the page comes together • you can direct the user with just font size
  • #17: • when forms and complex components are needed, use padding/margins that work with the grid and type scale
  • #18: • There are many many CSS frameworks • Bootstrap is full-featured, easy to use, easy to understand, and hard to mess up
  • #19: • It has a grid and modular type scale •
  • #20: • Your forms won’t look terrible
  • #21: • Many other components that you need for common tasks
  • #24: • web apps aren’t static • simplest ones need dialogs, showing/hiding things, async loading
  • #25: • This means JavaScript • JS and JQ are very low level
  • #27: • Your code should be at the component and behavior level of abstraction
  • #28: • You want your logic tested without clicking around in a browser • You don’t want your view littered with data elements and js classes
  • #29: • You can achieve this in JS or jQuery • but you end up making your own degenerate framework • that is undocumented and no one can use
  • #30: • you shouldn’t build a framework while you are building features • you should use the hard work of others • Angular can do all of these things
  • #31: • it’s clear what the intent is here, and how this will behave
  • #32: • Aside from the boilerplate, this is simple code • it’s not wrapped up in the framework • it’s easily testable • it just uses simple javascript objects.
  • #33: • uses promises so you have no callback hell
  • #34: • you have a clear way to extract and abstract code • there’s nothing really fancy or magical about it
  • #35: • you have a clear way to extract and abstract code • there’s nothing really fancy or magical about it
  • #36: • don’t undervalue this • lots of resources, help, documentation • you won’t find systemic issues in popular frameworks
  • #37: • the UI has to talk to some sort of back-end • this is where business logic goes
  • #38: • such a businessy lame term, but it’s on point • middleware does a lot
  • #39: • receive HTTP requests • parse them • call some code • figure out a response • service assets • talk to the database • run tests • etc etc. This is a LOT
  • #40: • Your first problem in middleware land is you don’t want to write plumbing • you don’t want to spend time debating how to route URLs • you can’t afford to discuss database management or param parsing
  • #41: • your business problems are necessarily complex • the way you solve them should not be MORE complex
  • #42: • you want a framework that makes the right decisions for you • you want to work in an expressive high-level language • so all you think about is your problem and how to structure the code
  • #43: • Rails is the gold standard • Convention-based, makes all decisions for you • No Rails team ever debates how to package assets, route URLs, parse the query string, connect to the database, run tests, or manage the schema
  • #44: • Ruby is a wonderful language • Highly expressive; simple code • Abstraction is straightforward • If all you know is JavaScript, C#, or Java, you owe it to yourself to try Rails
  • #45: • Like most middleware, Rails wants to be everything. We’ll get to that • part of being a full stack developer is getting the best out of your tools
  • #46: • data is the heart of every business • you could survive the loss of code, but not of data
  • #47: When you ask it to write, it writes
  • #48: • what you put in comes out exactly • you can ensure consistency and correctness
  • #49: • you want access to be optimized for your use-cases
  • #50: • You want powerful tools to describe what is and isn’t correct and valid data.
  • #51: • SQL might have the longest period of relevance of any technology • The relational model has stood the test of time • It can seem archaic
  • #52: • If you aren’t comfortable with SQL datbases, level up
  • #53: • Postgres excels at these things • it’s free and open-source • it has noSQL-like features that few other SQL databases have
  • #54: • Few RDBMS’ have check constraints like this. This prevents rogue agents, buggy code, or bad judgement from putting bad data into your database
  • #55: • Powerful indexing features. More than just indexing on a field, you can do indexes on transformed data as well as partial indexes
  • #56: • Powerful, indexable data types to model your data without making a ton of extra tables
  • #57: • Powerful, indexable data types to model your data without making a ton of extra tables
  • #58: • You can even use Postgres as a document data store by putting JSON in it. The JSON can be indexed.
  • #59: • You can even use Postgres as a document data store by putting JSON in it. The JSON can be indexed.