Phoenix:Guide:Overview

Phoenix

web framework

Features

mvc pattern

high developer productivity

high application performance

channel - real time feature

precompiled templates

Learn

elixir guide

elixir learning resource

phoenix learning resource

my collections

Phoenix Components

internal parts (each with its own purpose and role)

  • endpoint: request lifecycle, dispatches request to router

  • router: parses request and dispatches it to controller action

    • pipeline: groups of plugs to a set of routes
  • controller: define action to handle request

    • action: prepare data and render or redirect
  • view: render templates, act as a presenter, define helpers

  • template: structure with dynamic data, precompiled and fast

  • channel: manage sockets for easy realtime communication

  • pub-sub: underlies the channel layer, allow client to subscribes to topics

    • pub-sub adapter: abstract for third-party pub-sub integration

Phoenix Layers

multi-layer system designed to be modular and flexible

  • cowboy: web server. guide

  • plug: a specification for constructing reusable modules or functions. guide, doc

    • plugs can be defined and executed in a set order, line pipeline.

    • example: authentication, params pre-processing, rendering, etc.

  • ecto: orm, dsl, database wrapper

    • repo: a connection to an individual database

    • schema: data definition and associations

    • query: retrieve data from repo and cast it into schema

    • changeset: declare transformations action on data

      • includes: type casting, validations, and more

      • postgresql: default database

來(lái)源:Phoenix doc

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,858評(píng)論 0 10
  • 小時(shí)候總以為長(zhǎng)大了就好了,現(xiàn)在是長(zhǎng)大了,可是并沒(méi)有多好。今年剛好24,現(xiàn)在在家里一直被催著找對(duì)象,難道說(shuō)不找不行嗎?
    梅干菜and年糕閱讀 317評(píng)論 0 1
  • 12.16書籍名稱《拆掉思維的墻》 【day5橘子哥】 今天想講書中的一個(gè)概念,你還活在父母的劇本里嗎? 我們父母...
    馬克圖布了閱讀 218評(píng)論 0 1

友情鏈接更多精彩內(nèi)容