Skip to content

Commit 94a2611

Browse files
committed
Added initial project files
0 parents  commit 94a2611

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3577
-0
lines changed

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# App artifacts
2+
/_build
3+
/db
4+
/deps
5+
/*.ez
6+
7+
# Generated on crash by the VM
8+
erl_crash.dump
9+
10+
# Files matching config/*.secret.exs pattern contain sensitive
11+
# data and you should not commit them into version control.
12+
#
13+
# Alternatively, you may comment the line below and commit the
14+
# secrets files as long as you replace their contents by environment
15+
# variables.
16+
/config/*.secret.exs

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# UserEncryption
2+
3+
To start your Phoenix server:
4+
5+
* Install dependencies with `mix deps.get`
6+
* Create and migrate your database with `mix ecto.create && mix ecto.migrate`
7+
* Start Phoenix endpoint with `mix phx.server`
8+
9+
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
10+
11+
Ready to run in production? Please [check our deployment guides](http://www.phoenixframework.org/docs/deployment).
12+
13+
## Learn more
14+
15+
* Official website: http://www.phoenixframework.org/
16+
* Guides: http://phoenixframework.org/docs/overview
17+
* Docs: https://hexdocs.pm/phoenix
18+
* Mailing list: http://groups.google.com/group/phoenix-talk
19+
* Source: https://github.com/phoenixframework/phoenix

config/config.exs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This file is responsible for configuring your application
2+
# and its dependencies with the aid of the Mix.Config module.
3+
#
4+
# This configuration file is loaded before any dependency and
5+
# is restricted to this project.
6+
use Mix.Config
7+
8+
# General application configuration
9+
config :user_encryption,
10+
ecto_repos: [UserEncryption.Repo]
11+
12+
# Configures the endpoint
13+
config :user_encryption, UserEncryptionWeb.Endpoint,
14+
url: [host: "localhost"],
15+
secret_key_base: "NxGtVqAKnUkzz5PmpB52q33sDv3HZSEifnJg96eBEj13TP0oNKu/vxKgoNiGgyeV",
16+
render_errors: [view: UserEncryptionWeb.ErrorView, accepts: ~w(html json)],
17+
pubsub: [name: UserEncryption.PubSub,
18+
adapter: Phoenix.PubSub.PG2]
19+
20+
# Configures Elixir's Logger
21+
config :logger, :console,
22+
format: "$time $metadata[$level] $message\n",
23+
metadata: [:request_id]
24+
25+
# Import environment specific config. This must remain at the bottom
26+
# of this file so it overrides the configuration defined above.
27+
import_config "#{Mix.env}.exs"

config/dev.exs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
use Mix.Config
2+
3+
# For development, we disable any cache and enable
4+
# debugging and code reloading.
5+
#
6+
# The watchers configuration can be used to run external
7+
# watchers to your application. For example, we use it
8+
# with brunch.io to recompile .js and .css sources.
9+
config :user_encryption, UserEncryptionWeb.Endpoint,
10+
http: [port: 4000],
11+
debug_errors: true,
12+
code_reloader: true,
13+
check_origin: false,
14+
watchers: []
15+
16+
# ## SSL Support
17+
#
18+
# In order to use HTTPS in development, a self-signed
19+
# certificate can be generated by running the following
20+
# command from your terminal:
21+
#
22+
# openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout priv/server.key -out priv/server.pem
23+
#
24+
# The `http:` config above can be replaced with:
25+
#
26+
# https: [port: 4000, keyfile: "priv/server.key", certfile: "priv/server.pem"],
27+
#
28+
# If desired, both `http:` and `https:` keys can be
29+
# configured to run both http and https servers on
30+
# different ports.
31+
32+
# Watch static and templates for browser reloading.
33+
config :user_encryption, UserEncryptionWeb.Endpoint,
34+
live_reload: [
35+
patterns: [
36+
~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$},
37+
~r{priv/gettext/.*(po)$},
38+
~r{lib/user_encryption_web/views/.*(ex)$},
39+
~r{lib/user_encryption_web/templates/.*(eex)$}
40+
]
41+
]
42+
43+
# Do not include metadata nor timestamps in development logs
44+
config :logger, :console, format: "[$level] $message\n"
45+
46+
# Set a higher stacktrace during development. Avoid configuring such
47+
# in production as building large stacktraces may be expensive.
48+
config :phoenix, :stacktrace_depth, 20
49+
50+
# Configure your database
51+
config :user_encryption, UserEncryption.Repo,
52+
adapter: Ecto.Adapters.Postgres,
53+
username: "postgres",
54+
password: "postgres",
55+
database: "user_encryption_dev",
56+
hostname: "localhost",
57+
pool_size: 10

config/prod.exs

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
use Mix.Config
2+
3+
# For production, we often load configuration from external
4+
# sources, such as your system environment. For this reason,
5+
# you won't find the :http configuration below, but set inside
6+
# UserEncryptionWeb.Endpoint.init/2 when load_from_system_env is
7+
# true. Any dynamic configuration should be done there.
8+
#
9+
# Don't forget to configure the url host to something meaningful,
10+
# Phoenix uses this information when generating URLs.
11+
#
12+
# Finally, we also include the path to a cache manifest
13+
# containing the digested version of static files. This
14+
# manifest is generated by the mix phx.digest task
15+
# which you typically run after static files are built.
16+
config :user_encryption, UserEncryptionWeb.Endpoint,
17+
load_from_system_env: true,
18+
url: [host: "example.com", port: 80],
19+
cache_static_manifest: "priv/static/cache_manifest.json"
20+
21+
# Do not print debug messages in production
22+
config :logger, level: :info
23+
24+
# ## SSL Support
25+
#
26+
# To get SSL working, you will need to add the `https` key
27+
# to the previous section and set your `:url` port to 443:
28+
#
29+
# config :user_encryption, UserEncryptionWeb.Endpoint,
30+
# ...
31+
# url: [host: "example.com", port: 443],
32+
# https: [:inet6,
33+
# port: 443,
34+
# keyfile: System.get_env("SOME_APP_SSL_KEY_PATH"),
35+
# certfile: System.get_env("SOME_APP_SSL_CERT_PATH")]
36+
#
37+
# Where those two env variables return an absolute path to
38+
# the key and cert in disk or a relative path inside priv,
39+
# for example "priv/ssl/server.key".
40+
#
41+
# We also recommend setting `force_ssl`, ensuring no data is
42+
# ever sent via http, always redirecting to https:
43+
#
44+
# config :user_encryption, UserEncryptionWeb.Endpoint,
45+
# force_ssl: [hsts: true]
46+
#
47+
# Check `Plug.SSL` for all available options in `force_ssl`.
48+
49+
# ## Using releases
50+
#
51+
# If you are doing OTP releases, you need to instruct Phoenix
52+
# to start the server for all endpoints:
53+
#
54+
# config :phoenix, :serve_endpoints, true
55+
#
56+
# Alternatively, you can configure exactly which server to
57+
# start per endpoint:
58+
#
59+
# config :user_encryption, UserEncryptionWeb.Endpoint, server: true
60+
#
61+
62+
# Finally import the config/prod.secret.exs
63+
# which should be versioned separately.
64+
import_config "prod.secret.exs"

config/test.exs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
use Mix.Config
2+
3+
# We don't run a server during test. If one is required,
4+
# you can enable the server option below.
5+
config :user_encryption, UserEncryptionWeb.Endpoint,
6+
http: [port: 4001],
7+
server: false
8+
9+
# Print only warnings and errors during test
10+
config :logger, level: :warn
11+
12+
# Configure your database
13+
config :user_encryption, UserEncryption.Repo,
14+
adapter: Ecto.Adapters.Postgres,
15+
username: "postgres",
16+
password: "postgres",
17+
database: "user_encryption_test",
18+
hostname: "localhost",
19+
pool: Ecto.Adapters.SQL.Sandbox

lib/user_encryption.ex

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
defmodule UserEncryption do
2+
@moduledoc """
3+
UserEncryption keeps the contexts that define your domain
4+
and business logic.
5+
6+
Contexts are also responsible for managing your data, regardless
7+
if it comes from the database, an external API or others.
8+
"""
9+
end

0 commit comments

Comments
 (0)