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
440
Other Decks in Programming
See All in Programming
複雑なドメインに挑む.pdf
yukisakai1225
5
1.2k
プロポーザル駆動学習 / Proposal-Driven Learning
mackey0225
2
1.3k
アプリの "かわいい" を支えるアニメーションツールRiveについて
uetyo
0
280
Kiroで始めるAI-DLC
kaonash
2
630
Deep Dive into Kotlin Flow
jmatsu
1
370
Design Foundational Data Engineering Observability
sucitw
3
210
ファインディ株式会社におけるMCP活用とサービス開発
starfish719
0
2.1k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
420
AIと私たちの学習の変化を考える - Claude Codeの学習モードを例に
azukiazusa1
11
4.4k
Android 16 × Jetpack Composeで縦書きテキストエディタを作ろう / Vertical Text Editor with Compose on Android 16
cc4966
2
270
RDoc meets YARD
okuramasafumi
4
170
Improving my own Ruby thereafter
sisshiki1969
1
160
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
36
6.9k
Raft: Consensus for Rubyists
vanstee
140
7.1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
3k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
Navigating Team Friction
lara
189
15k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
113
20k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Unsuck your backbone
ammeep
671
58k
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!