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
460
Other Decks in Programming
See All in Programming
Grafana:建立系統全知視角的捷徑
blueswen
0
330
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
600
Architectural Extensions
denyspoltorak
0
280
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
180
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
CSC307 Lecture 07
javiergs
PRO
0
550
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
450
CSC307 Lecture 04
javiergs
PRO
0
660
Patterns of Patterns
denyspoltorak
0
1.4k
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
Featured
See All Featured
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
130
Test your architecture with Archunit
thirion
1
2.1k
Optimizing for Happiness
mojombo
379
71k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
300
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Building an army of robots
kneath
306
46k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
320
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
320
Claude Code のすすめ
schroneko
67
210k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
170
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
280
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!