This is a coding exercise to test your understanding of two parts of our current tech stack. These parts are React and Elixir/Phoenix. In the Javascript code, React, ReactRedux, ReactRouter have already been included. For CSS, we use TailwindCSS
, so we'd appreciate it if you attempted to use TailwindCSS
for your styling. You do not have to use Redux or ReactRouter, but can if you want. For server code only Phoenix and Phoenix.HTML have been added.
- Install dependencies with
mix deps.get
- Change to the assets directory
- Install Node.js dependencies with
yarn
cd ..
to the root of the Elixir app- Start Phoenix endpoint with
mix phx.server
- Build an endpoint that returns a list of fahrenheit temperatures. There is already a prepared controller at ./lib/pop_web/controllers/temperature.ex.
- Use React to display the fahrenheit temperatures along with the corresponding celsius and kelvin representations in a table. There is a Conversion component placeholder in assets/js/conversion.js.
- Elixir tests will be run with
mix test
- React tests will be run with
yarn run jest
from theassets
directory
Once you've started the server with mix phx.server
then you can visit localhost:4000
from your browser.
- Official website: https://www.phoenixframework.org/
- Guides: https://hexdocs.pm/phoenix/overview.html
- Docs: https://hexdocs.pm/phoenix
- Forum: https://elixirforum.com/c/phoenix-forum
- Source: https://github.com/phoenixframework/phoenix
- Accessing
/api/temperature
returns a list of temperatures in fahrenheit, celsius, and kelvin. - Three random temperatures were chosen to demonstrate the functionality.