Rails, Postgres, Angular, and Bootstrap are all powerful technologies in and of themselves. When used together, however, you get a powerful web application development stack that reduces friction between what you want for your users and what you can deliver.
15. 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
25. 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() {
// ...
});
28. 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
55. 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’;
56. 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}’;
58. CREATE INDEX txn_responses
ON transactions
USING GIN(braintree_response);
SELECT * FROM
transactions
WHERE
roles @>
‘{“processor_response”: “decline”}’::jsonb;
65. Rails
• Database Migrations “DSL”
• You are not making a database-agnostic app
• Use execute
• Use SQL-based schema
config.active_record.schema_format = :sql
66. Rails
• ActiveRecord
• Examine queries in the log—look for
optimizations
• Let SQL shine
• Don’t fear .where() or
ActiveRecord::Base.connection.exec_query()
• thanks for coming
• this is a powerful stack
• can solve many common problems
• stop along the way
• outline common problems when working in that part
• see how these technologies solve those problems
• important to understand why this is important
• we are at a full stack conference
• 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
• this is what your users think of as “the app”
• how should it look?
• how should it work?
• We aren’t creating products differentiated on HCI
• We aren’t creating a product that innovates on HCI
• solving people’s problems
• helping someone be more successful at their job
• can’t build the former without a lot of the latter
• a little goes a long way
• with a few hours reading, you will be leveled up
• Grid based design foundation of print and web design
• Everything on a page should be aligned to a grid
• when it’s aligned, your design is cohesive, polished, and professional
• 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
• 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
• the page comes together
• you can direct the user with just font size
• when forms and complex components are needed, use padding/margins that work with the grid and type scale
• There are many many CSS frameworks
• Bootstrap is full-featured, easy to use, easy to understand, and hard to mess up
• It has a grid and modular type scale
•
• Your forms won’t look terrible
• Many other components that you need for common tasks
• web apps aren’t static
• simplest ones need dialogs, showing/hiding things, async loading
• This means JavaScript
• JS and JQ are very low level
• Your code should be at the component and behavior level of abstraction
• You want your logic tested without clicking around in a browser
• You don’t want your view littered with data elements and js classes
• 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
• 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
• it’s clear what the intent is here, and how this will behave
• 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.
• uses promises so you have no callback hell
• you have a clear way to extract and abstract code
• there’s nothing really fancy or magical about it
• you have a clear way to extract and abstract code
• there’s nothing really fancy or magical about it
• don’t undervalue this
• lots of resources, help, documentation
• you won’t find systemic issues in popular frameworks
• the UI has to talk to some sort of back-end
• this is where business logic goes
• such a businessy lame term, but it’s on point
• middleware does a lot
• 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
• 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
• your business problems are necessarily complex
• the way you solve them should not be MORE complex
• 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
• 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
• 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
• 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
• data is the heart of every business
• you could survive the loss of code, but not of data
When you ask it to write, it writes
• what you put in comes out exactly
• you can ensure consistency and correctness
• you want access to be optimized for your use-cases
• You want powerful tools to describe what is and isn’t correct and valid data.
• SQL might have the longest period of relevance of any technology
• The relational model has stood the test of time
• It can seem archaic
• If you aren’t comfortable with SQL datbases, level up
• Postgres excels at these things
• it’s free and open-source
• it has noSQL-like features that few other SQL databases have
• Few RDBMS’ have check constraints like this. This prevents rogue agents, buggy code, or bad judgement from putting bad data into your database
• Powerful indexing features. More than just indexing on a field, you can do indexes on transformed data as well as partial indexes
• Powerful, indexable data types to model your data without making a ton of extra tables
• Powerful, indexable data types to model your data without making a ton of extra tables
• You can even use Postgres as a document data store by putting JSON in it. The JSON can be indexed.
• You can even use Postgres as a document data store by putting JSON in it. The JSON can be indexed.