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

来源:Phoenix doc

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,424评论 0 10
  • 小时候总以为长大了就好了,现在是长大了,可是并没有多好。今年刚好24,现在在家里一直被催着找对象,难道说不找不行吗?
    梅干菜and年糕阅读 307评论 0 1
  • 12.16书籍名称《拆掉思维的墙》 【day5橘子哥】 今天想讲书中的一个概念,你还活在父母的剧本里吗? 我们父母...
    马克图布了阅读 172评论 0 1