Permalink
Browse files

first

  • Loading branch information...
EC2 Default User
EC2 Default User committed Aug 4, 2015
1 parent a43c504 commit 07c886159c076230f7dfa0d538d2543938da200e
View
@@ -0,0 +1,8 @@
# RefluxEventbrokerReactPhoenixElixir
To start your new Phoenix application:
1. Install dependencies with `mix deps.get`
2. Start Phoenix endpoint with `mix phoenix.server`
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
View
@@ -0,0 +1,9 @@
{
"name": "chat",
"dependencies": {
"classnames": "~2.1.1",
"reflux": "~0.2.7",
"bootstrap": "~3.3.4",
"react": "~0.13.3"
}
}
View
@@ -0,0 +1,56 @@
exports.config = {
// See http://brunch.io/#documentation for docs.
files: {
javascripts: {
joinTo: 'js/app.js'
// To use a separate vendor.js bundle, specify two files path
// https://github.com/brunch/brunch/blob/stable/docs/config.md#files
// joinTo: {
// 'js/app.js': /^(web\/static\/js)/,
// 'js/vendor.js': /^(web\/static\/vendor)/
// }
//
// To change the order of concatenation of files, explictly mention here
// https://github.com/brunch/brunch/tree/master/docs#concatenation
// order: {
// before: [
// 'web/static/vendor/js/jquery-2.1.1.js',
// 'web/static/vendor/js/bootstrap.min.js'
// ]
// }
},
stylesheets: {
joinTo: 'css/app.css'
},
templates: {
joinTo: 'js/app.js'
}
},
conventions: {
// This option sets where we should place non-css and non-js assets in.
// By default, we set this to '/web/static/assets'. Files in this directory
// will be copied to `paths.public`, which is "priv/static" by default.
assets: /^(web\/static\/assets)/
},
// Phoenix paths configuration
paths: {
// Which directories to watch
watched: ["web/static", "test/static"],
// Where to compile files to
public: "priv/static"
},
// Configure your plugins
plugins: {
babel: {
// Do not use ES6 compiler in vendor code
ignore: [/^(web\/static\/vendor)/]
}
},
npm: {
enabled: true
}
};
View
@@ -0,0 +1,24 @@
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
#
# This configuration file is loaded before any dependency and
# is restricted to this project.
use Mix.Config
# Configures the endpoint
config :reflux_eventbroker_react_phoenix_elixir, RefluxEventbrokerReactPhoenixElixir.Endpoint,
url: [host: "localhost"],
root: Path.dirname(__DIR__),
secret_key_base: "Kz5VrEQuQnzZ6CYeMWHDrh5DUGzkuRxQNL2dzOAZ7zr7ahrH+s2MkwBb1Qq+Gy1/",
render_errors: [default_format: "html"],
pubsub: [name: RefluxEventbrokerReactPhoenixElixir.PubSub,
adapter: Phoenix.PubSub.PG2]
# Configures Elixir's Logger
config :logger, :console,
format: "$time $metadata[$level] $message\n",
metadata: [:request_id]
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env}.exs"
View
@@ -0,0 +1,27 @@
use Mix.Config
# For development, we disable any cache and enable
# debugging and code reloading.
#
# The watchers configuration can be used to run external
# watchers to your application. For example, we use it
# with brunch.io to recompile .js and .css sources.
config :reflux_eventbroker_react_phoenix_elixir, RefluxEventbrokerReactPhoenixElixir.Endpoint,
http: [port: 4000],
debug_errors: true,
code_reloader: true,
cache_static_lookup: false,
watchers: [node: ["node_modules/brunch/bin/brunch", "watch"]]
# Watch static and templates for browser reloading.
config :reflux_eventbroker_react_phoenix_elixir, RefluxEventbrokerReactPhoenixElixir.Endpoint,
live_reload: [
patterns: [
~r{priv/static/.*(js|css|png|jpeg|jpg|gif)$},
~r{web/views/.*(ex)$},
~r{web/templates/.*(eex)$}
]
]
# Do not include metadata nor timestamps in development logs
config :logger, :console, format: "[$level] $message\n"
View
@@ -0,0 +1,52 @@
use Mix.Config
# For production, we configure the host to read the PORT
# from the system environment. Therefore, you will need
# to set PORT=80 before running your server.
#
# You should also configure the url host to something
# meaningful, we use this information when generating URLs.
#
# Finally, we also include the path to a manifest
# containing the digested version of static files. This
# manifest is generated by the mix phoenix.digest task
# which you typically run after static files are built.
config :reflux_eventbroker_react_phoenix_elixir, RefluxEventbrokerReactPhoenixElixir.Endpoint,
http: [port: {:system, "PORT"}],
url: [host: "example.com", port: 80],
cache_static_manifest: "priv/static/manifest.json"
# ## SSL Support
#
# To get SSL working, you will need to add the `https` key
# to the previous section, and set your `:url` port to 443
#
# config :reflux_eventbroker_react_phoenix_elixir, RefluxEventbrokerReactPhoenixElixir.Endpoint,
# ...
# url: [host: "example.com", port: 443],
# https: [port: 443,
# keyfile: System.get_env("SOME_APP_SSL_KEY_PATH"),
# certfile: System.get_env("SOME_APP_SSL_CERT_PATH")]
#
# Where those two env variables point to a file on
# disk for the key and cert.
# Do not print debug messages in production
config :logger, level: :info
# ## Using releases
#
# If you are doing OTP releases, you need to instruct Phoenix
# to start the server for all endpoints:
#
# config :phoenix, :serve_endpoints, true
#
# Alternatively, you can configure exactly which server to
# start per endpoint:
#
# config :reflux_eventbroker_react_phoenix_elixir, RefluxEventbrokerReactPhoenixElixir.Endpoint, server: true
#
# Finally import the config/prod.secret.exs
# which should be versioned separately.
import_config "prod.secret.exs"
View
@@ -0,0 +1,10 @@
use Mix.Config
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :reflux_eventbroker_react_phoenix_elixir, RefluxEventbrokerReactPhoenixElixir.Endpoint,
http: [port: 4001],
server: false
# Print only warnings and errors during test
config :logger, level: :warn
@@ -0,0 +1,28 @@
defmodule RefluxEventbrokerReactPhoenixElixir do
use Application
# See http://elixir-lang.org/docs/stable/elixir/Application.html
# for more information on OTP Applications
def start(_type, _args) do
import Supervisor.Spec, warn: false
children = [
# Start the endpoint when the application starts
supervisor(RefluxEventbrokerReactPhoenixElixir.Endpoint, []),
# Here you could define other workers and supervisors as children
# worker(RefluxEventbrokerReactPhoenixElixir.Worker, [arg1, arg2, arg3]),
]
# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: RefluxEventbrokerReactPhoenixElixir.Supervisor]
Supervisor.start_link(children, opts)
end
# Tell Phoenix to update the endpoint configuration
# whenever the application is updated.
def config_change(changed, _new, removed) do
RefluxEventbrokerReactPhoenixElixir.Endpoint.config_change(changed, removed)
:ok
end
end
@@ -0,0 +1,39 @@
defmodule RefluxEventbrokerReactPhoenixElixir.Endpoint do
use Phoenix.Endpoint, otp_app: :reflux_eventbroker_react_phoenix_elixir
socket "/socket", RefluxEventbrokerReactPhoenixElixir.UserSocket
# Serve at "/" the static files from "priv/static" directory.
#
# You should set gzip to true if you are running phoenix.digest
# when deploying your static files in production.
plug Plug.Static,
at: "/", from: :reflux_eventbroker_react_phoenix_elixir, gzip: false,
only: ~w(css fonts images js favicon.ico robots.txt)
# Code reloading can be explicitly enabled under the
# :code_reloader configuration of your endpoint.
if code_reloading? do
socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
plug Phoenix.LiveReloader
plug Phoenix.CodeReloader
end
plug Plug.RequestId
plug Plug.Logger
plug Plug.Parsers,
parsers: [:urlencoded, :multipart, :json],
pass: ["*/*"],
json_decoder: Poison
plug Plug.MethodOverride
plug Plug.Head
plug Plug.Session,
store: :cookie,
key: "_reflux_eventbroker_react_phoenix_elixir_key",
signing_salt: "4nIL/5CA"
plug RefluxEventbrokerReactPhoenixElixir.Router
end
View
36 mix.exs
@@ -0,0 +1,36 @@
defmodule RefluxEventbrokerReactPhoenixElixir.Mixfile do
use Mix.Project
def project do
[app: :reflux_eventbroker_react_phoenix_elixir,
version: "0.0.1",
elixir: "~> 1.0",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix] ++ Mix.compilers,
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps]
end
# Configuration for the OTP application
#
# Type `mix help compile.app` for more information
def application do
[mod: {RefluxEventbrokerReactPhoenixElixir, []},
applications: [:phoenix, :phoenix_html, :cowboy, :logger]]
end
# Specifies which paths to compile per environment
defp elixirc_paths(:test), do: ["lib", "web", "test/support"]
defp elixirc_paths(_), do: ["lib", "web"]
# Specifies your project dependencies
#
# Type `mix help deps` for examples and options
defp deps do
[{:phoenix, "~> 0.15"},
{:phoenix_html, "~> 1.4"},
{:phoenix_live_reload, "~> 0.5", only: :dev},
{:cowboy, "~> 1.0"}]
end
end
View
@@ -0,0 +1,9 @@
%{"cowboy": {:hex, :cowboy, "1.0.2"},
"cowlib": {:hex, :cowlib, "1.0.1"},
"fs": {:hex, :fs, "0.9.2"},
"phoenix": {:hex, :phoenix, "0.15.0"},
"phoenix_html": {:hex, :phoenix_html, "1.4.0"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "0.5.1"},
"plug": {:hex, :plug, "0.14.0"},
"poison": {:hex, :poison, "1.4.0"},
"ranch": {:hex, :ranch, "1.1.0"}}
@@ -0,0 +1,8 @@
defmodule RefluxEventbrokerReactPhoenixElixir.PageControllerTest do
use RefluxEventbrokerReactPhoenixElixir.ConnCase
test "GET /" do
conn = get conn(), "/"
assert html_response(conn, 200) =~ "Welcome to Phoenix!"
end
end
@@ -0,0 +1,33 @@
defmodule RefluxEventbrokerReactPhoenixElixir.ChannelCase do
@moduledoc """
This module defines the test case to be used by
channel tests.
Such tests rely on `Phoenix.ChannelTest` and also
imports other functionality to make it easier
to build and query models.
Finally, if the test case interacts with the database,
it cannot be async. For this reason, every test runs
inside a transaction which is reset at the beginning
of the test unless the test case is marked as async.
"""
use ExUnit.CaseTemplate
using do
quote do
# Import conveniences for testing with channels
use Phoenix.ChannelTest
# The default endpoint for testing
@endpoint RefluxEventbrokerReactPhoenixElixir.Endpoint
end
end
setup tags do
:ok
end
end
View
@@ -0,0 +1,34 @@
defmodule RefluxEventbrokerReactPhoenixElixir.ConnCase do
@moduledoc """
This module defines the test case to be used by
tests that require setting up a connection.
Such tests rely on `Phoenix.ConnTest` and also
imports other functionality to make it easier
to build and query models.
Finally, if the test case interacts with the database,
it cannot be async. For this reason, every test runs
inside a transaction which is reset at the beginning
of the test unless the test case is marked as async.
"""
use ExUnit.CaseTemplate
using do
quote do
# Import conveniences for testing with connections
use Phoenix.ConnTest
import RefluxEventbrokerReactPhoenixElixir.Router.Helpers
# The default endpoint for testing
@endpoint RefluxEventbrokerReactPhoenixElixir.Endpoint
end
end
setup tags do
:ok
end
end
View
@@ -0,0 +1,2 @@
ExUnit.start
Oops, something went wrong.

0 comments on commit 07c8861

Please sign in to comment.