{"action":"created","comment":{"url":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/comments/31709162","id":31709162,"diff_hunk":"@@ -0,0 +1,101 @@\n+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.\n+\n+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).\n+\n+The aim of this introductory guide is to present a brief, high level overview of Phoenix, the parts that make it up, and the layers underneath that support it.\n+\n+### Phoenix\n+\n+Phoenix is actually the top layer of a multi-layer system designed to be modular and flexible. The other layers are the Elixir middleware project, Plug, and the Erlang web server, Cowboy. Plug and Cowboy are covered in the next sections of this guide.\n+\n+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.\n+\n+- The Endpoint\n+- handles all aspects of requests up until the beginning of our applications\n+- provides a core set of middleware to apply to all requests\n+- dispatches requests into designated routers\n+- The Router\n+- parses incoming requests and dispatches to the correct controller/action, passing parameters as needed\n+- provides helpers to generate route paths or urls to resources\n+- Pipelines\n+- Allow easy segregation of middleware across different routes\n+- Controllers\n+- provide functions, called *actions*, to handle requests\n+- Actions\n+- prepare data and pass it into views\n+- invoke rendering via views\n+- perform redirects\n+- Views\n+- render templates\n+- act as a presentation layer\n+- define helper functions, available in templates, to decorate raw data\n+- Templates\n+- are what they sound like :)\n+- Precompiled & fast\n+- Channels\n+- manage sockets for easy realtime communication\n+- analogous to controllers except that they allow bi-directional communication with persistent connections\n+- PubSub\n+- Underlies the channel layer and allows *topics* to be subscribed to\n+- Abstracts the underlying pubsub adapter for third-party pubsub integration\n+\n+### Plug\n+\n+[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.\n+\n+Plugs can be written to handle almost anything, from authentication to parameter pre-processing, and even rendering.\n+\n+Phoenix takes great advantage of Plug in general - the router and controllers especially so.\n+\n+One of the most important things about Plug, is that it provides adapters to HTTP servers which will ultimately deliver application content to your users. Currently, Plug only provides an adapter to Cowboy, which we will talk about next, but there are plans to provide adapters for other servers in the future.\n+\n+Links to more in-depth information on Plug can be found in the [Resources Guide](http://www.phoenixframework.org/docs/resources).","path":"introduction/A_overview.md","position":52,"original_position":52,"commit_id":"02c39966ee83afba270e51f95b9e44d29ba2f7b9","original_commit_id":"02c39966ee83afba270e51f95b9e44d29ba2f7b9","user":{"login":"pel-daniel","id":980388,"avatar_url":"https://avatars.githubusercontent.com/u/980388?v=3","gravatar_id":"","url":"https://api.github.com/users/pel-daniel","html_url":"https://github.com/pel-daniel","followers_url":"https://api.github.com/users/pel-daniel/followers","following_url":"https://api.github.com/users/pel-daniel/following{/other_user}","gists_url":"https://api.github.com/users/pel-daniel/gists{/gist_id}","starred_url":"https://api.github.com/users/pel-daniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pel-daniel/subscriptions","organizations_url":"https://api.github.com/users/pel-daniel/orgs","repos_url":"https://api.github.com/users/pel-daniel/repos","events_url":"https://api.github.com/users/pel-daniel/events{/privacy}","received_events_url":"https://api.github.com/users/pel-daniel/received_events","type":"User","site_admin":false},"body":"What do you think about linking to the specific section of the page ? (i.e. http://www.phoenixframework.org/docs/resources#section-plug). The same for the link of cowboy below.","created_at":"2015-06-04T10:30:27Z","updated_at":"2015-06-04T10:30:27Z","html_url":"https://github.com/phoenixframework/phoenix_guides/pull/282#discussion_r31709162","pull_request_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/282","_links":{"self":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/comments/31709162"},"html":{"href":"https://github.com/phoenixframework/phoenix_guides/pull/282#discussion_r31709162"},"pull_request":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/282"}}},"pull_request":{"url":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/282","id":36903350,"html_url":"https://github.com/phoenixframework/phoenix_guides/pull/282","diff_url":"https://github.com/phoenixframework/phoenix_guides/pull/282.diff","patch_url":"https://github.com/phoenixframework/phoenix_guides/pull/282.patch","issue_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/issues/282","number":282,"state":"open","locked":false,"title":"First version of the Introduction Directory","user":{"login":"lancehalvorsen","id":359224,"avatar_url":"https://avatars.githubusercontent.com/u/359224?v=3","gravatar_id":"","url":"https://api.github.com/users/lancehalvorsen","html_url":"https://github.com/lancehalvorsen","followers_url":"https://api.github.com/users/lancehalvorsen/followers","following_url":"https://api.github.com/users/lancehalvorsen/following{/other_user}","gists_url":"https://api.github.com/users/lancehalvorsen/gists{/gist_id}","starred_url":"https://api.github.com/users/lancehalvorsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lancehalvorsen/subscriptions","organizations_url":"https://api.github.com/users/lancehalvorsen/orgs","repos_url":"https://api.github.com/users/lancehalvorsen/repos","events_url":"https://api.github.com/users/lancehalvorsen/events{/privacy}","received_events_url":"https://api.github.com/users/lancehalvorsen/received_events","type":"User","site_admin":false},"body":"- This has a copy of the Overview Guide in it. I'm curious how it feels to have it here, and can delete it if it seems strange.\r\n\r\n- The Installation Guide is yet to come, but I wanted to get this much out there to see if there is any feedback.","created_at":"2015-06-04T05:28:24Z","updated_at":"2015-06-04T10:30:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c20792280932cd09dfbdc7741c4b93da56e5f8c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/282/commits","review_comments_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/282/comments","review_comment_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/comments{/number}","comments_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/issues/282/comments","statuses_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/statuses/02c39966ee83afba270e51f95b9e44d29ba2f7b9","head":{"label":"phoenixframework:new-intro-directory","ref":"new-intro-directory","sha":"02c39966ee83afba270e51f95b9e44d29ba2f7b9","user":{"login":"phoenixframework","id":6510388,"avatar_url":"https://avatars.githubusercontent.com/u/6510388?v=3","gravatar_id":"","url":"https://api.github.com/users/phoenixframework","html_url":"https://github.com/phoenixframework","followers_url":"https://api.github.com/users/phoenixframework/followers","following_url":"https://api.github.com/users/phoenixframework/following{/other_user}","gists_url":"https://api.github.com/users/phoenixframework/gists{/gist_id}","starred_url":"https://api.github.com/users/phoenixframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phoenixframework/subscriptions","organizations_url":"https://api.github.com/users/phoenixframework/orgs","repos_url":"https://api.github.com/users/phoenixframework/repos","events_url":"https://api.github.com/users/phoenixframework/events{/privacy}","received_events_url":"https://api.github.com/users/phoenixframework/received_events","type":"Organization","site_admin":false},"repo":{"id":22436876,"name":"phoenix_guides","full_name":"phoenixframework/phoenix_guides","owner":{"login":"phoenixframework","id":6510388,"avatar_url":"https://avatars.githubusercontent.com/u/6510388?v=3","gravatar_id":"","url":"https://api.github.com/users/phoenixframework","html_url":"https://github.com/phoenixframework","followers_url":"https://api.github.com/users/phoenixframework/followers","following_url":"https://api.github.com/users/phoenixframework/following{/other_user}","gists_url":"https://api.github.com/users/phoenixframework/gists{/gist_id}","starred_url":"https://api.github.com/users/phoenixframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phoenixframework/subscriptions","organizations_url":"https://api.github.com/users/phoenixframework/orgs","repos_url":"https://api.github.com/users/phoenixframework/repos","events_url":"https://api.github.com/users/phoenixframework/events{/privacy}","received_events_url":"https://api.github.com/users/phoenixframework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/phoenixframework/phoenix_guides","description":"User guides for the Phoenix web development framework.","fork":false,"url":"https://api.github.com/repos/phoenixframework/phoenix_guides","forks_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/forks","keys_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/teams","hooks_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/hooks","issue_events_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/issues/events{/number}","events_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/events","assignees_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/assignees{/user}","branches_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/branches{/branch}","tags_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/tags","blobs_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/git/refs{/sha}","trees_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/statuses/{sha}","languages_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/languages","stargazers_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/stargazers","contributors_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/contributors","subscribers_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/subscribers","subscription_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/subscription","commits_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/commits{/sha}","git_commits_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/git/commits{/sha}","comments_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/comments{/number}","issue_comment_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/issues/comments{/number}","contents_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/contents/{+path}","compare_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/merges","archive_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/downloads","issues_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/issues{/number}","pulls_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls{/number}","milestones_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/milestones{/number}","notifications_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/labels{/name}","releases_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/releases{/id}","created_at":"2014-07-30T17:00:36Z","updated_at":"2015-06-02T21:40:35Z","pushed_at":"2015-06-04T05:43:50Z","git_url":"git://github.com/phoenixframework/phoenix_guides.git","ssh_url":"git@github.com:phoenixframework/phoenix_guides.git","clone_url":"https://github.com/phoenixframework/phoenix_guides.git","svn_url":"https://github.com/phoenixframework/phoenix_guides","homepage":null,"size":4466,"stargazers_count":180,"watchers_count":180,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":56,"mirror_url":null,"open_issues_count":20,"forks":56,"open_issues":20,"watchers":180,"default_branch":"master"}},"base":{"label":"phoenixframework:master","ref":"master","sha":"982eb9a1e3811e29dc5dd289dceac643a37c54f5","user":{"login":"phoenixframework","id":6510388,"avatar_url":"https://avatars.githubusercontent.com/u/6510388?v=3","gravatar_id":"","url":"https://api.github.com/users/phoenixframework","html_url":"https://github.com/phoenixframework","followers_url":"https://api.github.com/users/phoenixframework/followers","following_url":"https://api.github.com/users/phoenixframework/following{/other_user}","gists_url":"https://api.github.com/users/phoenixframework/gists{/gist_id}","starred_url":"https://api.github.com/users/phoenixframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phoenixframework/subscriptions","organizations_url":"https://api.github.com/users/phoenixframework/orgs","repos_url":"https://api.github.com/users/phoenixframework/repos","events_url":"https://api.github.com/users/phoenixframework/events{/privacy}","received_events_url":"https://api.github.com/users/phoenixframework/received_events","type":"Organization","site_admin":false},"repo":{"id":22436876,"name":"phoenix_guides","full_name":"phoenixframework/phoenix_guides","owner":{"login":"phoenixframework","id":6510388,"avatar_url":"https://avatars.githubusercontent.com/u/6510388?v=3","gravatar_id":"","url":"https://api.github.com/users/phoenixframework","html_url":"https://github.com/phoenixframework","followers_url":"https://api.github.com/users/phoenixframework/followers","following_url":"https://api.github.com/users/phoenixframework/following{/other_user}","gists_url":"https://api.github.com/users/phoenixframework/gists{/gist_id}","starred_url":"https://api.github.com/users/phoenixframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phoenixframework/subscriptions","organizations_url":"https://api.github.com/users/phoenixframework/orgs","repos_url":"https://api.github.com/users/phoenixframework/repos","events_url":"https://api.github.com/users/phoenixframework/events{/privacy}","received_events_url":"https://api.github.com/users/phoenixframework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/phoenixframework/phoenix_guides","description":"User guides for the Phoenix web development framework.","fork":false,"url":"https://api.github.com/repos/phoenixframework/phoenix_guides","forks_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/forks","keys_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/teams","hooks_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/hooks","issue_events_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/issues/events{/number}","events_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/events","assignees_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/assignees{/user}","branches_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/branches{/branch}","tags_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/tags","blobs_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/git/refs{/sha}","trees_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/statuses/{sha}","languages_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/languages","stargazers_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/stargazers","contributors_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/contributors","subscribers_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/subscribers","subscription_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/subscription","commits_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/commits{/sha}","git_commits_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/git/commits{/sha}","comments_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/comments{/number}","issue_comment_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/issues/comments{/number}","contents_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/contents/{+path}","compare_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/merges","archive_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/downloads","issues_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/issues{/number}","pulls_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls{/number}","milestones_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/milestones{/number}","notifications_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/labels{/name}","releases_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/releases{/id}","created_at":"2014-07-30T17:00:36Z","updated_at":"2015-06-02T21:40:35Z","pushed_at":"2015-06-04T05:43:50Z","git_url":"git://github.com/phoenixframework/phoenix_guides.git","ssh_url":"git@github.com:phoenixframework/phoenix_guides.git","clone_url":"https://github.com/phoenixframework/phoenix_guides.git","svn_url":"https://github.com/phoenixframework/phoenix_guides","homepage":null,"size":4466,"stargazers_count":180,"watchers_count":180,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":56,"mirror_url":null,"open_issues_count":20,"forks":56,"open_issues":20,"watchers":180,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/282"},"html":{"href":"https://github.com/phoenixframework/phoenix_guides/pull/282"},"issue":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/issues/282"},"comments":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/issues/282/comments"},"review_comments":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/282/comments"},"review_comment":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/282/commits"},"statuses":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/statuses/02c39966ee83afba270e51f95b9e44d29ba2f7b9"}}}}