Skip to content

Commit

Permalink
Update 0_overview.md
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismccord committed Apr 5, 2015
1 parent a2d3e6f commit 6b29df9
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions 0_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Phoenix is a web development framework written in Elixir which implements the server-side MVC pattern. If you've ever used a similar framework, say Ruby on Rails or Python's Django, many of the concepts will be familiar to you. Phoenix is not, however, simply a Rails clone. It aims to have the best of both worlds, high developer productivity _and_ high application performance. Phoenix also has some interesting new twists, channels for managing Websockets, pre-compiled templates and the potential for alternative architectures which may make services more manageable from the very beginning of your project.
Phoenix is a web development framework written in Elixir which implements the server-side MVC pattern. If you've ever used a similar framework, say Ruby on Rails or Python's Django, many of the concepts will be familiar to you. Phoenix gives you the best of both worlds, high developer productivity _and_ high application performance. It also has some interesting new twists, channels for managing realtime events, pre-compiled templates and the potential for alternative architectures which may make services more manageable from the very beginning of your project.

If you are already familiar with Elixir, great! If not, there are a number of places you can go to learn. You might want to read through the [Elixir guides](http://elixir-lang.org/getting_started/1.html) first. You might also want to look through any of the books, blogs or videos listed in the [Resources Guide](http://www.phoenixframework.org/docs/resources).

Expand All @@ -10,33 +10,38 @@ Phoenix is actually the top layer of a multi-layer system designed to be modular

Phoenix is made up of a number of distinct parts, each with its own purpose and role to play in building a web application. We will cover them all in depth throughout these guides, but here's a quick breakdown.

- The Endpoint
- handles all aspects of requests up until the beginning of our applications
- provides a core set of middleware to apply to all requests
- dispatches requests into designated routers
- The Router
- parses incoming requests and dispatches to the correct controller/action, passing parameters as needed
- provides helpers to generate route paths or urls to resources
- The Endpoint
- handles all aspects of requests up until the beginning of our applications
- Pipelines
- Allow easy segregation of middleware across different routes
- Controllers
- provide functions called actions to handle requests
- provide functions, called *actions*, to handle requests
- Actions
- prepare data and pass it into views
- invoke rendering via views
- perform redirects
- Views
- render templates
- act as a presentation layer
- define helper functions, available in templates, to decorate raw data
- Templates
- are what they sound like :)
- Precompiled & fast
- Channels
- manage sockets
- are roughly analogous to controllers except that they are bi-directional and persistent
- Sockets
- are multiplexed, persistent connections
- Topics
- serve as a PubSub broadcast layer
- manage sockets for easy realtime communication
- analogous to controllers except that they allow bi-directional communication with persistant connections
- PubSub
- Underlies the channel layer and allows *topics* to be subscribed to
- Abstracts the underlying pubsub adapter for third-party pubsub integration

### Plug

[Plug](http://hexdocs.pm/plug/) is Elixir's middleware layer. Conceptually, it shares a lot with other middleware layers like Rack for Ruby or WSGI for Python. Plugs are reusable modules that share the same very small, very regular public api. They provide discrete behaviors - like request header parsing or logging. Because the Plug api is so consistent, they can be stacked and executed in a set order, like a pipeline. They can also be re-used within a project or across projects.
[Plug](http://hexdocs.pm/plug/) is Elixir's web middleware layer. Conceptually, it shares a lot with other middleware layers like Rack for Ruby or WSGI for Python. Plugs are reusable modules that share the same very small, very regular public api. They provide discrete behaviors - like request header parsing or logging. Because the Plug api is so consistent, they can be stacked and executed in a set order, like a pipeline. They can also be re-used within a project or across projects.

Plugs can be written to handle almost anything, from authentication to parameter pre-processing, and even rendering.

Expand Down

0 comments on commit 6b29df9

Please sign in to comment.