Cadet is the web application powering Source Academy.
master
is the main development branch, and may be broken, buggy, unstable, etc. It may not work with the frontend, if there are frontend changes that have not yet been merged.stable
is the stable branch and should work with the stable branch of the frontend. Note thatstable
may not have stable history!
- Elixir 1.13.3
- Erlang/OTP 23.2.1
- PostgreSQL 13 or 14
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
All sources in this repository are licensed under the Apache License Version 2.