Today I Learned in Elixir
Latest commit f351b1e Sep 20, 2018
Permalink
Failed to load latest commit information.
.circleci Add install instructions for libappindicator3-1 Apr 20, 2018
.github Add an issue template for Github Dec 28, 2016
assets Upgrade codemirror, jquery, and autosize Jun 8, 2018
config Compress dynamic responses in production Sep 18, 2018
lib Use module names, close #214 Sep 19, 2018
priv Remove unused Google ID from developer Dec 8, 2017
test Format a new test case Feb 28, 2018
.circleci-rc Add circleci-status dotfile Mar 21, 2018
.credo.exs Ignore credo moduledoc recommendation Aug 22, 2017
.env.example Add guest authoring feature Feb 25, 2018
.formatter.exs Add an Elixir formatter file Jan 26, 2018
.gitignore Remove compiled js files from git Aug 22, 2017
.iex.exs Allow developer to reload IEx session Aug 22, 2017
.projections.json Add a README projection Nov 17, 2017
CODE_OF_CONDUCT.md Add basic README and CoC Nov 18, 2016
CONTRIBUTING.md Document our Elixir 1.6 autoformatter integration Jan 31, 2018
LICENSE.md Link to the license file Aug 22, 2017
Procfile Configure production configuration for Heroku Jan 4, 2017
README.md Add a mix task for deployments Apr 18, 2018
USAGE.md Add another fork of Tilex in production Nov 1, 2017
app.json Require canonical domain for Heroku review apps Jul 30, 2017
elixir_buildpack.config Specify elixir version 1.5 for heroku buildpack Aug 13, 2017
mix.exs Upgrade phoenix to 1.3.2 Jun 8, 2018
mix.lock Upgrade postgrex Jun 8, 2018
phoenix_static_buildpack.config phoenix_static_buildpack.config to clear cache Aug 3, 2017

README.md

Tilex - Today I Learned in Elixir

CircleCI

Today I Learned is an open-source project by the team at Hashrocket that catalogues the sharing & accumulation of knowledge as it happens day-to-day. Posts have a 200-word limit, and posting is open to any Rocketeer as well as select friends of the team. We hope you enjoy learning along with us.

This site was open-sourced as a window into our development process, as well as to allow people to experiment with the site on their own and contribute to the project.

We originally implemented Tilex as hr-til, a Ruby on Rails app.

Installation

If you are creating your own version of the site, fork the repository.

Then, install Erlang, Elixir, Phoenix, and PostgreSQL.

Next, follow these setup steps:

$ git clone https://github.com/hashrocket/tilex
$ cd tilex
$ mix deps.get
$ mix ecto.setup
$ npm install --prefix assets
$ mix phx.server

If you'd like to skip the database seeds, run mix ecto.create && mix ecto.migrate in place of mix ecto.setup.

Now you can visit localhost:4000 from your browser.

To serve the app at a different port, include the PORT environment variable when starting the server:

$ PORT=4444 mix phx.server

To set environmental variables, copy the example file:

$ cp .env{.example,}

Set your environmental variables in the new file, and then source them:

$ source .env

Authentication

Authentication is managed by Omniauth and Google. See the omniauth-google-oauth2 README and Google Oauth 2 docs for setup instructions. To allow users from a domain and/or comma separated whitelist, set those configurations in your environment:

# .env

export GOOGLE_CLIENT_ID="your-key.apps.googleusercontent.com"
export GOOGLE_CLIENT_SECRET="yoursecret"
export HOSTED_DOMAIN="your-domain.com"
export GUEST_AUTHOR_WHITELIST="joedeveloper@otherdomain.com, suziedeveloper@freelancer.com"

Once set, visit localhost:4000/admin and log in with an email address from your permitted domain.

Tilex creates a new user on the first authentication, and then finds that same user on subsequent authentications.

Testing

Wallaby relies on ChromeDriver; install it via your method of choice.

Run the tests with:

$ mix test

Deployment

Hashrocket's Tilex is deployed to Heroku. These are Hashrocket's deployed instances:

This project contains Mix tasks to deploy our instances; use as follows:

$ mix deploy <environment>

Contributing

Please see CONTRIBUTING for more information.

Code of Conduct

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct. Please see CODE OF CONDUCT for more information.

Usage

We love seeing forks of Today I Learned in production! Please consult USAGE for guidelines on appropriate styling and attribution.

License

Tilex is released under the MIT License. Please see LICENSE for more information.


About

Hashrocket logo

Tilex is supported by the team at Hashrocket, a multidisciplinary design and development consultancy. If you'd like to work with us or join our team, don't hesitate to get in touch.