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.
Today I Learned was open-sourced to:
- provide a window into our development process
- allow people to experiment with the site on their own
- allow folks to contribute back to the project
We originally implemented Tilex as hr-til, a Ruby on Rails app.
For updates, follow us on Twitter and subscribe to our monthly newsletter.
If you are creating your own version of the site, fork the repository and clone your fork:
$ git clone https://github.com/<your_github>/tilex
$ cd tilexThen, install Erlang, Elixir, Node, and PostgreSQL. mise can do this in a single command:
$ mise installThe first step in the setup is to clone the .env file:
$ cp .env.example .envFrom here, we recommend using make which will print out the help message with all dev tools we have:
$ make
Makefile console ## Opens the App console.
Makefile help ## Shows this help.
Makefile outdated ## Shows outdated packages.
Makefile server ## Start the App server.
Makefile setup ## Setup the App.
Makefile test ## Run the test suite.
Makefile update ## Update dependencies.To setup the project and start the server you can:
$ make setup serverNow you can visit http://localhost:4000 from your browser.
All Makefile tasks will automatically load the .env file, so if you want to run any command manually you may have to load that file first:
source .envSource your environment variables, install dependencies, seed the db, and start the server:
$ mix deps.get
$ mix ecto.setup
$ npm install --prefix assets
$ mix phx.serverNow you can visit http://localhost:4000 from your browser.
Optionally, And if you want to run a seeds task to populate your local database with some fake data you can run:
$ DATE_DISPLAY_TZ=America/Chicago mix ecto.seedsIf you are an user of TIL and wants to write TIL posts with some help of your AI tooling you can use our MCP servers. Log in into your TIL service, then go to the profile page. There's a box there to generate an MCP API Key that's needed to authenticate. We added a few helper code snippets to help you to setup the TIL MCP into your tooling.
After the MCP is setup correctly you can start asking your AI to write TILs. The response on each new TIL should be a link where you'd have to review the title, content and channel and publish it.
So in case you want to use your AI tools to improve the TIL code we've added the usage_rules into the project and we also added tidewave served as a MCP.
http://localhost:4000/tidewave/mcp
Authentication is managed by Ueberauth and Google. See the ueberauth_google README and Google Oauth 2 docs for instructions. To allow users from a domain and/or comma-separated allowlist, 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_ALLOWLIST="[email protected], [email protected]"Once set, visit http://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.
Wallaby relies on ChromeDriver; install it via your method of choice. Then, run tests with:
$ make testor:
$ mix testHashrocket's Tilex is deployed to Heroku. These are Hashrocket's deployed instances:
- Staging: https://tilex-staging.herokuapp.com
- Production: https://til.hashrocket.com
This project contains Mix tasks to deploy our instances; use as follows:
$ mix deploy <environment>Please see CONTRIBUTING for more information. Thank you to all of our contributors.
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.
We love seeing forks of Today I Learned in production! Please consult USAGE for guidelines on appropriate styling and attribution.
Tilex is released under the MIT License.opensource.org/licenses/MIT). Please see LICENSE for more information.
Tilex is supported by the team at Hashrocket, a multidisciplinary design and development consultancy. If you'd like to work with us, don't hesitate to contact us today!