Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Phoenix Framework
Search
Pedro Assumpcao
January 30, 2015
Programming
0
160
Phoenix Framework
Overall view of Phoenix Framework.
Pedro Assumpcao
January 30, 2015
Tweet
Share
More Decks by Pedro Assumpcao
See All by Pedro Assumpcao
Custom Data Types in Ecto
pedroassumpcao
0
400
Other Decks in Programming
See All in Programming
Server Driven Compose With Firebase
skydoves
0
430
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
1
320
Sidekiqで実現する 長時間非同期処理の中断と再開 / Pausing and Resuming Long-Running Asynchronous Jobs with Sidekiq
hypermkt
6
2.9k
Content Security Policy入門 セキュリティ設定と 違反レポートのはじめ方 / Introduction to Content Security Policy Getting Started with Security Configuration and Violation Reporting
uskey512
1
470
CPython 인터프리터 구조 파헤치기 - PyCon Korea 24
kennethanceyer
0
250
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
440
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
750
GCCのプラグインを作る / I Made a GCC Plugin
shouth
1
150
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
430
Tauriでネイティブアプリを作りたい
tsucchinoko
0
340
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
120
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
1.9k
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
810
Code Reviewing Like a Champion
maltzj
520
39k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Measuring & Analyzing Core Web Vitals
bluesmoon
2
69
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
92
16k
GraphQLとの向き合い方2022年版
quramy
43
13k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Optimizing for Happiness
mojombo
376
69k
Six Lessons from altMBA
skipperchong
26
3.5k
Transcript
A HIGHLY CONNECTED WEB FRAMEWORK Pedro Assumpcao Raise Conf •
01/30/2015
• DEVELOPED WITH ELIXIR BY CHRIS MCCORD; • TOP LAYER
OF A MULTI-LAYER: • PHOENIX; • PLUG (MIDDLEWARE); • COWBOY (HTTP SERVER). OVERVIEW
• ROBUST ROUTING; • WEBSOCKET AND PUB/SUB LAYER; • PLUG-BASED
ROUTES AND CONTROLLERS; • PRECOMPILED VIEW LAYER. FEATURES
• DISTRIBUTED WEB SERVICES FRAMEWORK; • SIMPLIFY THE USE OF
WEBSOCKETS, REAL TIME EVENTS AND SOA; • NO PRODUCTIVITY SACRIFICES FOR PERFORMANCE; • NO PERFORMANCES SACRIFICES FOR PRODUCTIVITY. GOALS
• CLONE PHOENIX GIT REPO; • FETCH DEPENDENCIES; • COMPILE.
SETTING UP
• AFTER PHOENIX IS SET UP, A MIX TASK IS
AVAILABLE TO CREATE APPS; • FETCH DEPENDENCIES; • COMPILE; • START SERVER. CREATING A NEW APP
• ROUTES; • CONTROLLERS; • VIEWS; • TEMPLATES; • CHANNELS.
LET'S SEE WHAT WE GOT
ROUTES
get “/pages/:slug”, PageController, :show # GET /pages/about # [“pages”, “about”]
def match(conn, “GET”, [“pages”, slug]) do Controller.peform_action(conn, PageController, :show, slug: slug) end get “/files/*path”, FileController, :show # GET /files/Users/pedro/Documents # [“files”, “Users”, “pedro”, “Documents"] def match(conn, “GET”, [“files” | path]) do Controller.peform_action(conn, FileController, :show, path: path) end ROUTES
CONTROLLERS
• VIEWS SERVER AS A PRESENTATION LAYER; • VIEWS RENDER
TEMPLATES; • TEMPLATES ARE PRECOMPILED INTO VIEWS; • EEX AND HAML ENGINE SUPPORT; VIEWS AND TEMPLATES
VIEWS # web/views/page_view.ex defmodule HelloPhoenix.PageView do use HelloPhoenix.View ! def
message do "Hello from the view!" end end
# web/templates/layout/application.html.eex <html> ... <body> <%= @inner %> </body> </html>
! # web/templates/page/show.html.eex <p>This is the message: <%= message %></p> TEMPLATES
• DEFINED IN THE ROUTER; • WEBSOCKET/PUBSUB ABSTRACTION; • PHOENIX.JS
AS BROWSER CLIENT. CHANNELS
Elixir: www.elixir-lang.org Phoenix: www.phoenixframework.org RESOURCES
THANKS!