Cadet is the web application powering Source Academy.
- Elixir 1.10.4
- Erlang/OTP 23.0.3
- PostgreSQL 11.8
It is probably okay to use a different version of PostgreSQL or Erlang/OTP, but
using a different version of Elixir may result in differences in e.g. mix format
.
-
Set up the development secrets (replace the values appropriately)
$ cp config/dev.secrets.exs.example config/dev.secrets.exs $ vim config/dev.secrets.exs
- To use LumiNUS authentication, specify a valid LumiNUS
api_key
. Note that the frontend will supply the ADFS client ID and redirect URL (so you will need that too, but not here).
-
Install Elixir dependencies
$ mix deps.get
-
Initialise development database
$ mix ecto.setup
-
Run the server on your local machine
$ mix phx.server
-
You may now make API calls to the server locally via
localhost:4000
. The API documentation can also be accessed at http://localhost:4000/swagger.
You can obtain an access_token
JWT for a user with a given role by simply
running:
$ mix cadet.token <role>
For more information, run
$ mix help cadet.token
We follow this style guide: https://github.com/lexmag/elixir-style-guide and https://github.com/christopheradams/elixir_style_guide
Where there is a conflict between the two, the first one (lexmag) shall be the one followed.
Generated with DBeaver on 17 October 2020